Skip to content

Reply To: Pressure Inlet

#9032
sfraniatte
Participant

Hi 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
Sylvain

void 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;
}