Commit 18dd013e authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'feature-sub-cooling-ext' into 'develop'

Additional sub-cooling heat transfer correlations for liquid H2

See merge request !509
parents b18dd0cb cd2e6992
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -203,6 +204,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
......@@ -214,6 +227,18 @@ public:
const label patchi
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -318,6 +318,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
......@@ -329,6 +341,18 @@ public:
const label patchi
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -173,6 +173,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Return Cv of the mixture
virtual tmp<volScalarField> Cv() const;
......@@ -184,6 +196,18 @@ public:
const label patchI
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -496,6 +496,18 @@ Foam::tmp<Foam::scalarField> Foam::phaseSystem::Cv
}
Foam::tmp<Foam::scalarField> Foam::phaseSystem::rhoEoS
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volScalarField> Foam::phaseSystem::gamma() const
{
auto iter = phaseModels_.cbegin();
......
......@@ -351,6 +351,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Return Cv of the mixture
virtual tmp<volScalarField> Cv() const;
......@@ -362,6 +374,14 @@ public:
const label patchI
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const;
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -210,10 +210,12 @@ $(CHFModels)/Zuber/Zuber.C
CHFSubCoolModels = $(wallBoilingSubModels)/CHFSubCoolModels
$(CHFSubCoolModels)/CHFSubCoolModel/CHFSubCoolModel.C
$(CHFSubCoolModels)/HuaXu/HuaXu.C
$(CHFSubCoolModels)/Tatsumoto/Tatsumoto.C
filmBoiling = $(wallBoilingSubModels)/filmBoilingModels
$(filmBoiling)/filmBoilingModel/filmBoilingModel.C
$(filmBoiling)/Bromley/Bromley.C
$(filmBoiling)/BreenWestwater/BreenWestwater.C
Leidenfrost = $(wallBoilingSubModels)/LeidenfrostModels
$(Leidenfrost)/LeidenfrostModel/LeidenfrostModel.C
......@@ -226,6 +228,12 @@ $(MHFModels)/Jeschar/Jeschar.C
TDNBModels = $(wallBoilingSubModels)/TDNBModels
$(TDNBModels)/TDNBModel/TDNBModel.C
$(TDNBModels)/Schroeder/Schroeder.C
$(TDNBModels)/Shirai/Shirai.C
nucleateFluxModels = $(wallBoilingSubModels)/nucleateFluxModels
$(nucleateFluxModels)/nucleateFluxModel/nucleateFluxModel.C
$(nucleateFluxModels)/Kutadeladze/Kutadeladze.C
$(nucleateFluxModels)/exponential/exponential.C
/* Turbulence */
turbulence/multiphaseCompressibleTurbulenceModels.C
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -28,7 +29,40 @@ Class
Description
Contact-angle boundary condition for multi-phase interface-capturing
simulations. Used in conjunction with multiphaseSystem.
simulations. Used in conjunction with \c multiphaseSystem.
Usage
Example of the boundary condition specification:
\verbatim
<patch>
{
// Mandatory entries
type alphaContactAngle;
thetaProperties
(
(<phase1> <phase2>) <scalar1> <scalar2> <scalar3> <scalar4>
(<phase3> <phase2>) <scalar1> <scalar2> <scalar3> <scalar4>
...
);
// Inherited entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
type | Type name: alphaContactAngle | word | yes | -
thetaProperties | Contact-angle properties | dict | yes | -
\<scalar1\> | Equilibrium contact angle | scalar | yes |-
\<scalar2\> | Dynamic contact angle velocity scale | scalar | yes |-
\<scalar3\> | Limiting advancing contact angle | scalar | yes |-
\<scalar4\> | Limiting receding contact angle | scalar | yes |-
\endtable
The inherited entries are elaborated in:
- \link zeroGradientFvPatchFields.H \endlink
SourceFiles
alphaContactAngleFvPatchScalarField.C
......@@ -74,13 +108,16 @@ public:
public:
// Constructors
//- Default construct
interfaceThetaProps()
{}
//- Construct from Istream
interfaceThetaProps(Istream&);
// Member functions
// Member Functions
//- Return the equilibrium contact angle theta0
scalar theta0(bool matched=true) const
......@@ -90,7 +127,7 @@ public:
}
//- Return the dynamic contact angle velocity scale
scalar uTheta() const
scalar uTheta() const noexcept
{
return uTheta_;
}
......@@ -110,7 +147,7 @@ public:
}
// IO functions
// IOstream operators
friend Istream& operator>>(Istream&, interfaceThetaProps&);
friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
......@@ -126,8 +163,9 @@ public:
private:
// Private data
// Private Data
//- Interface properties
thetaPropsTable thetaProps_;
......@@ -155,7 +193,7 @@ public:
);
//- Construct by mapping given alphaContactAngleFvPatchScalarField
// onto a new patch
//- onto a new patch
alphaContactAngleFvPatchScalarField
(
const alphaContactAngleFvPatchScalarField&,
......@@ -193,10 +231,10 @@ public:
}
// Member functions
// Member Functions
//- Return the contact angle properties
const thetaPropsTable& thetaProps() const
const thetaPropsTable& thetaProps() const noexcept
{
return thetaProps_;
}
......
......@@ -65,7 +65,7 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
)
:
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
vaporPhaseName_(dict.lookup("vaporPhase")),
vaporPhaseName_(dict.get<word>("vaporPhase")),
relax_(dict.getOrDefault<scalar>("relax", 1)),
fixedDmdt_(dict.getOrDefault<scalar>("fixedDmdt", 0)),
L_(dict.getOrDefault<scalar>("L", 0))
......@@ -88,6 +88,8 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
iF,
mapper
),
vaporPhaseName_(psf.vaporPhaseName_),
relax_(psf.relax_),
fixedDmdt_(psf.fixedDmdt_),
L_(psf.L_)
{}
......@@ -100,6 +102,7 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
)
:
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf),
vaporPhaseName_(psf.vaporPhaseName_),
relax_(psf.relax_),
fixedDmdt_(psf.fixedDmdt_),
L_(psf.L_)
......@@ -114,6 +117,7 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
)
:
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF),
vaporPhaseName_(psf.vaporPhaseName_),
relax_(psf.relax_),
fixedDmdt_(psf.fixedDmdt_),
L_(psf.L_)
......@@ -129,10 +133,8 @@ activePhasePair(const phasePairKey& phasePair) const
{
return true;
}
else
{
return false;
}
}
......@@ -143,14 +145,12 @@ dmdt(const phasePairKey& phasePair) const
{
return dmdt_;
}
else
{
FatalErrorInFunction
<< " dmdt requested for invalid phasePair!"
<< abort(FatalError);
return mDotL_;
}
}
......@@ -161,14 +161,12 @@ mDotL(const phasePairKey& phasePair) const
{
return mDotL_;
}
else
{
FatalErrorInFunction
<< " mDotL requested for invalid phasePair!"
<< abort(FatalError);
return mDotL_;
}
}
......@@ -179,7 +177,9 @@ void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
return;
}
dmdt_ = (1 - relax_)*dmdt_ + relax_*fixedDmdt_;
dmdt_ *= (scalar(1) - relax_);
dmdt_ += relax_*fixedDmdt_;
mDotL_ = dmdt_*L_;
operator==(calcAlphat(*this));
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2018 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -28,9 +29,44 @@ Class
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
Description
A simple alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField with
A simple \c alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField with
a fixed volumetric phase-change mass flux.
Usage
Example of the boundary condition specification:
\verbatim
<patch>
{
// Mandatory entries
type compressible::alphatFixedDmdtWallBoilingWallFunction;
vaporPhase <word>;
// Optional entries
relax <scalar>;
fixedDmdt <scalar>;
L <scalar>;
// Inherited entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
type | Type name: <!--
--> compressible::alphatFixedDmdtWallBoilingWallFunction <!--
--> | word | yes | -
vaporPhase | Name of the vapor phase | word | yes | -
relax | Relaxation factor for dmdt | scalar | no | 1.0
fixedDmdt | Volumetric phase-change mass flux in near wall cells <!--
--> | scalar | no | 0.0
L | Latent heat | scalar | no | 0.0
\endtable
The inherited entries are elaborated in:
-\link alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H\endlink
See also
Foam::compressible::
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
......@@ -60,12 +96,12 @@ class alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
:
public alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
{
// Private data
// Private Data
//- name on the phase
//- Name of the vapor phase
word vaporPhaseName_;
//- dmdt relaxationFactor
//- Relaxation factor for dmdt
scalar relax_;
//- Volumetric phase-change mass flux in near wall cells
......@@ -99,8 +135,8 @@ public:
);
//- Construct by mapping given
// alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
// onto a new patch
//- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
//- onto a new patch
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
(
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField&,
......@@ -151,7 +187,7 @@ public:
}
// Member functions
// Member Functions
//- Is there phase change mass transfer for this phasePair
virtual bool activePhasePair(const phasePairKey&) const;
......@@ -162,7 +198,8 @@ public:
//- Return the rate of phase-change for specific phase pair
virtual const scalarField& mDotL(const phasePairKey&) const;
// Evaluation functions
// Evaluation
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
......
......@@ -45,14 +45,12 @@ namespace compressible
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::maxExp_
= 50.0;
scalar alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::tolerance_
= 0.01;
label alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::maxIters_
= 10;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::checkType()
{
......@@ -83,18 +81,18 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
const scalarField& Prat
) const
{
tmp<scalarField> typsf(new scalarField(this->size()));
scalarField& ypsf = typsf.ref();
auto typsf = tmp<scalarField>::New(this->size());
auto& ypsf = typsf.ref();
forAll(ypsf, facei)
{
scalar ypt = 11.0;
for (int i=0; i<maxIters_; i++)
for (int i = 0; i < maxIters_; ++i)
{
scalar f = ypt - (log(E_*ypt)/kappa_ + P[facei])/Prat[facei];
scalar df = 1 - 1.0/(ypt*kappa_*Prat[facei]);
scalar yptNew = ypt - f/df;
const scalar f = ypt - (log(E_*ypt)/kappa_ + P[facei])/Prat[facei];
const scalar df = 1.0 - 1.0/(ypt*kappa_*Prat[facei]);
const scalar yptNew = ypt - f/df;
if (yptNew < VSMALL)
{
......@@ -116,26 +114,23 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
return typsf;
}
tmp<scalarField>