Multicomponent Boundary Condition

Hello, buddy. I’m trying to simulate two phase displacement in a tube. I want to set pressure boundary for both inlet and outlet. But I encounter a problem when I set the pressure boundary like below.

Box2D inlet (0, 0, 1, ny-2);
boundaryCondition->setPressureConditionOnBlockBoundaries(FluidOne, inlet);
setBoundaryDensity(FluidOne, inlet, 1.);
boundaryCondition->setPressureConditionOnBlockBoundaries(FluidTwo, inlet);
setBoundaryDensity(FluidTwo, inlet, 0.);

Box2D outlet(nx, nx, 1, ny-2);
boundaryCondition->setPressureConditionOnBlockBoundaries(FluidOne, outlet);
setBoundaryDensity(FluidOne, outlet, 0.);
boundaryCondition->setPressureConditionOnBlockBoundaries(FluidTwo, outlet);
setBoundaryDensity(FluidTwo, outlet, 0.5);

Please tell me whether it is right to set the pressure boundary like above. Thank you. Sincerely.
I look forward to seeing your answer.

Hey Isaac,

Currently I’m looking for the same kind of Boundary Condition implementation.
Did you find a way to do it?
If not and you are still interested let me know, I’ll keep you updated about my work.