January 16, 2017 at 6:39 pm #1885
I am trying to implement flow through a pipe and would like to use a pressure boundary condition at the inlet and the outlet. Since there were only velocity boundary conditions at the inlet in the examples, I am not sure how to implement the pressure BC.
I tried adding pressure BC at the inlet and outlet:Quote:bc.addPressureBoundary(superGeometry, 3, omega);
bc.addPressureBoundary(superGeometry, 4, omega);
and then setting the bounday values:Quote:AnalyticalConst3D<T,T> rhoIn(10);
sLattice.defineRho(superGeometry, 3, rhoIn);
sLattice.defineRho(superGeometry, 4, rhoOut);
But that did not work, all values were set to NaN after the 1st time step.
I am wondering how to set the inflow pressure value, since you can only set the density in lattice units. Is there a way to set a pressure at the inlet and outlet (i.e. a pressure differential) in physical pressure units?
SumitJanuary 17, 2017 at 10:49 am #2503
the function defineRho() expects lattice values. To convert a physical pressure to a lattice value, there is a function in the LBconverter called rhoFromPhysicalPressure, just have a look at the doxygen documentation:
Also when looking at e.g. the cylinder2D example the inflow velocity is slowly increased in the function setBoundaryValues(), you could try that for the pressure too. Setting large gradients without smooth transition can lead to numerical instabilities.
RobinJanuary 17, 2017 at 11:22 am #2504
thank you for the information! I will try it out.
SumitJanuary 17, 2017 at 12:23 pm #2505
I’m having issues with the set up of the boundary values.Quote:AnalyticalF3D<T,S>(1) rhoIn;
rhoIn = converter.rhoFromPhysicalPressure(pIn);
sLattice.defineRho( superGeometry, 3, rhoIn);
defineRho expects the density in the AnalyticalF3D format. However, how do I define my inlet density rhoIn as a AnalyticalF3D correctly? The doxygen page for AnalyticalF3D is somewhat cryptic.
Best, SumitJanuary 17, 2017 at 3:19 pm #2506
AnalyticalConst3D<T,T> rhoF(1) should initialize a functor rhoF with value 1. The AnalyticalF3D is rather a mother class and can not be directly initialized with a value.
RobinJanuary 17, 2017 at 4:16 pm #2508
thanks for the insight!
When I initialize it with the rho converted from the pressure (with a transition factor) it succeeds to compileQuote:AnalyticalConst3D<T,T> rhoIn(frac*converter.rhoFromPhysicalPressure(pIn));
However, when I initialize it with a value, let’s say 1 and after that set it to the convertetd rho, it fails to compile.Quote:AnalyticalConst3D<T,T> rhoIn(1);
rhoIn = frac*converter.rhoFromPhysicalPressure(pIn);
Is this because once initialized, the AnalyticalConstant3D is cannot be changed?
Thanks for the great and quick help, Robin!
SumitJanuary 17, 2017 at 4:51 pm #2509
thats correct. Once initialized the value can not be changed. Usually the values of the boundary are updated in the setBoundaryValues() function of a case file (see e.g. Cylinder2D example where a Poiseuille2D functor is applied instead of a AnalyticalConst3D). So in every time step the object is constructed woth a different value.
RobinJanuary 17, 2017 at 5:51 pm #2511
Alright, that makes sense. Thank you!July 20, 2018 at 1:03 pm #2894
If you have two pressure boundaryCode:bc.addPressureBoundary(superGeometry, 4, omegaP1);
bc.addPressureBoundary(superGeometry, 4, omegaP2);
how did you set the pressure inlet ? the code with inlet velocity and outlet pressure seem affecte the value pressure and velocity boundary base on the material of the cuboid wich define the output and the input…
Here you have two differents boudary with the same material 4. How did you do to affecte the correct value to each boundary ?
I try to modify cylinder2d to have delta P .
Laurent.July 20, 2018 at 4:21 pm #2895
modifying cylinder2d you rather want:
bc.addPressureBoundary(superGeometry, 3, omega);
bc.addPressureBoundary(superGeometry, 4, omega);
This sets one Pressure at the inlet (material number 3) replacing the velocity boundary and keeps the already existing pressure boundary at the outlet (material number 4). You want both boundaries to have the same omega, as different omega would imply either a different discretisation (what is not the case) or a difference in the physical viscosity (what you probably do not want to simulate).
Now you want to set different pressures to the two pressure boundaries. This can be done in the setBoundaryValues function in cylinder2d. Just replace the “defineU” by a “defineRho” function with appropriate arguments.
You can construct an object for the pressure by
AnalyticalConst2D<T,T> rho(converter.getLatticeDensityFromPhysPressure( >>pressure in Pa<<);
RobinJuly 20, 2018 at 4:54 pm #2896
hi thank’s for your reply.
I have a doubt doc p43:Quote:(1=fluid,
2=no-slip boundary, 3=velocity boundary, 4=constant pressure boundary,
5=curved boundary, 0=do nothing)
Seem for me that material is typed :type 1 is fluid 3 velocity and 4 pression… define for each cuboid.
so boundary with 3 is velocity … if i want a pressure i do put a 4 no????
laurent.July 21, 2018 at 3:42 pm #2897
the material numbers do not specify the type of an area, but rather the area itself. This means it is
3 = boundary layer on the left
4 = boundary layer on the right
The type of boundary is defined by “addPressureBoundary” or “addVelocityBoundary” respectively.
To get a better grip on these topics you may want to visit our next Spring School in february:
RobinJuly 23, 2018 at 9:52 pm #2899
Alright i can put any material number that I wants ? Desicribed an area_i with the number_i.July 23, 2018 at 10:10 pm #2900mathiasKeymaster
Yes, you can! Best MathiasSeptember 19, 2018 at 11:34 am #2933
I have progress in my case studies based on cylinder2d.
I’m arrive to measure pressures;
But I want to know how measure Static Pressure ? How obtain it in 2d ?
Is the pressure given by GetPressure is the same that the total pressure ?
- You must be logged in to reply to this topic.