Skip to content

Compabilitities of superLattticeIntegralF2D for DynOmegaD2Q9Descriptor

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Compabilitities of superLattticeIntegralF2D for DynOmegaD2Q9Descriptor

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4535
    guojuw
    Participant

    Dear OLB developers,

    I am interested in the functions provided in superLatticeIntegralF2D, superLatticeLocalF2d for postprocessing, e.g., SuperLatticePhysWallShearStress2D, SuperLatticePhysDrag2D, etc.

    I am also using DynOmegaD2Q9Descriptor for power-law fluid modeling. I am wondering whether those postprocessing functions (SuperLatticePhysWallShearStress2D and SuperLatticePhysDrag2D) can work with DynOmegaD2Q9Descriptor?

    It seems that the postprocessing functions use a constant omega from the unit converter but not the varying omega from the external field.

    Regards,
    Junwei Guo

    #4538
    jonathan
    Participant

    Dear Junwei Guo,

    BlockLatticePhysWallShearStress2D uses a constant relaxation frequency only in _physFactor for unit conversion. Its calculation can just be moved into the operator() for a cell dependant calculation.
    AFAIK your descriptor DynOmegaD2Q9 stores omega in the external field and can therefore be accessed by a template variable.

    Try changing the source of both Super- and BlockLatticePhysWallShearStress to provide a FIELD template argument. For a generic example see how its done in Super- and BlockLatticeField2D.
    Then just replace omega in

    _physFactor = -omega * descriptors::invCs2<T,DESCRIPTOR>() / dt * this->_converter.getPhysDensity() * this->_converter.getPhysViscosity();

    with the computeField function for your desired external field and move the line to the top of the operator().

    Best,
    Jonathan

    • This reply was modified 5 years, 2 months ago by jonathan.
    • This reply was modified 5 years, 2 months ago by jonathan.
    #4541
    jonathan
    Participant

    An even easier way of achieving a static solution would be to just specify the field type inside the physFactor calculation.

    _physFactor = -this->_blockLattice.get(input[0]+_overlap,input[1]+_overlap).template getFieldPointer<descriptors::OMEGA>()[0] * descriptors::invCs2<T,DESCRIPTOR>() / dt * this->_converter.getPhysDensity() * this->_converter.getPhysViscosity();

    The method described in my first answer is more generic and necessary if you want to have easily swappable descriptors.

    Best,
    Jonathan

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