Commit 2db6c4f8 authored by Andrew Heather's avatar Andrew Heather
Browse files

liquid updates

parent 9f8271c3
......@@ -34,7 +34,6 @@ const Foam::scalar Foam::liquidMixture::TrMax = 0.999;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::liquidMixture::liquidMixture
(
const dictionary& thermophysicalProperties
......@@ -72,6 +71,7 @@ Foam::liquidMixture::liquidMixture
}
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::liquidMixture> Foam::liquidMixture::New
......@@ -85,7 +85,6 @@ Foam::autoPtr<Foam::liquidMixture> Foam::liquidMixture::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Critical Temperature
Foam::scalar Foam::liquidMixture::Tc
(
const scalarField& x
......@@ -104,9 +103,8 @@ Foam::scalar Foam::liquidMixture::Tc
return vTc/vc;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Pseudocritical temperature
Foam::scalar Foam::liquidMixture::Tpc
(
const scalarField& x
......@@ -121,9 +119,7 @@ Foam::scalar Foam::liquidMixture::Tpc
return Tpc;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Pseudocritical pressure
Foam::scalar Foam::liquidMixture::Ppc
(
const scalarField& x
......@@ -140,7 +136,6 @@ Foam::scalar Foam::liquidMixture::Ppc
return specie::RR*Zc*Tpc(x)/Vc;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::scalar Foam::liquidMixture::omega
(
......@@ -156,7 +151,6 @@ Foam::scalar Foam::liquidMixture::omega
return omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::scalarField Foam::liquidMixture::Xs
(
......@@ -178,9 +172,6 @@ Foam::scalarField Foam::liquidMixture::Xs
return xs;
}
//-----------------------------------------------------------------------------
// Physical properties
//-----------------------------------------------------------------------------
Foam::scalar Foam::liquidMixture::W
(
......@@ -196,6 +187,7 @@ Foam::scalar Foam::liquidMixture::W
return W;
}
Foam::scalarField Foam::liquidMixture::Y
(
const scalarField& X
......@@ -211,6 +203,7 @@ Foam::scalarField Foam::liquidMixture::Y
return Y;
}
Foam::scalarField Foam::liquidMixture::X
(
const scalarField& Y
......@@ -250,6 +243,7 @@ Foam::scalar Foam::liquidMixture::rho
return W(x)/v;
}
Foam::scalar Foam::liquidMixture::pv
(
const scalar p,
......@@ -271,6 +265,7 @@ Foam::scalar Foam::liquidMixture::pv
return pv/W(x);
}
Foam::scalar Foam::liquidMixture::hl
(
const scalar p,
......@@ -292,6 +287,7 @@ Foam::scalar Foam::liquidMixture::hl
return hl/W(x);
}
Foam::scalar Foam::liquidMixture::cp
(
const scalar p,
......@@ -313,6 +309,7 @@ Foam::scalar Foam::liquidMixture::cp
return cp/W(x);
}
Foam::scalar Foam::liquidMixture::sigma
(
const scalar p,
......@@ -346,6 +343,7 @@ Foam::scalar Foam::liquidMixture::sigma
return sigma;
}
Foam::scalar Foam::liquidMixture::mu
(
const scalar p,
......@@ -367,6 +365,7 @@ Foam::scalar Foam::liquidMixture::mu
return exp(mu);
}
Foam::scalar Foam::liquidMixture::K
(
const scalar p,
......@@ -402,7 +401,12 @@ Foam::scalar Foam::liquidMixture::K
{
scalar Tj = min(TrMax*properties_[j].Tc(), T);
scalar Kij = 2.0/(1.0/properties_[i].K(p, Ti) + 1.0/properties_[j].K(p, Tj));
scalar Kij =
2.0
/(
1.0/properties_[i].K(p, Ti)
+ 1.0/properties_[j].K(p, Tj)
);
K += phii[i]*phii[j]*Kij;
}
}
......@@ -410,6 +414,7 @@ Foam::scalar Foam::liquidMixture::K
return K;
}
Foam::scalar Foam::liquidMixture::D
(
const scalar p,
......@@ -432,4 +437,5 @@ Foam::scalar Foam::liquidMixture::D
return 1.0/Dinv;
}
// ************************************************************************* //
......@@ -27,19 +27,117 @@ License
#include "Ar.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(Ar, 0);
addToRunTimeSelectionTable(liquid, Ar,);
addToRunTimeSelectionTable(liquid, Ar, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(Ar, 0);
addToRunTimeSelectionTable(liquid, Ar,);
addToRunTimeSelectionTable(liquid, Ar, Istream);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::Ar::Ar()
:
liquid
(
39.948,
150.86,
4.8981e+6,
0.07459,
0.291,
83.78,
6.88e+4,
87.28,
0.0,
0.0,
1.4138e+4
),
rho_(151.922244, 0.286, 150.86, 0.2984),
pv_(39.233, -1051.7, -3.5895, 5.0444e-05, 2),
hl_(150.86, 218509.061780314, 0.352, 0.0, 0.0, 0.0),
cp_(4562.43116050866, -70.7770101131471, 0.367477721037349, 0.0, 0.0, 0.0),
h_
(
-1460974.49982473,
4562.43116050866,
-35.3885050565735,
0.122492573679116,
0.0,
0.0
),
cpg_(520.326424351657, 0.0, 0.0, 0.0, 0.0, 0.0),
B_
(
0.000952488234705117,
-0.379993992189847,
-2022.62941824372,
4633523580654.85,
-302893761890458.0
),
mu_(-8.868, 204.3, -0.3831, -1.3e-22, 10.0),
mug_(8.386e-07, 0.6175, 75.377, -432.5),
K_(0.1819, -0.0003176, -4.11e-06, 0.0, 0.0, 0.0),
Kg_(0.0001236, 0.8262, -132.8, 16000),
sigma_(150.86, 0.03823, 1.2927, 0.0, 0.0, 0.0),
D_(147.18, 20.1, 39.948, 28) // note: Same as nHeptane
{}
Foam::Ar::Ar
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc0& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc0& idealGasHeatCapacity,
const NSRDSfunc4& secondVirialCoeff,
const NSRDSfunc1& dynamicViscosity,
const NSRDSfunc2& vapourDynamicViscosity,
const NSRDSfunc0& thermalConductivity,
const NSRDSfunc2& vapourThermalConductivity,
const NSRDSfunc6& surfaceTension,
const APIdiffCoefFunc& vapourDiffussivity
)
:
liquid(l),
rho_(density),
pv_(vapourPressure),
hl_(heatOfVapourisation),
cp_(heatCapacity),
h_(enthalpy),
cpg_(idealGasHeatCapacity),
B_(secondVirialCoeff),
mu_(dynamicViscosity),
mug_(vapourDynamicViscosity),
K_(thermalConductivity),
Kg_(vapourThermalConductivity),
sigma_(surfaceTension),
D_(vapourDiffussivity)
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::Ar::Ar(Istream& is)
:
liquid(is),
rho_(is),
pv_(is),
hl_(is),
cp_(is),
h_(is),
cpg_(is),
B_(is),
mu_(is),
mug_(is),
K_(is),
Kg_(is),
sigma_(is),
D_(is)
{}
} // End namespace Foam
// ************************************************************************* //
......@@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
Ar()
:
liquid(39.948, 150.86, 4.8981e+6, 0.07459, 0.291, 83.78, 6.88e+4, 87.28, 0.0, 0.0, 1.4138e+4),
rho_(151.922244, 0.286, 150.86, 0.2984),
pv_(39.233, -1051.7, -3.5895, 5.0444e-05, 2),
hl_(150.86, 218509.061780314, 0.352, 0, 0, 0),
cp_(4562.43116050866, -70.7770101131471, 0.367477721037349, 0, 0, 0),
// NN: enthalpy, h_, is not used in the sprayModel.
// For consistency, the enthalpy is derived from hlat and hl.
// It is, however, convenient to have it available.
h_(-1460974.49982473, 4562.43116050866, -35.3885050565735, 0.122492573679116, 0, 0),
cpg_(520.326424351657, 0, 0, 0, 0, 0),
B_(0.000952488234705117, -0.379993992189847, -2022.62941824372, 4633523580654.85, -302893761890458.0),
mu_(-8.868, 204.3, -0.3831, -1.3e-22, 10),
mug_(8.386e-07, 0.6175, 75.377, -432.5),
K_(0.1819, -0.0003176, -4.11e-06, 0, 0, 0),
Kg_(0.0001236, 0.8262, -132.8, 16000),
sigma_(150.86, 0.03823, 1.2927, 0, 0, 0),
D_(147.18, 20.1, 39.948, 28) // NN: Same as nHeptane
{}
Ar();
//- Construct from components
Ar
(
const liquid& l,
......@@ -123,125 +106,56 @@ public:
const NSRDSfunc2& vapourThermalConductivity,
const NSRDSfunc6& surfaceTension,
const APIdiffCoefFunc& vapourDiffussivity
)
:
liquid(l),
rho_(density),
pv_(vapourPressure),
hl_(heatOfVapourisation),
cp_(heatCapacity),
h_(enthalpy),
cpg_(idealGasHeatCapacity),
B_(secondVirialCoeff),
mu_(dynamicViscosity),
mug_(vapourDynamicViscosity),
K_(thermalConductivity),
Kg_(vapourThermalConductivity),
sigma_(surfaceTension),
D_(vapourDiffussivity)
{}
);
//- Construct from Istream
Ar(Istream& is)
:
liquid(is),
rho_(is),
pv_(is),
hl_(is),
cp_(is),
h_(is),
cpg_(is),
B_(is),
mu_(is),
mug_(is),
K_(is),
Kg_(is),
sigma_(is),
D_(is)
{}
Ar(Istream& is);
// Member Functions
//- Liquid density [kg/m^3]
scalar rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline scalar rho(scalar p, scalar T) const;
//- Vapour pressure [Pa]
scalar pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline scalar pv(scalar p, scalar T) const;
//- Heat of vapourisation [J/kg]
scalar hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline scalar hl(scalar p, scalar T) const;
//- Liquid heat capacity [J/(kg K)]
scalar cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline scalar cp(scalar p, scalar T) const;
//- Liquid Enthalpy [J/(kg)]
scalar h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline scalar h(scalar p, scalar T) const;
//- Ideal gas heat capacity [J/(kg K)]
scalar cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline scalar cpg(scalar p, scalar T) const;
//- Second Virial Coefficient [m^3/kg]
scalar B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline scalar B(scalar p, scalar T) const;
//- Liquid viscosity [Pa s]
scalar mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline scalar mu(scalar p, scalar T) const;
//- Vapour viscosity [Pa s]
scalar mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline scalar mug(scalar p, scalar T) const;
//- Liquid thermal conductivity [W/(m K)]
scalar K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline scalar K(scalar p, scalar T) const;
//- Vapour thermal conductivity [W/(m K)]
scalar Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline scalar Kg(scalar p, scalar T) const;
//- Surface tension [N/m]
scalar sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline scalar sigma(scalar p, scalar T) const;
//- Vapour diffussivity [m2/s]
scalar D(scalar p, scalar T) const
{
return D_.f(p, T);
}
inline scalar D(scalar p, scalar T) const;
// I-O
//- Write the function coefficients
void writeData(Ostream& os) const
{
......@@ -260,9 +174,7 @@ public:
D_.writeData(os); os << endl;
}
// Ostream Operator
//- Ostream Operator
friend Ostream& operator<<(Ostream& os, const Ar& l)
{
l.writeData(os);
......@@ -277,6 +189,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "ArI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
inline Foam::scalar Foam::Ar::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::Ar::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::Ar::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::Ar::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::Ar::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::Ar::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::Ar::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::Ar::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::Ar::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::Ar::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::Ar::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::Ar::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::Ar::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //
......@@ -27,19 +27,124 @@ License
#include "C10H22.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //