Skip to content

Additional Force Field

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7720
    Henderson_C
    Participant

    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,

    #7721
    Adrian
    Keymaster

    You can add a force field by declaring that you want a force field, i.e. by adding the descriptors::FORCE type to your descriptor (or just FORCE in your case as you seem to be including the descriptors namespace 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.

    #7724
    Henderson_C
    Participant

    Hello 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 code

    I have tried the forcedBGK dynamics and it worked but I want to use the porousparticleBGK dynamics. Any suggestions?

    Regards,

    #7728
    Adrian
    Keymaster

    Ok, 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 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 dynamics::ExposePorousParticleMomenta and forcing::* into a new one for your situation.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.