About the two phase.h

117 views
Skip to first unread message

Yonghan Xin

unread,
Jan 16, 2026, 10:02:48 AM (11 days ago) Jan 16
to basil...@googlegroups.com
Dear all,

I am writing to seek your advice on configuring the two-phase solver for a case involving two miscible fluids with distinct densities and viscosities.

In my simulation, both fluids are fully miscible, but they have different material properties. I would like to understand how to properly define these fluids within the two-phase header file. Specifically:

1. How should I assign separate density and viscosity values to each fluid in the solver’s phase definitions?
2. Are there specific parameters or input formats required to ensure the solver correctly handles property blending between the two fluids?

For reference, I am simulating a case with fuel and oxidizer streams, each with their own density and viscosity values. I wish to ensure they are treated as miscible yet distinct in terms of physical properties.

Could you please provide some guidance or point me to relevant documentation or examples on how to set this up correctly?

Thank you in advance for your support.

Best regards,
Yonghan

Jeffery Y

unread,
Jan 16, 2026, 11:01:17 AM (11 days ago) Jan 16
to basilisk-fr
Hello Yonghan,

Perhaps you can take a look at the twoLiquidMixingFoam solver (https://www.openfoam.com/documentation/guides/v2006/man/twoLiquidMixingFoam.html) in OpenFOAM. This solver is based on this paper:
Krpan, R., & Končar, B. (2018). Simulation of turbulent wake at mixing of two confined horizontal flows. Science and Technology of Nuclear Installations2018(1), 5240361.
Perhaps you can re-implement this methodology in Basilisk.

Jeffery.

Edoardo Cipriano

unread,
Jan 16, 2026, 3:36:10 PM (11 days ago) Jan 16
to basilisk-fr
Hi Yonghan,

Please have a look at this example, with a co-flow fuel/oxidizer streams, entering the domain from different sections of the nozzles (a central and an external one) and burning when they get in contact with each others. Material properties are computed as a function of the thermodynamic state of the mixture (i.e. in each cell, depending on temperature and composition we use the kinetic theory of gases to update the gas phase properties).


From your description it seems very similar to this. You have single phase flows, and you want to vary the material properties depending on the local temperature and composition. The two-phase.h module is for immiscible phases. On the other side, the navier-stokes/centered.h solver is already able to handle variable density and viscosity, without necessarily using two-phase.h. Here's a possible way to do it:

#include "navier-stokes/centered.h"


face vector alphav[], muv[];

scalar rhov[];


scalar T[], Y[];   // your temperature and composition fields


int main() {

  alpha = alphav;

  rho = rhov;

  mu = muv;


  run();

}


#define rholaw(T,Y) (some expression for rho as a function of T and Y)

#define mulaw(T,Y) (some expression for mu as a function of T and Y)


event properties (i++) {

  foreach()

    rhov[] = cm[]*rholaw (T[],Y[]);


  foreach_face() {

    double Tf = face_value (T, 0); 

    double Yf = face_value (Y, 0); 


    muv.x[] = fm.x[]*mulaw (Tf, Yf);

    alphav.x[] = fm.x[]/rholaw (Tf, Yf);

  }

}



Best,
Edoardo
Reply all
Reply to author
Forward
0 new messages