Skip to content

Reply To: Point-by-point field – pressure( density ) free energy boundary condition in 3D

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Point-by-point field – pressure( density ) free energy boundary condition in 3D Reply To: Point-by-point field – pressure( density ) free energy boundary condition in 3D

#9531
savis
Participant

Hi Alice,

It looks like you may have made a mistake when defining rho on the inlet and outlet. You are using a material of ‘3’ for both, so the value that you set for the inlet gets overridden.

Regarding the couplings, you can combine coupling1 into coupling4 by applying it to both materials 3 and 4:
coupling4.restrictTo(superGeometry.getMaterialIndicator({3,4}));
This coupling should come after coupling3 because it needs the updated velocity.

Secondly, you should replace coupling1 with a DensityOutletCoupling. This ensures the density on the outlet remains fixed.

SuperLatticeCoupling coupling1(
    DensityOutletCoupling2D{},
    names::A{}, sLattice1,                                                                                                                                                           
    names::B{}, sLattice2
    );
coupling1.template setParameter<DensityOutletCoupling2D::RHO>(rhoOutVal);
coupling1.restrictTo(superGeometry.getMaterialIndicator({4}));