Additional Force Field
› Forums › on OpenLB › General Topics › Additional Force Field
- This topic has 3 replies, 2 voices, and was last updated 2 years, 2 months ago by Adrian.
-
AuthorPosts
-
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 #7721AdrianKeymasterYou can add a force field by declaring that you want a force field, i.e. by adding the
descriptors::FORCEtype to your descriptor (or justFORCEin your case as you seem to be including thedescriptorsnamespace already).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_CParticipantHello Adrian,
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[0] = 2.*converter.getLatticeViscosity()* converter.getCharLatticeVelocity() / ( Ly*Ly ); // This rule came from fully developed flow for parallel plate
AnalyticalConst2D<T,T> force( poiseuilleForce );// Initialize force
NSlattice.defineField<FORCE>(bulkIndicator, force);
NSlattice.defineField<FORCE>(superGeometry.getMaterialIndicator({2,5}), force);
// End of the codeI 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 #7728AdrianKeymasterOk, you will need to use dynamics that include a forcing scheme. This is not the case for
PorousParticleBGK: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 insrc/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
dynamics::ExposePorousParticleMomentaandforcing::*into a new one for your situation. -
AuthorPosts
- You must be logged in to reply to this topic.
