Additional Force Field
September 2, 2023 at 11:27 pm #7720Henderson_CParticipant
Hello OpenLB developers,
I want to add a force field to the descriptor (PorousParticleWithContactD2Q9Descriptor = D2Q9< POROSITY, VELOCITY_NUMERATOR, VELOCITY_DENOMINATOR, CONTACT_DETECTION >). How can I do that? The reason behind such decision is that I want to have a poiseuille flow with Forced BC. Any suggestions?
Regards,September 4, 2023 at 9:59 am #7721AdrianKeymaster
You can add a force field by declaring that you want a force field, i.e. by adding the
descriptors::FORCEtype to your descriptor (or just
FORCEin your case as you seem to be including the
After this you can set the field as any other field (using e.g.
SuperLattice::defineField– strictly speaking you don’t even need to add the field to the descriptor, this is mainly for documentation).
Finally you’ll need to select appropriate forced dynamics for your per-cell models.September 4, 2023 at 2:13 pm #7724Henderson_CParticipant
Thank you for your reply. I have add the force field but I still don’t observe any convective transport (Change in velocity). My approach was based on the Poiseuille Flow 2D Test case (Flowtype forced):
/// Code snippet
typedef D2Q9<FORCE, POROSITY, VELOCITY_NUMERATOR, VELOCITY_DENOMINATOR, CONTACT_DETECTION> NSDESCRIPTOR;
// Prepare Lattice
T Ly = converter.getLatticeLength( charL/2. );
std::vector<T> poiseuilleForce( 2,T() );
poiseuilleForce = 2.*converter.getLatticeViscosity()* converter.getCharLatticeVelocity() / ( Ly*Ly ); // This rule came from fully developed flow for parallel plate
AnalyticalConst2D<T,T> force( poiseuilleForce );
// Initialize force
// End of the code
I have tried the forcedBGK dynamics and it worked but I want to use the porousparticleBGK dynamics. Any suggestions?
Regards,September 6, 2023 at 11:20 am #7728AdrianKeymaster
Ok, you will need to use dynamics that include a forcing scheme. This is not the case for
template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple> using PorousParticleBGKdynamics = dynamics::Tuple< T, DESCRIPTOR, MOMENTA, equilibria::SecondOrder, collision::PorousParticle<collision::BGK,false>, dynamics::ExposePorousParticleMomenta >;
As this dynamics already use a combination rule (
dynamics::ExposePorousParticleMomenta) you can not directly insert one of the existing forcing schemes in
src/dynamics/forcing.h. Depending on what exactly you want to model you will need to adapt your own combination rule to both expose the porous particle momenta and apply the forcing. But first I would recommend to check the literature / verify your model w.r.t. the specific forcing scheme you want to use.
Once you have selected a forcing scheme you can combine the two rules
forcing::*into a new one for your situation.
- You must be logged in to reply to this topic.