Skip to content

Different Diffusion Coefficients in one Simulation

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Different Diffusion Coefficients in one Simulation

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #9592
    beko337
    Participant

    Hello, i have a 2D Simulation, that is a coupled combination Of a Navier Stokes Lattice and a Advection Diffusion Lattice. Now i want to add a Geometry Element, that has a different physical Diffusivity. Is this possible in OpenLB? I tried a lot of different approaches but never got it working unfortunately.

    Any help would be greatly appreciated!
    Thanks in advance

    #9603
    FBukreev
    Keymaster

    Hello,

    you can let the dynamics read the OMEGA from an external OMEGA field and then define the distribution of diffusivities in form of locally varying Omegas in that external field.

    #9608
    beko337
    Participant

    Hi, thank you for your response. How can i let the dynamics read it from an external Field? I also thought about this approach but did not find out how to use an external field for OMEGA. Is this also possible, with the finite Difference Post Processor Model like in the Pipe3D Advection Diffusion example? If yes, how would i achieve this?
    Thank you!

    #9609
    Adrian
    Keymaster

    Youc an use the OmegaFromCell collision modifier (which is just an alias for ParameterFromCell which allows you to do this for any parameter.

    #9610
    beko337
    Participant

    Okay thank you, is there any example that incorporates this modifier? Unfortunately i have no idea, how to implement it in my Simulation setup.

    #9611
    Adrian
    Keymaster

    A basic introduction into the dynamics system is available in section 2.3 of the user guide.

    What you will want to do is to wrap your collision operator in the modifier:

    
    using LocalOmegaBGK = dynamics::Tuple<
      T, DESCRIPTOR,
      momenta::BulkTuple,
      equilibria::SecondOrder,
      collision::ParameterFromCell<descriptors::OMEGA, collision::BGK>
    >;
    

    Don’t forget to assign a value to the descriptors::OMEGA field using e.g.

    
    sLattice.defineField<descriptors::OMEGA>(omegaF); // some functor providing the values
    
    #9613
    beko337
    Participant

    Thank you, i got it compiling fine now. But if i try to change the “fd::fdParams::Diffusivity” Field ( i just replaced the “descriptors::OMEGA”), it does not seem to change the diffusion at all.

    #9614
    Adrian
    Keymaster

    Which collision operator are you using? BGK only has the OMEGA parameter so it is not surprising in the least that reading some other parameter from the cell has no impact.

    #9615
    beko337
    Participant

    Oh okay, yes I am using the BGK collision operator, basically my implementation at the moment is the same as the advectionDiffusionPipe3d example but in 2D.

    #9617
    beko337
    Participant

    Okay, i got it to work but unfortunately it seems that in my Simulation if I choose a low Diffusion Coefficient like 1e-9 (I am using AdvectionDiffusionBGKDynamics), there are weird artifacts. Is there any way to implement these low Diffusion Coefficients? Thanks!

    #9618
    FBukreev
    Keymaster

    You can look into src/dynamics/navierStokesAdvectionDiffusionCoupling.h and find LESADECoupling. You can apply it to your simulation and find an appropriat e Schmidt number. It will stabilize locally the ADE.

    #9621
    beko337
    Participant

    Hey, thanks. Unfortunately I realized, that something is wrong with my AD Lattice in general and its not because of the coupling. If i choose a small Diffusioncoefficient i get a kind of grainyness on AD lattice. I of course tried increasing the resolution but this didn’t make any difference. This is the output of my AD Unit Converter:
    UnitConverter information

    —————– UnitConverter information —————–
    — Parameters:
    Resolution: N= 15
    Lattice velocity: latticeU= 6.66667e-07
    Lattice relaxation frequency: omega= 2
    Lattice relaxation time: tau= 0.500001
    Characteristical length(m): charL= 0.01
    Characteristical speed(m/s): charU= 0.001
    Phys. diffusivity (m^2/s): charNu= 3.33333e-07
    Phys. density(kg/m^d): charRho= 1
    Characteristical pressure(N/m^2): charPressure= 0
    Mach number: machNumber= 1.1547e-06
    Knudsen number: knudsenNumber= 3.849e-08
    Peclet Number: Pe= 30

    — Conversion factors:
    Voxel length(m): physDeltaX= 0.000666667
    Time step(s): physDeltaT= 4.44444e-07
    Velocity factor(m/s): physVelocity= 1500
    Density factor(kg/m^3): physDensity= 1
    Mass factor(kg): physMass= 2.96296e-10
    Diffusion factor(m^2/s): physDiffusion= 1
    Force factor(N): physForce= 1
    ————————————————————-

    I would be very thankful for any ideas.

    #9622
    FBukreev
    Keymaster

    Can you use not the AD unitconverter there, but only the NSE unit converter and then compute the Omega for AD through converter.getAdvectionDiffusionRelaxationFrequenceFromDiffusivity?

    #9623
    beko337
    Participant

    I just tried it that way, but the problem persists.

    #9626
    FBukreev
    Keymaster

    Sorry, but from the provided information I cannot say what is cuurently wrong with the AD lattice.

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