solidificationMelting Class Reference

This source is designed to model the effect of solidification and melting processes, e.g. windshield defrosting. More...

Inheritance diagram for solidificationMelting:
Collaboration diagram for solidificationMelting:

Public Types

enum class  thermoMode { thermo , lookup }
 

Public Member Functions

 TypeName ("solidificationMelting")
 Runtime type information. More...
 
 solidificationMelting (const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
 Construct from explicit source name and mesh. More...
 
 solidificationMelting (const solidificationMelting &)=delete
 Disallow default bitwise copy construction. More...
 
virtual wordList addSupFields () const
 Return the list of fields for which the fvModel adds source term. More...
 
virtual void addSup (const volScalarField &he, fvMatrix< scalar > &eqn) const
 Add explicit contribution to enthalpy equation. More...
 
virtual void addSup (const volVectorField &U, fvMatrix< vector > &eqn) const
 Add implicit contribution to momentum equation. More...
 
virtual void addSup (const volScalarField &rho, const volScalarField &he, fvMatrix< scalar > &eqn) const
 Add explicit contribution to compressible enthalpy equation. More...
 
virtual void addSup (const volScalarField &rho, const volVectorField &U, fvMatrix< vector > &eqn) const
 Add implicit contribution to compressible momentum equation. More...
 
virtual bool movePoints ()
 Update for mesh motion. More...
 
virtual void topoChange (const polyTopoChangeMap &)
 Update topology using the given map. More...
 
virtual void mapMesh (const polyMeshMap &)
 Update from another mesh using the given map. More...
 
virtual void distribute (const polyDistributionMap &)
 Redistribute or update using the given distribution map. More...
 
virtual bool read (const dictionary &dict)
 Read source dictionary. More...
 
void operator= (const solidificationMelting &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from fvModel
 TypeName ("fvModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, fvModel, dictionary,(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict),(name, modelType, mesh, dict))
 
 fvModel (const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
 Construct from components. More...
 
autoPtr< fvModelclone () const
 Return clone. More...
 
virtual ~fvModel ()
 Destructor. More...
 
const wordname () const
 Return const access to the source name. More...
 
const fvMeshmesh () const
 Return const access to the mesh database. More...
 
const dictionarycoeffs () const
 Return dictionary. More...
 
virtual bool addsSupToField (const word &fieldName) const
 Return true if the fvModel adds a source term to the given. More...
 
virtual scalar maxDeltaT () const
 Return the maximum time-step for stable operation. More...
 
virtual void addSup (fvMatrix< scalar > &eqn) const
 Add a source term to a field-less proxy equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > sourceProxy (const VolField< Type > &eqnField) const
 Add a source term to an equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const VolField< Type > &field) const
 Return source for an equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > sourceProxy (const VolField< Type > &field, const VolField< Type > &eqnField) const
 Return source for an equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &rho, const VolField< Type > &field) const
 Return source for a compressible equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > sourceProxy (const volScalarField &rho, const VolField< Type > &field, const VolField< Type > &eqnField) const
 Return source for a compressible equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &alpha, const volScalarField &rho, const VolField< Type > &field) const
 Return source for a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > sourceProxy (const volScalarField &alpha, const volScalarField &rho, const VolField< Type > &field, const VolField< Type > &eqnField) const
 Return source for a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &alpha, const geometricOneField &rho, const VolField< Type > &field) const
 Return source for a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const geometricOneField &alpha, const volScalarField &rho, const VolField< Type > &field) const
 Return source for a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const geometricOneField &alpha, const geometricOneField &rho, const VolField< Type > &field) const
 Return source for a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > d2dt2 (const VolField< Type > &field) const
 Return source for an equation with a second time derivative. More...
 
virtual void preUpdateMesh ()
 Prepare for mesh update. More...
 
virtual void correct ()
 Correct the fvModel. More...
 
virtual bool write (const bool write=true) const
 Write fvModel data. More...
 
template<class AlphaRhoFieldType , class ... AlphaRhoFieldTypes>
Foam::dimensionSet sourceDims (const dimensionSet &ds, const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
 
template<class AlphaRhoFieldType , class ... AlphaRhoFieldTypes>
const Foam::wordfieldName (const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
 
template<class AlphaRhoFieldType >
const Foam::wordfieldName (const AlphaRhoFieldType &alphaRhoField)
 
template<class Type , class ... AlphaRhoFieldTypes>
Foam::tmp< Foam::fvMatrix< Type > > sourceTerm (const VolField< Type > &eqnField, const dimensionSet &ds, const AlphaRhoFieldTypes &... alphaRhoFields) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > sourceProxy (const VolField< Type > &eqnField) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const VolField< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > sourceProxy (const VolField< Type > &field, const VolField< Type > &eqnField) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const volScalarField &rho, const VolField< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > sourceProxy (const volScalarField &rho, const VolField< Type > &field, const VolField< Type > &eqnField) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const volScalarField &alpha, const volScalarField &rho, const VolField< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > sourceProxy (const volScalarField &alpha, const volScalarField &rho, const VolField< Type > &field, const VolField< Type > &eqnField) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const geometricOneField &alpha, const geometricOneField &rho, const VolField< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const volScalarField &alpha, const geometricOneField &rho, const VolField< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const geometricOneField &alpha, const volScalarField &rho, const VolField< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > d2dt2 (const VolField< Type > &field) const
 

Static Public Attributes

static const NamedEnum< thermoMode, 2 > thermoModeTypeNames_
 

Additional Inherited Members

- Static Public Member Functions inherited from fvModel
template<class AlphaRhoFieldType , class ... AlphaRhoFieldTypes>
static dimensionSet sourceDims (const dimensionSet &ds, const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
 Return the dimensions of the matrix of a source term. More...
 
static const dimensionSetsourceDims (const dimensionSet &ds)
 Return the dimensions of the matrix of a source term (base. More...
 
template<class AlphaRhoFieldType , class ... AlphaRhoFieldTypes>
static const wordfieldName (const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
 Return the name of the field associated with a source term. More...
 
template<class AlphaRhoFieldType >
static const wordfieldName (const AlphaRhoFieldType &alphaRhoField)
 Return the name of the field associated with a source term (base. More...
 
static const wordfieldName ()
 Return the name of the field associated with a source term. Special. More...
 
static autoPtr< fvModelNew (const word &name, const fvMesh &mesh, const dictionary &dict)
 Return a reference to the selected fvModel. More...
 
- Protected Member Functions inherited from fvModel
template<class Type >
void addSupType (const VolField< Type > &field, fvMatrix< Type > &eqn) const
 Add a source term to an equation. More...
 
template<class Type >
void addSupType (const volScalarField &rho, const VolField< Type > &field, fvMatrix< Type > &eqn) const
 Add a source term to a compressible equation. More...
 
template<class Type >
void addSupType (const volScalarField &alpha, const volScalarField &rho, const VolField< Type > &field, fvMatrix< Type > &eqn) const
 Add a source term to a phase equation. More...
 
template<class Type , class ... AlphaRhoFieldTypes>
tmp< fvMatrix< Type > > sourceTerm (const VolField< Type > &eqnField, const dimensionSet &ds, const AlphaRhoFieldTypes &... alphaRhoFields) const
 Return a source for an equation. More...
 

Detailed Description

This source is designed to model the effect of solidification and melting processes, e.g. windshield defrosting.

The isotherm phase change occurs at the melting temperature, Tsol (= Tliq). The not isotherm phase change occurs between solidus and liquidus temperature, Tsol < Tliq respectively, as long as the melt fraction is greater than the max eutectic melt fraction, alpha1e (0 = pure_substance, 1 = eutectic_mixture is not permitted), where a linear eutectic melt fraction to temperature relation is considered; e.g. given a specific quantity of a binary system, alpha1 is its melt fraction and alpha0 is its solid fraction, such that alpha0 = 1 - alpha1 therefore, assuming infinite solute diffusion, the quantity of a component in solid phase is (1 - alpha1) * CS where CS is the solid concentration of the considered component and the quantity of a component in liquid phase is alpha1 * CL where CL is the melt concentration of the considered component; considering that the total quantity of a component must be equal to the sum of the quantities of the considered component in the liquid and solid phases, if C0 is the initial concentration of the considered component before the phase change, then: C0 = (1 - alpha1) * CS + alpha1 * CL (lever rule) from which: alpha1 = (C0 - CS) / (CL - CS) and thus:

  • for a miscible binary system alpha1e = 0;
  • for a binary system not miscible at solid state alpha1e = C0 / CLE where CLE is eutectic melt concentration;
  • for a binary system partially-miscible at solid state alpha1e = (C0 - CSE) / (CLE - CSE) where CSE is eutectic solid concentration of the relative solid solution.

The presence of the solid phase in the flow field is incorporated into the model as a momentum porosity contribution; the energy associated with the phase change is added as an enthalpy contribution.

References:

    Voller, V. R., & Prakash, C. (1987).
    A fixed grid numerical modelling methodology for convection-diffusion
    mushy region phase-change problems.
    International Journal of Heat and Mass Transfer, 30(8), 1709-1719.

    Swaminathan, C. R., & Voller, V. R. (1992).
    A general enthalpy method for modeling solidification processes.
    Metallurgical transactions B, 23(5), 651-664.

The model generates the field <name>:alpha1 which can be visualised to to show the melt distribution as a fraction [0-1].

Usage
Example usage:
solidificationMelting1
{
    type            solidificationMelting;

    select          cellZone;
    cellZone        iceZone;

    Tsol            273;
    L               334000;
    thermoMode      thermo;
    beta            50e-6;
    rhoRef          800;
}

Where:

Property Description Required Default value
Tsol Solidus temperature [K] yes
Tliq Liquidus temperature [K] no Tsol
alpha1e Max eutectic melt fraction [0-1[ no 0
L Latent heat of fusion [J/kg] yes
relax Relaxation coefficient [0-1] no 0.9
thermoMode Thermo mode [thermo or lookup] yes
rhoRef Reference (solid) density [kg/m^3] yes
rho Name of density field no rho
T Name of temperature field no T
Cp Name of specific heat field no Cp
U Name of velocity field no U
phi Name of flux field no phi
Cu Model coefficient [1/s] no 100000
q Model coefficient no 0.001
beta Thermal expansion coefficient [1/K] yes
g Acceleration due to gravity no
Source files

Definition at line 224 of file solidificationMelting.H.

Member Enumeration Documentation

◆ thermoMode

enum thermoMode
strong
Enumerator
thermo 
lookup 

Definition at line 230 of file solidificationMelting.H.

Constructor & Destructor Documentation

◆ solidificationMelting() [1/2]

solidificationMelting ( const word name,
const word modelType,
const fvMesh mesh,
const dictionary dict 
)

Construct from explicit source name and mesh.

Definition at line 250 of file solidificationMelting.C.

◆ solidificationMelting() [2/2]

Disallow default bitwise copy construction.

Member Function Documentation

◆ TypeName()

TypeName ( "solidificationMelting"  )

Runtime type information.

◆ addSupFields()

Foam::wordList addSupFields ( ) const
virtual

Return the list of fields for which the fvModel adds source term.

to the transport equation

Reimplemented from fvModel.

Definition at line 297 of file solidificationMelting.C.

References Foam::name(), List< word >::null(), and thermo.

Here is the call graph for this function:

◆ addSup() [1/4]

void addSup ( const volScalarField he,
fvMatrix< scalar > &  eqn 
) const
virtual

Add explicit contribution to enthalpy equation.

Definition at line 318 of file solidificationMelting.C.

◆ addSup() [2/4]

void addSup ( const volVectorField U,
fvMatrix< vector > &  eqn 
) const
virtual

Add implicit contribution to momentum equation.

Definition at line 339 of file solidificationMelting.C.

References cells, Cp(), lduMatrix::diag(), Foam::endl(), forAll, Foam::Info, Foam::pow3(), fvMatrix< Type >::psi(), Foam::fvm::S(), fvMatrix< Type >::source(), Foam::fvc::Sp(), Foam::sqr(), Foam::fvc::Su(), and Foam::type().

Here is the call graph for this function:

◆ addSup() [3/4]

void addSup ( const volScalarField rho,
const volScalarField he,
fvMatrix< scalar > &  eqn 
) const
virtual

Add explicit contribution to compressible enthalpy equation.

Definition at line 328 of file solidificationMelting.C.

References rho.

◆ addSup() [4/4]

void addSup ( const volScalarField rho,
const volVectorField U,
fvMatrix< vector > &  eqn 
) const
virtual

Add implicit contribution to compressible momentum equation.

Definition at line 378 of file solidificationMelting.C.

References U.

◆ movePoints()

bool movePoints ( )
virtual

Update for mesh motion.

Implements fvModel.

Definition at line 389 of file solidificationMelting.C.

◆ topoChange()

void topoChange ( const polyTopoChangeMap map)
virtual

Update topology using the given map.

Implements fvModel.

Definition at line 396 of file solidificationMelting.C.

◆ mapMesh()

void mapMesh ( const polyMeshMap map)
virtual

Update from another mesh using the given map.

Implements fvModel.

Definition at line 405 of file solidificationMelting.C.

◆ distribute()

void distribute ( const polyDistributionMap map)
virtual

Redistribute or update using the given distribution map.

Implements fvModel.

Definition at line 411 of file solidificationMelting.C.

◆ read()

bool read ( const dictionary dict)
virtual

Read source dictionary.

Reimplemented from fvModel.

Definition at line 420 of file solidificationMelting.C.

References dict, and fvModel::read().

Here is the call graph for this function:

◆ operator=()

void operator= ( const solidificationMelting )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ thermoModeTypeNames_

const Foam::NamedEnum< Foam::fv::solidificationMelting::thermoMode, 2 > thermoModeTypeNames_
static

Definition at line 236 of file solidificationMelting.H.


The documentation for this class was generated from the following files: