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 class  thermoMode { thermo , lookup }
 

Public Member Functions

 TypeName ("solidificationMeltingSource")
 Runtime type information. More...
 
 solidificationMeltingSource (const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
 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 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...
 
 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 VolField< Type > &field) const
 Return source for an equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const VolField< Type > &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 VolField< Type > &field) const
 Return source for a compressible equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &rho, const VolField< Type > &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 VolField< Type > &field) const
 Return source for a phase equation. More...
 
template<class Type >
tmp< fvMatrix< Type > > source (const volScalarField &alpha, const volScalarField &rho, const VolField< Type > &field, const word &fieldName) const
 Return source for a phase equation with a specified name. 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...
 
template<class Type >
tmp< fvMatrix< Type > > d2dt2 (const VolField< Type > &field, const word &fieldName) 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...
 
template<class Type , class AlphaRhoFieldType , class ... AlphaRhoFieldTypes>
Foam::dimensionSet sourceDims (const VolField< Type > &field, const dimensionSet &ds, const AlphaRhoFieldType &alphaRho, const AlphaRhoFieldTypes &... alphaRhos)
 
template<class Type >
Foam::dimensionSet sourceDims (const VolField< Type > &field, const dimensionSet &ds)
 
template<class Type , class ... AlphaRhoFieldTypes>
Foam::tmp< Foam::fvMatrix< Type > > source (const VolField< Type > &field, const word &fieldName, const dimensionSet &ds, const AlphaRhoFieldTypes &... alphaRhos) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const VolField< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > source (const VolField< Type > &field, const word &fieldName) 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 > > source (const volScalarField &rho, const VolField< Type > &field, const word &fieldName) 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 > > source (const volScalarField &alpha, const volScalarField &rho, const VolField< Type > &field, const word &fieldName) 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
 
template<class Type >
Foam::tmp< Foam::fvMatrix< Type > > d2dt2 (const VolField< Type > &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 VolField< Type > &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 VolField< Type > &field, const dimensionSet &ds)
 Return the dimensions of the matrix of a source term (base. 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 (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 VolField< Type > &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;

    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 solidificationMeltingSource.H.

Member Enumeration Documentation

◆ thermoMode

enum thermoMode
strong
Enumerator
thermo 
lookup 

Definition at line 230 of file solidificationMeltingSource.H.

Constructor & Destructor Documentation

◆ solidificationMeltingSource() [1/2]

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

Construct from explicit source name and mesh.

Definition at line 219 of file solidificationMeltingSource.C.

◆ 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 Foam::name(), List< word >::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 287 of file solidificationMeltingSource.C.

◆ addSup() [2/4]

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

Add implicit contribution to momentum equation.

Definition at line 308 of file solidificationMeltingSource.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,
fvMatrix< scalar > &  eqn,
const word fieldName 
) const
virtual

Add explicit contribution to compressible enthalpy equation.

Definition at line 297 of file solidificationMeltingSource.C.

References rho.

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

◆ movePoints()

bool movePoints ( )
virtual

Update for mesh motion.

Implements fvModel.

Definition at line 359 of file solidificationMeltingSource.C.

◆ topoChange()

void topoChange ( const polyTopoChangeMap map)
virtual

Update topology using the given map.

Implements fvModel.

Definition at line 366 of file solidificationMeltingSource.C.

◆ 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.

◆ distribute()

void distribute ( const polyDistributionMap map)
virtual

Redistribute or update using the given distribution map.

Implements fvModel.

Definition at line 381 of file solidificationMeltingSource.C.

◆ read()

bool read ( const dictionary dict)
virtual

Read source dictionary.

Reimplemented from fvModel.

Definition at line 390 of file solidificationMeltingSource.C.

References dict, and fvModel::read().

Here is the call graph for this function:

◆ operator=()

void operator= ( const solidificationMeltingSource )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ thermoModeTypeNames_

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

Definition at line 236 of file solidificationMeltingSource.H.


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