Dear community,
I am running an immiscible two‑component flow simulation using the Shan–Chen model, with the outlet boundary condition set to ‘boundary::LocalPressure’.
The simulation starts normally but crashes after a few time steps. Upon inspection, I found that the crash is triggered by the velocity of LocalPressure outlet becoming abnormally large, originating from the center of the outlet.
Digging into the implementation of LocalPressure, I noticed that the velocity is computed in:
template<int direction, int orientation>
struct olb::momenta::FixedPressureMomentum<direction, orientation> {
...
void computeU(CELL &cell, U &u) {
u[direction] = orientation * ((V{2} * rhoNormal + rhoOnWall + V{1}) / rho - V{1});
}
};
I am puzzled by the additional + V{1} term in the numerator. In Krüger’s book, the velocity is calculated as:
u_(w,y)=-c+c/ρ_w [2×ρ_Normal+ρ_OnWall].
This seems to differ from the above implementation. What makes this difference?
Additionally, any insights on why the outlet boundary might crash, and possible strategies to prevent it, would be greatly appreciated.
Best regards,
Wenyuan