Skip to content

Reply To: Permeability Calculation Poiseuille

#4264
Ladasicr
Participant

Dear 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,
Ladasicr