Pressure in openLB
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Pressure in openLB
- This topic has 8 replies, 3 voices, and was last updated 1 year, 3 months ago by Yuji.
-
AuthorPosts
-
July 18, 2023 at 10:55 am #7633YujiParticipant
Dear Team openLB,
I noticed that some examples cpp set dirichlet pressure condition(p=0), for example /examples/turbulence/nozzle3d.cpp
Is this pressure boundary condition a gauge pressure? This is because nozzle3d.cpp has commentout; Dirichlet pressure condition is set by p=0 (i.e. rho=1).Moreover, I have 2 questions.
1) I would like to set the specific pressure value. I am not sure how to define. And the instraction of “lattice.setProcessingContext<Array<momenta::FixedVelocityMomentumGeneric::VELOCITY>>(ProcessingContext::Simulation);” at the setBoundaryValues function has to be modified?
2) I would like to set the neumann pressure condition. Are there any functions to set it?July 21, 2023 at 11:32 am #7642stephanModeratorDear Yuji,
thank you for your post.
Please note that, by construction, the physical pressure is assumed to be absolute.Wrt your questions:
(1) To set a specific pressure value at the boundary, input the desired physical value (e.g. named pF) to the functor which sets the boundary values. So, irrespective of your actual boundary condition (e.g. setLocalPressureBoundary, setInterpolatedPressureBoundary), you can use the following:
AnalyticalConst3D<T,T> rho(converter.getLatticeDensityFromPhysPressure(pF)); // to convert physical pressure to lattice density
sLattice.defineRho(superGeometry, 4, rhoF); // to set the actual value, assuming that your outflow boundary has e.g. material number 4.2) Unfortunately, we do not have this kind of boundary included in OpenLB out of the box.
Best,
StephanJuly 24, 2023 at 8:23 am #7645YujiParticipantDear Stephan,
Thank your reply.
As to the physical pressure, I understood it but is “the physical pressure” dynamic pressure?Additionaly, I would like to know the equation in setSlipBoundary. Could you teach me?
Best
July 24, 2023 at 12:45 pm #7646YujiParticipantWhen I use setSlipBoundary, I got an error;
terminate called after throwing an instance of ‘std::runtime_error’
what(): Legacy post processors not supported on GPU_CUDA
AbortedHow should I do to resolve it?
I set this setSlipBoundary into marerial number 6 and 7 in “void prepareLattice” function. This instraction written by me is bellow. When I do the comment out at setSlipBoundary, the error does not appear.
void prepareLattice( SuperLattice<T,DESCRIPTOR>& sLattice,
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();
clout << “omega” << omega << ” ” << std::endl;// Material=1 –>bulk dynamics
auto bulkIndicator = superGeometry.getMaterialIndicator({1});
sLattice.defineDynamics<BGKdynamics>(bulkIndicator);// Material=2 –>bounce back
setBounceBackBoundary(sLattice, superGeometry, 2);// Setting of the boundary conditions
//if local boundary conditions are chosen
//setLocalVelocityBoundary(sLattice, omega, superGeometry, 3);
//setLocalPressureBoundary(sLattice, omega, superGeometry, 4);//if interpolated boundary conditions are chosen
setInterpolatedVelocityBoundary(sLattice, omega, superGeometry, 3);
setInterpolatedPressureBoundary(sLattice, omega, superGeometry, 4);// Material=5 –>bouzidi / bounce back
#ifdef BOUZIDI
setBouzidiBoundary<T,DESCRIPTOR>(sLattice, superGeometry, 5, stlReader);
#else
setBounceBackBoundary(sLattice, superGeometry, 5);
#endif
// Material = 6, 7
setSlipBoundary<T,DESCRIPTOR>(sLattice, superGeometry, 6);
setSlipBoundary<T,DESCRIPTOR>(sLattice, superGeometry, 7);// Initial conditions
AnalyticalConst3D<T,T> rhoF( 1 );
Vector<T,3> velocityV;
velocityV[0] = converter.getCharLatticeVelocity();
clout<< “velocityV=” << velocityV[0] << ” ” << velocityV[1] << ” ” << velocityV[2] << ” ” <<std::endl;
AnalyticalConst3D<T,T> uF(velocityV);// Initialize all values of distribution functions to their local equilibrium
sLattice.defineRhoU( bulkIndicator, rhoF, uF );
// sLattice.defineRhoU( superGeometry, 6, rhoF, uF );
sLattice.iniEquilibrium( bulkIndicator, rhoF, uF );sLattice.setParameter<descriptors::OMEGA>(omega);
// Make the lattice ready for simulation
sLattice.initialize();clout << “Prepare Lattice … OK” << std::endl;
}Best
July 24, 2023 at 12:57 pm #7647YujiParticipantThe gpu_only_mixed.mk of config.mk is used in these cases.
July 26, 2023 at 3:43 am #7676YujiParticipantSorry again.
I want to use “setSlipBoundary” on GPU but got an error which is
“terminate called after throwing an instance of ‘std::runtime_error’
what(): Legacy post processors not supported on GPU_CUDA
Aborted”Could you teach me how to use “setSlipBoundary” on GPU?
July 26, 2023 at 2:53 pm #7677mathiasKeymasterDear Yuji,
that still needs to be done and it is on our roadmap. How long it takes depends on future projects which we are hoping to get..
Best
MathiasJuly 26, 2023 at 7:44 pm #7678stephanModeratorDear Yuji,
regarding your second question, concerning the pressure, I can recommend you to read Section “7.2.1.2 Pressure, Stress and Force” in the book of Krüger et al. (https://doi.org/10.1007/978-3-319-44649-3).
BR
StephanJuly 27, 2023 at 6:32 am #7682YujiParticipantDear all,
Thank you. Understood. I wiil read it.
-
AuthorPosts
- You must be logged in to reply to this topic.