Permeability Calculation Poiseuille
OpenLB – Open Source Lattice Boltzmann Code › Forums › on Lattice Boltzmann Methods › General Topics › Permeability Calculation Poiseuille
- This topic has 9 replies, 3 voices, and was last updated 5 years ago by fk.
-
AuthorPosts
-
April 17, 2019 at 2:16 pm #4243LadasicrParticipant
Hello,
i`m quite new to openLB and try to implement the calculatiion of the permeability for porous media. Therefore i first want to look at the simple case of the Poiseuille2d Code, since the analytical solution for verification is known.The Problem is the following:
I used the original poiseuille2d Code and only replaced the boundary condition on the front by a pressure boundary condition, so that i can directly use the pressure Gradient as (pin-pout)/lx.
The mean velocity is also calculated. But if i do just these changes the result doesn`t coincide with the analytical solution…The changes in the Code are the following:
– Parameters for the Simulation:
const T pin=1000;
const T pout=500;
const T density=1e3;
const T viscosity=1e-6;– void prepareLattice()
sBoundaryCondition.addPressureBoundary(superGeometry, 3, Omega);
Setting of the inlet pressure etc.Unfortunately i am not even sure if the forced-FlowType is correct in this case since it may spoil the boundary condition. Any suggestions how to write down a simple Poiseuille2d Code with pressure boundary conditions just to verify Darcys law. I am quite lost since a couple of days now…
Thanks in regards,
LadasicrApril 17, 2019 at 3:01 pm #4245fkParticipantDear Ladasicr,
the problem may be due to bugs in the GuoZhaoBGKDynamics. These problems are now fixed and will be released soon. Until then you could try the PorousBGKDynamics based on the porous media model of Spaid and Phelan.
Best regards,
FabianApril 17, 2019 at 3:21 pm #4246LadasicrParticipantDear Fabian,
thanks for the Reply. Unfortunately i am not that deep into the Topic so far… My Problem may rather sound trivial but it is the following:
I use pressure BC for the inlet in the poiseuille2d example and after the main Loop i just evaluate the mean velocity in order to calculate the Dary law, e.g. the permeability.
The Problem occurs now if i set FlowType=unForced, DESCRIPTOR = D2Q9Descriptor and apply the inlet pressure BC ashard Parameters
, ie. 100 Pa at the inlet and 10 Pa at the outlet.
Then the Simulation just breaks because with the given Parameters i get for all Parameters like uMax=inf, avEngergy=-nan, avRho=nan etc.Any idea how to fix that simple example?
Best regards,
LadasicrApril 24, 2019 at 9:02 am #4263fkParticipantDear Ladasicr,
could you post the code of how you set the boundary conditions here? My guess is, that you do not have a smooth start up and this is why the simulation blows up.
Best,
FabianApril 24, 2019 at 11:21 am #4264LadasicrParticipantDear Fabian,
here is the relevant Code which i included in the Pousoille2d example:
// In function prepareLattice
sBoundaryCondition.addPressureBoundary(superGeometry, 3, omega);
sBoundaryCondition.addPressureBoundary( superGeometry, 4, omega );std::vector<T> velocity( 2,T( 0 ) );
AnalyticalConst2D<T,T> u( velocity );
AnalyticalConst2D<T,T> rho( 1 );// Define inlet and outlet pressure
AnalyticalConst2D<T,T> rhoIn(converter.getLatticeDensityFromPhysPressure(pin)); // pin in Pa
AnalyticalConst2D<T,T> rhoOut(converter.getLatticeDensityFromPhysPressure(pout));// Initialize all values of distribution functions to their local equilibrium
sLattice.defineRho( superGeometry, 1, rho);
sLattice.iniEquilibrium( superGeometry, 1, rho, u );
sLattice.defineRho( superGeometry, 2, rho);
sLattice.iniEquilibrium( superGeometry, 2, rho, u );
sLattice.defineRho( superGeometry, 3, rhoIn);
sLattice.iniEquilibrium( superGeometry, 3, rho, u );
sLattice.defineRho( superGeometry, 4, rhoOut);
sLattice.iniEquilibrium( superGeometry, 4, rho, u );// In setBoundaryValues
if ( iT%iTupdate==0 && iT<= iTmaxStart ) {
// Smooth start curve, sinus
// SinusStartScale<T,int> StartScale(iTmaxStart, T(1));// Smooth start curve, polynomial
PolynomialStartScale<T,T> StartScale( iTmaxStart, T( 1 ) );// Creates and sets the Poiseuille inflow profile using functors
T iTvec[1] = {T( iT )};
T frac[1] = {};
StartScale( frac,iTvec );
AnalyticalConst2D<T,T> rho(frac[0]*converter.getLatticeDensityFromPhysPressure(pin));sLattice.defineRho( superGeometry, 3, rho );
}I think i did some mistake with the smoothened inlet pressure BC.
Best regards,
LadasicrApril 24, 2019 at 2:49 pm #4265fkParticipantThe code looks mostly fine, but try to smooth
pin
:AnalyticalConst2D<T,T> rho(converter.getLatticeDensityFromPhysPressure(frac[0]*pin));
April 24, 2019 at 3:12 pm #4266LadasicrParticipantUnfortunately the System is still diverging giving something like
[LatticeStatistics] step=625; t=0.25; uMax=inf; avEnergy=-nan; avRho=nan
But the Parameters of the System are still the same as in the original example, except the introduction of the inlet and outlet pressure…
April 24, 2019 at 4:12 pm #4267fkParticipantWhich Dynamics do you use? If you use the GuoZhaoDynamics, that could be the problem.
Or maybe yourpin
is too high, try something like 0.01.August 18, 2019 at 4:37 pm #4506zshi6193ParticipantDear all,
In this case which dynamic we should use? Is it ok if I use BGKdynamics?
ThanksAugust 21, 2019 at 10:51 am #4513fkParticipantIn release 1.3 the bug in GuoZhaoBGKdynamics has been fixed, therefore you can use either PorousBGKdynamics or GuoZhaoBGKdynamics.
See for example “olb-1.3r0/examples/porousMedia/porousPoiseuille3d”, where you can switch between both dynamics.Best,
Fabian -
AuthorPosts
- You must be logged in to reply to this topic.