Different Diffusion Coefficients in one Simulation
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Different Diffusion Coefficients in one Simulation
- This topic has 14 replies, 3 voices, and was last updated 1 month ago by FBukreev.
-
AuthorPosts
-
December 9, 2024 at 12:18 pm #9592beko337Participant
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 advanceDecember 12, 2024 at 4:59 pm #9603FBukreevKeymasterHello,
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.
December 13, 2024 at 1:03 pm #9608beko337ParticipantHi, 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!December 13, 2024 at 1:19 pm #9609AdrianKeymasterYouc an use the OmegaFromCell collision modifier (which is just an alias for
ParameterFromCell
which allows you to do this for any parameter.December 13, 2024 at 2:46 pm #9610beko337ParticipantOkay thank you, is there any example that incorporates this modifier? Unfortunately i have no idea, how to implement it in my Simulation setup.
December 13, 2024 at 2:51 pm #9611AdrianKeymasterA 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
December 13, 2024 at 3:39 pm #9613beko337ParticipantThank 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.
December 13, 2024 at 3:41 pm #9614AdrianKeymasterWhich 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.
December 13, 2024 at 3:46 pm #9615beko337ParticipantOh 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.
December 17, 2024 at 12:53 am #9617beko337ParticipantOkay, 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!
December 17, 2024 at 10:52 am #9618FBukreevKeymasterYou 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.
December 19, 2024 at 1:18 pm #9621beko337ParticipantHey, 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.
December 19, 2024 at 2:58 pm #9622FBukreevKeymasterCan you use not the AD unitconverter there, but only the NSE unit converter and then compute the Omega for AD through converter.getAdvectionDiffusionRelaxationFrequenceFromDiffusivity?
December 19, 2024 at 3:35 pm #9623beko337ParticipantI just tried it that way, but the problem persists.
December 20, 2024 at 11:18 am #9626FBukreevKeymasterSorry, but from the provided information I cannot say what is cuurently wrong with the AD lattice.
-
AuthorPosts
- You must be logged in to reply to this topic.