Skip to content

Definition of liquid fraction in example galliumMelting2d

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Definition of liquid fraction in example galliumMelting2d

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9386
    qiong
    Participant

    Dear OpenLB community,

    I am trying to understand the example (galliumMelting2d). It seems that the liquid fraction is determined by total enthalpy according to the published research (Phase interface effects in the total enthalpy-based lattice Boltzmann model for solid–liquid phase change Rongzong). However, in getResults function of the example, the liquid fraction is defined by the porosity field. Can anybody tell why it is defined like this instead of using enthalpy?

    void getResults( ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> const& converter,
    SuperLattice<T, NSDESCRIPTOR>& NSlattice,
    SuperLattice<T, TDESCRIPTOR>& ADlattice, int iT,
    SuperGeometry<T,2>& superGeometry,
    util::Timer<T>& timer,
    bool converged)
    {

    OstreamManager clout(std::cout,”getResults”);

    SuperVTMwriter2D<T> vtkWriter(“galliumMelting2d”);
    SuperLatticeGeometry2D<T, NSDESCRIPTOR> geometry(NSlattice, superGeometry);
    SuperLatticeField2D<T, TDESCRIPTOR, VELOCITY> velocity(ADlattice);
    SuperLatticePhysPressure2D<T, NSDESCRIPTOR> pressure(NSlattice, converter);

    SuperLatticeDensity2D<T, TDESCRIPTOR> enthalpy(ADlattice);
    enthalpy.getName() = “enthalpy”;
    SuperLatticeField2D<T, NSDESCRIPTOR, POROSITY> liquid_frac(NSlattice);
    liquid_frac.getName() = “liquid fraction”;
    SuperLatticeField2D<T, TDESCRIPTOR, TEMPERATURE> temperature(ADlattice);
    temperature.getName() = “temperature”;
    SuperLatticeField2D<T, NSDESCRIPTOR, FORCE> force(NSlattice);
    force.getName() = “force”;
    vtkWriter.addFunctor( geometry );
    vtkWriter.addFunctor( pressure );
    vtkWriter.addFunctor( velocity );
    vtkWriter.addFunctor( enthalpy );
    vtkWriter.addFunctor( liquid_frac );
    vtkWriter.addFunctor( temperature );
    vtkWriter.addFunctor( force );

    Thanks for your help.

    Best regards,
    Qiong

    #9448
    luizeducze
    Participant

    Dear Qiong,

    The liquid fraction is indeed computed from the Enthalpy as you said.

    If you go to the file advectionDiffusionDynamics.h, you will find the function the computed the liquid fraction:

    template<typename V, typename PARAMETERS, typename ENTHALPY>
    V computeLiquidFraction(const PARAMETERS& parameters, const ENTHALPY& enthalpy) const
    {
    using namespace TotalEnthalpy;

    const V cp_s = parameters.template get<CP_S>();
    const V cp_l = parameters.template get<CP_L>();
    const V T_s = parameters.template get<T_S>();
    const V T_l = parameters.template get<T_L>();
    const V l = parameters.template get<L>();
    const V H_s = cp_s * T_s;
    const V H_l = cp_l * T_l + l;
    V liquid_fraction{};

    if (enthalpy <= H_s) {
    liquid_fraction = 0.;
    }
    else if (enthalpy >= H_l) {
    liquid_fraction = 1.;
    }
    else {
    liquid_fraction = (enthalpy – H_s) / l;
    }
    return liquid_fraction;
    }

    Then, if you go to the file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh,
    you will see that the value of the liquid fraction is stored inside the field POROSITY:

    cell.template setField<descriptors::POROSITY>(
    dynamics->template computeLiquidFraction<T>(parameters, enthalpy));

    The POROSITY here is just a variable used to store the information of the liquid fraction, but this one is still computed from the enthalpy.

    #9557
    Inko0521@126.com
    Participant

    I’m trying to explore the solidification properties of phase change materials, how can I define all the initial phase change materials as liquid (Initial liquid fraction = 1)? Can anyone help me solve this problem?

    #9583
    luizeducze
    Participant

    Dear Inko0521@126.com,

    Can you describe more your problem?

    Your phase change material is initially a liquid and you want to convert it to a solid?

    There are other components/phases in your domain? Or is just one material which turns into solid over time?

    Kind regards,
    Luiz

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.