solidificationMeltingSource Class Reference

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

Inheritance diagram for solidificationMeltingSource:
Collaboration diagram for solidificationMeltingSource:

Public Types

enum  thermoMode { thermo, lookup }
 

Public Member Functions

 TypeName ("solidificationMeltingSource")
 Runtime type information. More...
 
 solidificationMeltingSource (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
 Construct from explicit source name and mesh. More...
 
 solidificationMeltingSource (const solidificationMeltingSource &)=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 (fvMatrix< scalar > &eqn, const word &fieldName) const
 Add explicit contribution to enthalpy equation. More...
 
virtual void addSup (fvMatrix< vector > &eqn, const word &fieldName) const
 Add implicit contribution to momentum equation. More...
 
virtual void addSup (const volScalarField &rho, fvMatrix< scalar > &eqn, const word &fieldName) const
 Add explicit contribution to compressible enthalpy equation. More...
 
virtual void addSup (const volScalarField &rho, fvMatrix< vector > &eqn, const word &fieldName) 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 solidificationMeltingSource &)=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 dictionary &dict, const fvMesh &mesh),(name, modelType, dict, mesh))
 
 fvModel (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
 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...
 
 FOR_ALL_FIELD_TYPES (DEFINE_FV_MODEL_ADD_SUP)
 Add a source term to an equation. More...
 
 FOR_ALL_FIELD_TYPES (DEFINE_FV_MODEL_ADD_RHO_SUP)
 Add a source term to a compressible equation. More...
 
 FOR_ALL_FIELD_TYPES (DEFINE_FV_MODEL_ADD_ALPHA_RHO_SUP)
 Add a source term to a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const GeometricField< Type, fvPatchField, volMesh > &field) const
 Return source for an equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName) const
 Return source for an equation with a specified name. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field) const
 Return source for a compressible equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName) const
 Return source for a compressible equation with a specified name. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &alpha, const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field) const
 Return source for a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &alpha, const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName) const
 Return source for a phase equation with a specified name. More...
 
virtual void preUpdateMesh ()
 Prepare for mesh update. More...
 
virtual void correct ()
 Correct the fvModel. More...
 
template<class Type , class AlphaRhoFieldType , class ... AlphaRhoFieldTypes>
Foam::dimensionSet sourceDims (const GeometricField< Type, fvPatchField, volMesh > &field, const dimensionSet &ds, const AlphaRhoFieldType &alphaRho, const AlphaRhoFieldTypes &... alphaRhos)
 
template<class Type >
Foam::dimensionSet sourceDims (const GeometricField< Type, fvPatchField, volMesh > &field, const dimensionSet &ds)
 
template<class Type , class ... AlphaRhoFieldTypes>
Foam::tmp< Foam::fvMatrix< Type > > source (const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName, const dimensionSet &ds, const AlphaRhoFieldTypes &... alphaRhos) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const GeometricField< Type, fvPatchField, volMesh > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const volScalarField &alpha, const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const volScalarField &alpha, const volScalarField &rho, const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName) const
 

Static Public Attributes

static const NamedEnum< thermoMode, 2 > thermoModeTypeNames_
 

Additional Inherited Members

- Static Public Member Functions inherited from fvModel
template<class Type , class AlphaRhoFieldType , class ... AlphaRhoFieldTypes>
static dimensionSet sourceDims (const GeometricField< Type, fvPatchField, volMesh > &field, const dimensionSet &ds, const AlphaRhoFieldType &alphaRho, const AlphaRhoFieldTypes &... alphaRhos)
 Return the dimensions of the matrix of a source term. More...
 
template<class Type >
static dimensionSet sourceDims (const GeometricField< Type, fvPatchField, volMesh > &field, const dimensionSet &ds)
 Return the dimensions of the matrix of a source term (base. More...
 
static autoPtr< fvModelNew (const word &name, const dictionary &dict, const fvMesh &mesh)
 Return a reference to the selected fvModel. More...
 
- Protected Member Functions inherited from fvModel
template<class Type >
void addSupType (fvMatrix< Type > &eqn, const word &fieldName) const
 Add a source term to an equation. More...
 
template<class Type >
void addSupType (const volScalarField &rho, fvMatrix< Type > &eqn, const word &fieldName) const
 Add a source term to a compressible equation. More...
 
template<class Type >
void addSupType (const volScalarField &alpha, const volScalarField &rho, fvMatrix< Type > &eqn, const word &fieldName) const
 Add a source term to a phase equation. More...
 
template<class Type , class ... AlphaRhoFieldTypes>
tmp< fvMatrix< Type > > source (const GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName, const dimensionSet &ds, const AlphaRhoFieldTypes &... alphaRhos) const
 Return source for equation with specified name and dimensions. 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:
solidificationMeltingSource1
{
    type            solidificationMeltingSource;

    selectionMode   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 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 Accelerartion due to gravity no
Source files

Definition at line 225 of file solidificationMeltingSource.H.

Member Enumeration Documentation

◆ thermoMode

enum thermoMode
strong
Enumerator
thermo 
lookup 

Definition at line 231 of file solidificationMeltingSource.H.

Constructor & Destructor Documentation

◆ solidificationMeltingSource() [1/2]

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

Construct from explicit source name and mesh.

Definition at line 220 of file solidificationMeltingSource.C.

Referenced by NamedEnum< compressibleField, 8 >::names().

Here is the caller graph for this function:

◆ solidificationMeltingSource() [2/2]

Disallow default bitwise copy construction.

Member Function Documentation

◆ TypeName()

TypeName ( "solidificationMeltingSource"  )

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 266 of file solidificationMeltingSource.C.

References solidificationMeltingSource::addSup(), basicThermo::he(), lookup(), mesh, IOobject::name(), List< T >::null(), and thermo.

Here is the call graph for this function:

◆ addSup() [1/4]

void addSup ( fvMatrix< scalar > &  eqn,
const word fieldName 
) const
virtual

Add explicit contribution to enthalpy equation.

Definition at line 288 of file solidificationMeltingSource.C.

Referenced by solidificationMeltingSource::addSup(), and solidificationMeltingSource::addSupFields().

Here is the caller graph for this function:

◆ addSup() [2/4]

void addSup ( fvMatrix< vector > &  eqn,
const word fieldName 
) const
virtual

Add implicit contribution to momentum equation.

Definition at line 309 of file solidificationMeltingSource.C.

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

Here is the call graph for this function:

◆ addSup() [3/4]

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

Add explicit contribution to compressible enthalpy equation.

Definition at line 298 of file solidificationMeltingSource.C.

References solidificationMeltingSource::addSup().

Here is the call graph for this function:

◆ addSup() [4/4]

void addSup ( const volScalarField rho,
fvMatrix< vector > &  eqn,
const word fieldName 
) const
virtual

Add implicit contribution to compressible momentum equation.

Definition at line 348 of file solidificationMeltingSource.C.

◆ movePoints()

bool movePoints ( )
virtual

Update for mesh motion.

Implements fvModel.

Definition at line 359 of file solidificationMeltingSource.C.

References solidificationMeltingSource::topoChange().

Here is the call graph for this function:

◆ topoChange()

void topoChange ( const polyTopoChangeMap map)
virtual

Update topology using the given map.

Implements fvModel.

Definition at line 367 of file solidificationMeltingSource.C.

Referenced by solidificationMeltingSource::movePoints().

Here is the caller graph for this function:

◆ mapMesh()

void mapMesh ( const polyMeshMap map)
virtual

Update from another mesh using the given map.

Implements fvModel.

Definition at line 375 of file solidificationMeltingSource.C.

References solidificationMeltingSource::distribute().

Here is the call graph for this function:

◆ distribute()

void distribute ( const polyDistributionMap map)
virtual

Redistribute or update using the given distribution map.

Implements fvModel.

Definition at line 382 of file solidificationMeltingSource.C.

Referenced by solidificationMeltingSource::mapMesh().

Here is the caller graph for this function:

◆ read()

bool read ( const dictionary dict)
virtual

Read source dictionary.

Reimplemented from fvModel.

Definition at line 390 of file solidificationMeltingSource.C.

References fvModel::read().

Here is the call graph for this function:

◆ operator=()

void operator= ( const solidificationMeltingSource )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ thermoModeTypeNames_


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