Pressure Inlet
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Pressure Inlet
- This topic has 30 replies, 7 voices, and was last updated 2 months ago by sfraniatte.
-
AuthorPosts
-
September 19, 2018 at 2:10 pm #2934robin.trunkKeymaster
Hi Laurent,
yes, the getPressure gives you the total pressure. So you need to substract the dynamic pressure:
https://en.wikipedia.org/wiki/Static_pressure
This can be processed in e.g in Paraview by using the “calculator” filter.Best
RobinJuly 18, 2024 at 11:04 am #8964sfraniatteParticipantHi,
I am trying to set a pressure boundary condition at the inlet in the aorta3d example. However I do not find which function to use since this subject is too old now. Someone know how to do this ?
I am still a beginner and I don’t know how to find the response in Doxygen.
Thank you !
July 18, 2024 at 11:56 am #8965TimBingertParticipantHi sfraniatte,
you can set a pressure boundary condition on the inlet similar to how it is done on material numbers 4 and 5 on the outlets with
setInterpolatedPressureBoundary<T,DESCRIPTOR>(lattice, superGeometry, 3);Best
TimJuly 18, 2024 at 2:25 pm #8967sfraniatteParticipantHi Tim,
Thanks a lot for your fast respond. I did what I wanted with your help. Also, there is the example porousMedia/resolvedRock3d/ which helps.
Best regards
SylvainJuly 19, 2024 at 2:10 pm #8974sfraniatteParticipantHello,
I figure out that I have to switch off the bouzidi boundary condition to set a pressure boundary condition. If not, the pressure at the inlet rise without stoping. Is there a way to keep the bouzidi choice ?
Thank you !
Best regards
SylvainJuly 19, 2024 at 2:44 pm #8975mathiasKeymasterYou can apply a pressure filter as in the lid driven cavity cases using e.g. ConstRhoBGK dyamics or use the stripOffDesity methods, cf. user guide, dogygen and code examples..
July 19, 2024 at 2:58 pm #8977sfraniatteParticipantHi Mathias,
Thank you for your time but the lid driven cavity does not use Bouzidi choice for boundaries conditions since the boundaries are all straight…
Best regards
SylvainJuly 26, 2024 at 8:46 pm #9007AdrianKeymasterWhether the boundaries are straight w.r.t. to the lattice is not relevant for the choice between Bouzidi IBB and other approaches (Bouzidi just places the wall at an exact specified intersection between two cells, this also works for non-curved walls). I suspect that the boundary geometry used for Bouzidi was not set up correctly in the case where you see the broken pressure behavior. Bouzidi and pressure boundaries can definitely be used in the same simulation (e.g. this is done in both the nozzle and aorta example cases).
August 5, 2024 at 8:36 am #9032sfraniatteParticipantHi Adrian,
Thanks a lot for your message. In my case, the boundaries are straight at the inlet and the outlet but not at the walls. So, Bouzidi IBB is relevent. I used the aorta exemple and I just changed the inlet condition by removing the velocity condition and adding a pressure condition as below (it works only when bouzidiOn=False when the pressure condition is at the outlet but not with the inlet and the outlet). Maybe one line is missing but I really do not see which one.
Best regards
Sylvainvoid prepareGeometry( UnitConverter<T,DESCRIPTOR> const& converter, IndicatorF3D<T>& indicator,
STLreader<T>& stlReader, SuperGeometry<T,3>& superGeometry )
{OstreamManager clout( std::cout,”prepareGeometry” );
clout << “Prepare Geometry …” << std::endl;superGeometry.rename( 0,2,indicator );
superGeometry.rename( 2,1,stlReader );superGeometry.clean();
// Set material number for inflow
IndicatorCircle3D<T> inflow( 0.,-0.15,0., 0., 1.,0., 0.25 );
IndicatorCylinder3D<T> layerInflow( inflow, 2.*converter.getConversionFactorLength() );
// IndicatorCircle3D<T> inflow( -0.175,0.072,0., 1., 0.,0., 0.19 );
// IndicatorCylinder3D<T> layerInflow( inflow, 2.*converter.getConversionFactorLength() );
// std::vector<T> extend( 3, T(0) );
// extend[0] = 0.35;
// extend[1] = 2.5*converter.getConversionFactorLength();
// extend[2] = 0.35;
// std::vector<T> origin( 3, T(0) );
// extend[1] = -0.147;
// IndicatorCboid3D<T> layerInflow( extend,origin);
// superGeometry.rename( 2,2,1,layerInflow );
superGeometry.rename( 2,3,1,layerInflow );// Set material number for outflow0
//IndicatorCircle3D<T> outflow0(0.2053696,0.0900099,0.0346537, 2.5522,5.0294,-1.5237, 0.0054686 );
IndicatorCircle3D<T> outflow0( 0.,0.48,0., 0.,-1.,0., 0.08 );
IndicatorCylinder3D<T> layerOutflow0( outflow0, 2.*converter.getConversionFactorLength() );
superGeometry.rename( 2,4,1,layerOutflow0 );// Removes all not needed boundary voxels outside the surface
superGeometry.clean();
// Removes all not needed boundary voxels inside the surface
superGeometry.innerClean( 3 );
superGeometry.checkForErrors();superGeometry.print();
clout << “Prepare Geometry … OK” << std::endl;
}// Set up the geometry of the simulation
void prepareLattice( SuperLattice<T, DESCRIPTOR>& lattice,
UnitConverter<T,DESCRIPTOR> const& converter,
STLreader<T>& stlReader, SuperGeometry<T,3>& superGeometry )
{OstreamManager clout( std::cout,”prepareLattice” );
clout << “Prepare Lattice …” << std::endl;const T omega = converter.getLatticeRelaxationFrequency();
// material=1 –> bulk dynamics
lattice.defineDynamics<BulkDynamics>(superGeometry, 1);if ( bouzidiOn ) {
// material=2 –> no dynamics + bouzidi zero velocity
setBouzidiBoundary<T,DESCRIPTOR>(lattice, superGeometry, 2, stlReader);
// material=3 –> no dynamics + bouzidi velocity (inflow)
// setBouzidiBoundary<T,DESCRIPTOR,BouzidiVelocityPostProcessor>(lattice, superGeometry, 3, stlReader);
}
else {
// material=2 –> bounceBack dynamics
setBounceBackBoundary(lattice, superGeometry, 2);
// material=3 –> bulk dynamics + velocity (inflow)
//lattice.defineDynamics<BulkDynamics>(superGeometry, 3);
//setInterpolatedVelocityBoundary<T,DESCRIPTOR>(lattice, omega, superGeometry, 3);
}// material=3 –> bulk dynamics + pressure (inflow)
lattice.defineDynamics<BulkDynamics>(superGeometry.getMaterialIndicator(3));
setInterpolatedPressureBoundary<T,DESCRIPTOR>(lattice, omega, superGeometry.getMaterialIndicator(3));// material=4,5 –> bulk dynamics + pressure (outflow)
lattice.defineDynamics<BulkDynamics>(superGeometry.getMaterialIndicator({4, 5}));
setInterpolatedPressureBoundary<T,DESCRIPTOR>(lattice, omega, superGeometry.getMaterialIndicator({4, 5}));// Initial conditions
AnalyticalConst3D<T,T> rhoF(converter.getLatticeDensityFromPhysPressure(pression_sortie));
std::vector<T> velocity( 3,T() );
AnalyticalConst3D<T,T> uF( velocity );
AnalyticalConst3D<T,T> rho(converter.getLatticeDensityFromPhysPressure(pressure_entree));// Initialize all values of distribution functions to their local equilibrium
lattice.defineRhoU( superGeometry.getMaterialIndicator({1, 4}),rhoF,uF );
lattice.iniEquilibrium( superGeometry.getMaterialIndicator({1, 4}),rhoF,uF );
AnalyticalConst3D<T, T> rhoFromPressure(converter.getLatticeDensityFromPhysPressure(pressure_inlet));
lattice.defineRho( superGeometry.getMaterialIndicator(3),rhoFromPressure);
lattice.iniEquilibrium( superGeometry.getMaterialIndicator(3),rhoFromPressure,uF );lattice.setParameter<descriptors::OMEGA>(omega);
lattice.setParameter<collision::LES::Smagorinsky>(T(0.1));
// Lattice initialize
lattice.initialize();clout << “Prepare Lattice … OK” << std::endl;
}August 5, 2024 at 9:28 am #9033AdrianKeymasterWhich geometry are you using? Is the pressure boundary axis aligned? (Unfortunately the pressure BC used here is not suited to unaligned walls)
Can you tell us what kind of boundary setup you want to achieve? Did you verify the material geometry setup?
August 5, 2024 at 9:44 am #9034sfraniatteParticipantI use my own stl file and the aorta stl file. The result is exactly the same in the two cases. So, you can consider that I use the aorta stl file and that there is no problem with the stl file. The pressure boundary axis is aligned. I would like to set a pressure inlet and outlet condition by imposing 10 Pa at the inlet and 0 Pa at the outlet. It works only with BouzidiOn=False but My walls are not straight…
August 5, 2024 at 9:57 am #9035AdrianKeymasterWhat do you mean by exactly the same?
I asked after the geometry/STL not because I thought that the STL was broken but because of the boundary placement and pressure orientation. Just to confirm: This is *exactly* the same between both STLs?
Did you check the material geometry? Are the inlet/outlet materials placed correctly? What is entailed by setting BouzidiOn=false? This may trigger branches in the case that are not compatible with your changed geometry.
Sorry for only asking questions back but without more details it could be basically anything. Bouzidi is definitely compatible with the pressure / velocity BCs used in this case so this on its own is not the problem. The next likely suspect is the geometry setup.
August 5, 2024 at 10:15 am #9036sfraniatteParticipantI mean it is exactly the same behavior and the orientation of the inlets and the outlets are along the same axis. Sorry for the unuseful details.
However, it seems that I solved my problem. It was a line which did not have to be there.
Thanks a lot for your help !
Best regard
SylvainAugust 5, 2024 at 10:27 am #9037AdrianKeymasterHappy to hear! Could you share which command it was that broke the setup? It may be something we can improve in the case / general OpenLB interface.
August 5, 2024 at 10:46 am #9038sfraniatteParticipantI spoke to fast, it still does not work. So, to be clear, I use the aorta example and I want replace the velocity inlet condition by a pressure inlet condition. So I use the aorta stl file and I did touch the indicators for the inlet and the outlets. The inlet/outlet materials are placed correctly. When I use Bouzidi condition, this line is used : “setBouzidiBoundary<T,DESCRIPTOR>(lattice, superGeometry, 2, stlReader);”. When I use Bounce Back Boundary, this line is used : “setBounceBackBoundary(lattice, superGeometry, 2);”. It works only in the second case. So, I think that I have to add something in the first case but I do not know what.
Sorry for the previous message…
Best regard
Sylvain -
AuthorPosts
- You must be logged in to reply to this topic.