Skip to content

About LES+RayleighBernard flow

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics About LES+RayleighBernard flow

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6759
    steed188
    Participant

    Hi, I’m trying a high Reynolds non-isothermal flow using LES + Boussinesq approximation,

    I learned the RayleighBernard example case. I think two parts should be modified compared to the example:
    1. the advection lattice descriptor is modified to SmagorinskyAdvectionDiffusionD3Q7Descriptor;
    2. the coupling part should be modified” to “SmagorinskyBoussinesqCouplingGenerator3D”.

    I don’t know whether this is right. So I made the following code. But it does not work. The simulation has been divergent.

    //——————————————————————–
    typedef ForcedMRTD3Q19Descriptor NSDESCRIPTOR;
    typedef SmagorinskyAdvectionDiffusionD3Q7Descriptor ADDESCRIPTOR;

    //—————————–Define lattices—————————
    SuperLattice<T, ADDESCRIPTOR> adLattice(superGeometry); // temperature lattice
    SuperLattice<T, NSDESCRIPTOR> nsLattice(superGeometry); // fluid lattice

    T adOmega = converter.getLatticeThermalRelaxationFrequency();
    T nsOmega = converter.getLatticeRelaxationFrequency();

    //———————-Dynamics and boundary conditions————————-
    nsLattice.defineDynamics<SmagorinskyForcedMRTdynamics>(superGeometry, 1);
    nsLattice.setParameter<collision::LES::Smagorinsky>(cSmago);
    ……
    adLattice.defineDynamics<AdvectionDiffusionBGKdynamics>(allIndicator);
    ……
    adLattice.setParameter<descriptors::OMEGA>(adOmega);
    nsLattice.setParameter<descriptors::OMEGA>(nsOmega);

    //———————-Coupling parts————————-
    std::vector<T> dir{0.0, 0.0, 1.0};
    T boussinesqForcePrefactor = 9.81 / converter.getConversionFactorVelocity() * converter.getConversionFactorTime() * converter.getCharPhysTemperatureDifference() * converter.getPhysThermalExpansionCoefficient();

    T smagoPrefactor = cSmago * cSmago * descriptors::invCs2<T, NSDESCRIPTOR>() * descriptors::invCs2<T, NSDESCRIPTOR>() * 2 * util::sqrt(2);

    SmagorinskyBoussinesqCouplingGenerator3D<T, NSDESCRIPTOR> SmagoCoupling(0, converter.getLatticeLength(lx), 0, converter.getLatticeLength(ly), 0, converter.getLatticeLength(lz), boussinesqForcePrefactor, converter.getLatticeTemperature((Thot – Tcold)/2.0), Thot – Tcold, dir, PrSGS, smagoPrefactor);

    nsLattice.addLatticeCoupling(SmagoCoupling, adLattice);
    ……

    //———————Collide and stream parts————————
    adLattice.collideAndStream();
    nsLattice.collideAndStream();
    nsLattice.executeCoupling();
    //———————————————————————–

    #6760
    mathias
    Keymaster

    I think smagoPrefactor should be around 0.14. For more details https://publikationen.bibliothek.kit.edu/1000126904 . Best Mathias

    #6771
    steed188
    Participant

    Oh, thank you mathias.

    Do you mean that smagoPrefactor in SmagorinskyBoussinesqCouplingGenerator3D is actually the smagorinsky constant, while not smagoPrefactor = cSmago * cSmago * descriptors::invCs2<T, NSDESCRIPTOR>() * descriptors::invCs2<T, NSDESCRIPTOR>() * 2 * util::sqrt(2)?

    By the way, I’m also confused about two parameters deltaTemp and T0 in SmagorinskyBoussinesqCouplingGenerator3D. Should deltaTemp always be 1, meaning I have to normalize the T_high and T_low to 1 and 0? Can I just use the real temperature (like deltaTemp=20℃)? and what is T0? The RayleighBernard example gives the low temperature. Should it always be so? Or is it just a reference temperature that I can set, such as (T_high – T_low)/2?

    #6776
    stephan
    Moderator

    Dear steed188,

    to double-check the correctness of your code, the examples in olb/examples/thermal should be helpful. You might want to start with the example and modify it step by step with compile and run in between to find the source of divergence.

    Please use the smagoPrefactor as defined in the examples since there is a unique mapping between the thermal and incompressible LES (see https://publikationen.bibliothek.kit.edu/1000126904).

    The arguments of the couplingGenerator should be in lattice units.
    To specify the effect of other values (passed in lattice units), please use the default example and evaluate the difference when changing the physical parameters.

    BR
    Stephan

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