OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Cylinder2D study
- This topic has 7 replies, 2 voices, and was last updated 3 months, 2 weeks ago by FBukreev.
February 1, 2023 at 2:57 pm #7159
I’m using the example of cylinder2D to compare drag coefficient with a star-ccm+ simulation for a project.
Is there an example that uses a normal velocity inlet boundary condition and not a Poiseuille velocity profile ?
I would like to add a convergence criterion in the simulation, but I don’t know which parameter is the most appropriate in this case ?
ThanksFebruary 1, 2023 at 4:02 pm #7161
you could replace the Poiseuille profile through a costant velocity value.
As convergence criterion you could compare velocity values between time steps in some plane in the middle of the channel. In the laminar case they will remain steady after reaching the convergence.
FedorFebruary 1, 2023 at 4:23 pm #7162
That’s what I did for the inflow but I have errors when compiling the file.
I set the velocity in the parameters of the simulation: const T Velocity = 0.05;
Then I defined the inflow condition instead of the Poiseuille inflow: sLattice.defineU( superGeometry, 3, Velocity );
I don’t know where I’m wrong
ThanksFebruary 2, 2023 at 10:35 am #7165
You mast use the AnalyticalConst2D instead of a normal variableFebruary 5, 2023 at 10:14 pm #7171
I tried to save drag coefficient data on a file but it only works for one random time step value and not for every one, I don’t find why ? (Is there a way to write the drag coefficient at every x time step ?)
The code is :
CSV<T> csvWriterSim(“SimulationV=” + std::to_string(converter.getCharPhysVelocity()));
csvWriterSim.writeDataFile(converter.getPhysTime( iT ), _drag, 16);
Another question, when I look a the simulation it looks like the flow is coming back into the channel from the pressure outlet.
I don’t know if it is normal and if it stops after several time steps or if there is a problem with my boundary conditions ?
Thank you for your help,
AntoineFebruary 8, 2023 at 11:36 am #7181
Hello, if you execute getResults each time step, then it must be written out also each time step.
If you have too strong turbulence then the flow may come sometimes back from the outlet.
FedorFebruary 14, 2023 at 3:28 pm #7193
Yes it works,
Last question about the relaxation time, I don’t understand how you defined it for each example.
For the example of laminar flow around a cylinder, it is 0.56 for the 2D simulation and 0.53 for the 3D case.
This relaxation time is related to viscosity and the time step, as the viscosity is defined by the velocity and the Reynolds number, the relaxation time basically define the time step.
So the strategy is to find a time step where there is a good stability/accuracy or the relaxation time that makes sense for a specific case?
AntoineFebruary 16, 2023 at 11:52 am #7197
take please the UnitConverterFromResolutionAndLatticeVeLocity and set the lattice velocity to 0,1. In that case the converter will aoutomatically calculate the relaxation time by which the simulation runs stabely.
The relaxation times defines how far goes the population inside of one time step.
- You must be logged in to reply to this topic.