Skip to content

SHEAR_SMAGORINSKY

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #7905
    Fuxin He
    Participant

    Dear OpenLB community,

    I replaced “SmagorinskyForcedBGKdynamics” with “ShearSmagorinskyForcedBGKdynamics” in channel3d and it never runs successfully. I can’t get it to run successfully, is this based on the descriptor, because in nozzle3d it says “#ifdef USE_SHEAR_SMAGORINSKY”.
    using DESCRIPTOR = D3Q19<AV_SHEAR>;” and I understand from the literature that I want to implement a dynamic smagorinsky model instead of a shear smagorinsky model, should I change the model to a channel in nozzle3d?

    sincerely,
    Fuxin He

    #7920
    stephan
    Moderator

    Dear Fuxin He,

    for using the shearSmagorinsky dynamics, please use the conforming descriptor as you suggested:
    “#ifdef USE_SHEAR_SMAGORINSKY”.
    using DESCRIPTOR = D3Q19<AV_SHEAR>;”

    Best regards,
    Stephan

    #7922
    Rookie
    Participant

    Rookie

    • This reply was modified 5 months, 2 weeks ago by Rookie.
    • This reply was modified 5 months, 2 weeks ago by Rookie.
    • This reply was modified 5 months, 2 weeks ago by Rookie.
    #7926
    Fuxin He
    Participant

    Dear Stephan,

    Thanks for writing back, I’m still using this descriptor“typedef WallFunctionForcedD3Q19Descriptor DESCRIPTOR;”and selected “ShearSmagorinskyForcedBGKdynamics”.It runs fine, so is this something I still need to change.

    I also want to ask a question, I saw a post mentioned a mistake about Reynolds stress, but you only corrected half of the line 225 should be as said in this post:
    https://www.openlb.net/forum/topic/correction-to-superlatticetimeaveragedcrosscorrelationf3d/
    If I set after “SuperLatticeTimeAveragedCrossCorrelationF3D < T > sAveragedVelcc (sVel sVel);”Is the output “Time Averaged Corss Correlation physVelocity-physVelocity_2” Reynolds stress?

    sincerely,
    Fuxin He

    #7927
    stephan
    Moderator

    Dear Fuxin He,

    please note that the descriptor needs a tag …<AV_SHEAR> to make the shear Smagorinsky dynamics work correctly.

    Please have a look at the doxygen to learn more about input and output of specific functors.
    In your case, please consider:
    https://www.openlb.net/DoxyGen/html/da/d58/classolb_1_1SuperLatticeTimeAveragedCrossCorrelationF3D.html

    BR
    Stephan

    #7928
    Fuxin He
    Participant

    Dear Stephan,

    In this file I also think it should be changed to “_sDataMN.getBlock(iCloc).get(input+1,iDim)/_ensembles” because it is “(uv)_av – u_av v_av,” and there is no averaging of (uv)。After I output the original result and compare it with the literature, I find that the trend is correct, but the value is indeed too large

    sincerely,
    Fuxin He

    #7929
    stephan
    Moderator

    Dear Fuxin He,

    please specify the exact lines of the code you mean.
    In case you have found a bug, please provide comparison to reference data in a plot or implementation for us to double-check.

    Thank you and BR,
    Stephan

    #7934
    Fuxin He
    Participant

    Dear Stephan,

    I’m sorry for the late reply, because I just finished dealing with the result. The error is just as I said in the last post attached. In of this folder (/ olb1.6 r0 / SRC/functors/lattice timeAveraged/superLatticeTimeAveraged3D hh) line 225 should be “the output = [iDim] _sDataMN.getBlock(iCloc).get(input+1,iDim)-_sDataM.getBlock(iCloc).get(input+1,iDimM) *_sDataN.getBlock(iCloc).get(input+1,iDimN)/_ensembles/_ensembles;” Change to “output[iDim] = _sDataMN.getBlock(iCloc).get(input+1,iDim)/_ensembles-_sDataM.getBlock(iCloc).get(input+1,iDimM)” *_sDataN.getBlock(iCloc).get(input+1,iDimN)/_ensembles/_ensembles. In other words, you are missing an average of MN, which is the Reynolds stress processed after my modification. Although it is not in perfect agreement with Kim’s result, it is much better than the original data, which is 1000 times higher than the modified one.

    Below is my output, compared to Kim’s literature:Kim J, Moin P, Moser R. Turbulence statistics in fully developed channel flow at low Reynolds number[J]. Journal of fluid mechanics, 1987, 177: 133-166.

    https://postimg.cc/gallery/ZSHWS1h

    sincerely,
    Fuxin He

    #7961
    Fuxin He
    Participant

    Dear Stephan,

    Have you verified whether this code should be modified in this way? Please allow me to ask you some more questions.

    The first is when I again see the problem of Descriptor, found “using DynSmagorinskyD3Q19Descriptor = D3Q19 < SMAGO_CONST >;” Is there a dynamic smagorinsky model in openLB? I can’t find one.

    The second is whether “using ShearSmagorinskyForcedD3Q19Descriptor = D3Q19 < AV_SHEAR, FORCE >; “and” using WallFunctionForcedD3Q19Descriptor = D3Q19 < TAU_W TAU_EFF, FORCE >;” together,such as into “using WallFunctionForcedD3Q19Descriptor = D3Q19 < TAU_W TAU_EFF, AV_SHEAR, FORCE >;”

    sincerely,
    Fuxin He

    #7963
    Adrian
    Keymaster

    The fields declared in a descriptor alias (e.g. AV_SHEAR and FORCE in ShearSmagorinskyForcedD3Q19Descriptor) are primarily for documentation – it only means that those fields will be made available by default. The code would continue to work if you remove or extend this list as “missing” fields are allocated on demand. So from a core perspective you can combine both field lists into a new alias WallFunctionForcedD3Q19Descriptor. However you will still need to set appropriate dynamics and boundary conditions that actually use those fields in the manner that you desire.

    Which specific model do you mean by “dynamic smagorinsky”? There are many LES models already available in OpenLB and new ones are easy to add using the tuple-based framework.

    #7966
    Fuxin He
    Participant

    Dear Adrian,

    Thank you for your reply, but I still don’t fully understand your explanation. You mean that it will be automatically allocated according to demand even if I don’t modify it. I just want to use “ShearSmagorinskyForcedBGKdynamics” and “wallFunctionParam” in Channel3d ,then I will add another one of the descriptor needed, such as:”WallFunctionForcedD3Q19Descriptor = D3Q19 < TAU_W TAU_EFF, AV_SHEAR, FORCE >;”Am I right? Or should I just use the original(WallFunctionForcedD3Q19Descriptor = D3Q19 < TAU_W TAU_EFF, FORCE >),because it will automatically generate what I’m missing.

    I’m referring to the Dynamic Smagorink-Lilly model,or the Dynamic subgrid scale modeling,or DSM for short. You can refer to the following literature.”DynSmagorinskyD3Q19Descriptor = D3Q19 < SMAGO_CONST >” seems to mean the smagorinsky coefficient is a constant in the OpenLB.

    Premnath K N, Pattison M J, Banerjee S. Dynamic subgrid scale modeling of turbulent flows using lattice-Boltzmann method[J]. Physica A: Statistical Mechanics and its Applications, 2009, 388(13): 2640-2658.

    sincerely,
    Fuxin He

    #7968
    Adrian
    Keymaster

    What I mean is that it doesn’t matter beyond documentation purposes what fields you mention in the descriptor. e.g. the velocity of fixed velocity BCs is commonly stored in the field momenta::FixedVelocityMomentumGeneric::VELOCITY which you have probably never seen mentioned in a descriptor. Nevertheless everything works as intended. Analogously just mentioning a field in a descriptor does nothing on the model level – the field still needs to be actually used.

    For your second question: Statements such as “the smagorinsky coefficient is a constant in the OpenLB” don’t really make sense as OpenLB is a framework for implementing LB simulations and offers both an vast library of LB models and tools to create new ones. A particular LES model in OpenLB may use a globally constant Smagorinsky value (e.g. the SmagorinskyBGKdynamics do just that) but other models in OpenLB use heterogeneous Smagorinsky values.

    e.g. ExternalSmagorinskyBGKdynamics reads per-cell Smagorinsky values from the collision::LES::Smagorinsky field.

    
    using ExternalSmagorinskyBGK = dynamics::Tuple<
      T, DESCRIPTOR,
      MOMENTA,
      equilibria::SecondOrder,
      collision::ParameterFromCell<collision::LES::Smagorinsky,
                                   collision::SmagorinskyEffectiveOmega<collision::BGK>>
    >;
    

    The collision modifier collision::ParameterFromCell can be used to transform any tuple-based dynamics with a global parameter into a dynamics that uses a local parameter instead.

    #7973
    Fuxin He
    Participant

    Dear Adrian,

    Thank you very much for your patience and meticulous explanation. I understand what you mean.

    sincerely,
    Fuxin He

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