mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Fixed spray constructor so that a restart works.
Lookup liquidProperties in thermophysicalProperties (avoid conflict with gas-phase). Changed liquidFuelComponents to liquidComponents. Updated dieselFoam tutorial to reflect the changes
This commit is contained in:
@ -38,21 +38,20 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineParticleTypeNameAndDebug(parcel, 0);
|
||||
defineTemplateTypeNameAndDebug(Cloud<parcel>, 0);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
parcel::parcel
|
||||
Foam::parcel::parcel
|
||||
(
|
||||
const Cloud<parcel>& cloud,
|
||||
const vector& position,
|
||||
const label celli,
|
||||
const label cellI,
|
||||
const vector& n,
|
||||
const scalar d,
|
||||
const scalar T,
|
||||
@ -67,14 +66,13 @@ parcel::parcel
|
||||
const vector& U,
|
||||
const vector& Uturb,
|
||||
const scalarField& X,
|
||||
const List<word>& fuelNames
|
||||
const List<word>& liquidNames
|
||||
)
|
||||
:
|
||||
Particle<parcel>(cloud, position, celli),
|
||||
|
||||
fuelNames_
|
||||
Particle<parcel>(cloud, position, cellI),
|
||||
liquidComponents_
|
||||
(
|
||||
fuelNames
|
||||
liquidNames
|
||||
),
|
||||
d_(d),
|
||||
T_(T),
|
||||
@ -96,7 +94,7 @@ parcel::parcel
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool parcel::move(spray& sDB)
|
||||
bool Foam::parcel::move(spray& sDB)
|
||||
{
|
||||
const polyMesh& mesh = cloud().pMesh();
|
||||
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
|
||||
@ -329,7 +327,7 @@ bool parcel::move(spray& sDB)
|
||||
}
|
||||
|
||||
|
||||
void parcel::updateParcelProperties
|
||||
void Foam::parcel::updateParcelProperties
|
||||
(
|
||||
const scalar dt,
|
||||
spray& sDB,
|
||||
@ -638,18 +636,16 @@ void parcel::updateParcelProperties
|
||||
}
|
||||
|
||||
|
||||
void parcel::transformProperties(const tensor& T)
|
||||
void Foam::parcel::transformProperties(const tensor& T)
|
||||
{
|
||||
U_ = transform(T, U_);
|
||||
}
|
||||
|
||||
|
||||
void parcel::transformProperties(const vector&)
|
||||
void Foam::parcel::transformProperties(const vector&)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -54,7 +54,7 @@ class parcel
|
||||
// Private member data
|
||||
|
||||
// Reference to the names of the liquid components
|
||||
List<word> fuelNames_;
|
||||
List<word> liquidComponents_;
|
||||
|
||||
// Defining data (read and written to field files)
|
||||
|
||||
@ -100,7 +100,7 @@ class parcel
|
||||
// in which the particle moves
|
||||
vector n_;
|
||||
|
||||
//- Liquid fuel molar fractions
|
||||
//- Liquid components molar fractions
|
||||
scalarField X_;
|
||||
|
||||
// Derived state information (not read or written)
|
||||
@ -166,7 +166,7 @@ public:
|
||||
const vector& U,
|
||||
const vector& Uturb,
|
||||
const scalarField& X,
|
||||
const List<word>& fuelNames
|
||||
const List<word>& liquidNames
|
||||
);
|
||||
|
||||
//- Construct from Istream reading field values if required
|
||||
@ -182,7 +182,10 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the names of the liquid fuel components
|
||||
//- Return the names of the liquid components
|
||||
inline const List<word>& liquidNames() const;
|
||||
|
||||
//- Return the names of the liquid fuel components - identical with liquidNames
|
||||
inline const List<word>& fuelNames() const;
|
||||
|
||||
//- Return diameter of droplets in parcel
|
||||
@ -265,10 +268,10 @@ public:
|
||||
//- Return the normal used for 2D purposes
|
||||
inline vector& n();
|
||||
|
||||
//- Return the liquid fuel molar fractions
|
||||
//- Return the liquid components molar fractions
|
||||
inline const scalarField& X() const;
|
||||
|
||||
//- Return the liquid fuel molar fractions
|
||||
//- Return the liquid components molar fractions
|
||||
inline scalarField& X();
|
||||
|
||||
//- Return the momentum relaxation time of droplets in parcel
|
||||
|
||||
@ -31,9 +31,14 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline const List<word>& parcel::liquidNames() const
|
||||
{
|
||||
return liquidComponents_;
|
||||
}
|
||||
|
||||
inline const List<word>& parcel::fuelNames() const
|
||||
{
|
||||
return fuelNames_;
|
||||
return liquidComponents_;
|
||||
}
|
||||
|
||||
inline scalar parcel::d() const
|
||||
|
||||
@ -38,17 +38,17 @@ Foam::parcel::parcel
|
||||
:
|
||||
Particle<parcel>(cloud, is),
|
||||
|
||||
fuelNames_
|
||||
liquidComponents_
|
||||
(
|
||||
(cloud.pMesh().lookupObject<dictionary>("thermophysicalProperties"))
|
||||
.lookup("liquidFuelComponents")
|
||||
.lookup("liquidComponents")
|
||||
),
|
||||
X_(fuelNames_.size(), 0.0),
|
||||
X_(liquidComponents_.size(), 0.0),
|
||||
|
||||
tMom_(GREAT)
|
||||
{
|
||||
|
||||
label nX = fuelNames_.size();
|
||||
label nX = X_.size();
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
@ -67,7 +67,7 @@ Foam::parcel::parcel
|
||||
is >> U_;
|
||||
is >> Uturb_;
|
||||
is >> n_;
|
||||
for(label j=0; j<nX; j++)
|
||||
for (label j=0; j<nX; j++)
|
||||
{
|
||||
X_[j] = readScalar(is);
|
||||
}
|
||||
@ -175,11 +175,10 @@ void Foam::parcel::readFields
|
||||
const parcel& p0 = iter();
|
||||
|
||||
label nX = p0.X().size();
|
||||
List<word> names(p0.fuelNames());
|
||||
const List<word>& names = p0.liquidNames();
|
||||
|
||||
for (label j=0; j<nX; j++)
|
||||
{
|
||||
|
||||
IOField<scalar> X(c.fieldIOobject(names[j]));
|
||||
|
||||
label i = 0;
|
||||
@ -262,8 +261,7 @@ void Foam::parcel::writeFields
|
||||
const parcel& p0 = iter();
|
||||
|
||||
label nX = p0.X().size();
|
||||
|
||||
List<word> names(p0.fuelNames());
|
||||
const List<word>& names = p0.liquidNames();
|
||||
|
||||
for (label j=0; j<nX; j++)
|
||||
{
|
||||
|
||||
@ -63,7 +63,7 @@ Foam::spray::spray
|
||||
const dictionary& environmentalProperties
|
||||
)
|
||||
:
|
||||
Cloud<parcel>(U.mesh()),
|
||||
Cloud<parcel>(U.mesh(), false), // suppress className checking on positions
|
||||
runTime_(U.time()),
|
||||
time0_(runTime_.value()),
|
||||
mesh_(U.mesh()),
|
||||
|
||||
@ -29,10 +29,8 @@ License
|
||||
#include "specie.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
namespace Foam
|
||||
{
|
||||
const scalar liquidMixture::TrMax = 0.999;
|
||||
}
|
||||
|
||||
const Foam::scalar Foam::liquidMixture::TrMax = 0.999;
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -42,11 +40,28 @@ Foam::liquidMixture::liquidMixture
|
||||
const dictionary& thermophysicalProperties
|
||||
)
|
||||
:
|
||||
components_(thermophysicalProperties.lookup("liquidFuelComponents")),
|
||||
components_(thermophysicalProperties.lookup("liquidComponents")),
|
||||
properties_(components_.size())
|
||||
{
|
||||
|
||||
// use sub-dictionary "liquidProperties" if possible to avoid
|
||||
// collisions with identically named gas-phase entries
|
||||
// (eg, H2O liquid vs. gas)
|
||||
forAll(components_, i)
|
||||
{
|
||||
const dictionary* subDictPtr = thermophysicalProperties.subDictPtr
|
||||
(
|
||||
"liquidProperties"
|
||||
);
|
||||
|
||||
if (subDictPtr)
|
||||
{
|
||||
properties_.set
|
||||
(
|
||||
i,
|
||||
liquid::New(subDictPtr->lookup(components_[i]))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
properties_.set
|
||||
(
|
||||
@ -54,6 +69,7 @@ Foam::liquidMixture::liquidMixture
|
||||
liquid::New(thermophysicalProperties.lookup(components_[i]))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,6 +34,48 @@ Description
|
||||
|
||||
For now it does not do much, since the perfect gas equation is used.
|
||||
|
||||
The dictionary constructor searches for the entry @c liquidComponents,
|
||||
which is a wordList. The liquid properties of each component can either
|
||||
be contained within a @c liquidProperties sub-dictionary or (for legacy
|
||||
purposes) can be found directly in the dictionary.
|
||||
The @c liquidProperties sub-dictionary entry should be used when possible
|
||||
to avoid conflicts with identically named gas-phase entries.
|
||||
|
||||
A simple example of a single-component liquidMixture:
|
||||
@verbatim
|
||||
liquidComponents
|
||||
(
|
||||
H2O
|
||||
);
|
||||
|
||||
// the gas-phase species
|
||||
species
|
||||
(
|
||||
AIR H2O
|
||||
);
|
||||
|
||||
// thermo values from BurcatCpData
|
||||
AIR
|
||||
AIR 1 28.96518 // specie: name/nMoles/MolWt
|
||||
200 6000 1000 // low/high/common temperature
|
||||
3.0879272 0.0012459718 -4.2371895e-07 6.7477479e-11 -3.9707697e-15 -995.26275 5.9596093 // 7 upper Temp. coeffs
|
||||
3.5683962 -0.00067872943 1.5537148e-06 -3.2993706e-12 -4.6639539e-13 -1062.3466 3.7158296 // 7 lower Temp. coeffs
|
||||
1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD)
|
||||
;
|
||||
H2O
|
||||
H2O 1 18.01528 // specie: name/nMoles/MolWt
|
||||
200 6000 1000 // low/high/common temperature
|
||||
2.6770389 0.0029731816 -7.7376889e-07 9.4433514e-11 -4.2689991e-15 -29885.894 6.88255 // 7 upper Temp. coeffs
|
||||
4.1986352 -0.0020364017 6.5203416e-06 -5.4879269e-09 1.771968e-12 -30293.726 -0.84900901 // 7 lower Temp. coeffs
|
||||
1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD)
|
||||
;
|
||||
|
||||
liquidProperties
|
||||
{
|
||||
H2O H2O defaultCoeffs;
|
||||
}
|
||||
@endverbatim
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef liquidMixture_H
|
||||
|
||||
@ -1,23 +1,17 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / O peration | Version: 1.4.2 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object chemistryProperties;
|
||||
location "constant";
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,23 +1,17 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / O peration | Version: 1.4.2 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object combustionProperties;
|
||||
location "constant";
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -27,11 +21,8 @@ Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0 ;
|
||||
ignitionProperties1
|
||||
{
|
||||
ignite off;
|
||||
|
||||
ignitionPoint ignitionPoint [ 0 1 0 0 0 0 0 ] ( 0.2 0 0.02 ) ;
|
||||
|
||||
timing timing [ 0 0 1 0 0 0 0 ] 0.0e-1 ;
|
||||
|
||||
duration duration [ 0 0 1 0 0 0 0 ] 1.0e-0 ;
|
||||
}
|
||||
|
||||
|
||||
@ -1,23 +1,17 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / O peration | Version: 1.4.2 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object environmentalProperties;
|
||||
location "constant";
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,23 +1,17 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / O peration | Version: 1.4.2 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object injectorProperties;
|
||||
location "constant";
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,23 +1,17 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / O peration | Version: 1.4.2 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object sprayProperties;
|
||||
location "constant";
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,39 +1,38 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / O peration | Version: 1.4.2 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object thermodynamicProperties;
|
||||
location "constant";
|
||||
}
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
thermoType hMixtureThermo<reactingMixture>;
|
||||
|
||||
CHEMKINFile "$FOAM_ROOT/$FOAM_CASE/chemkin/chem.inp";
|
||||
CHEMKINThermoFile "$FOAM_ROOT/$FOAM_CASE/chemkin/therm.dat";
|
||||
CHEMKINFile "$FOAM_CASE/chemkin/chem.inp";
|
||||
// We use the central thermo data:
|
||||
CHEMKINThermoFile "~OpenFOAM/thermoData/therm.dat";
|
||||
|
||||
inertSpecie N2;
|
||||
|
||||
liquidFuelComponents
|
||||
liquidComponents
|
||||
(
|
||||
C7H16
|
||||
);
|
||||
|
||||
C7H16 C7H16 defaultCoeffs;
|
||||
liquidProperties
|
||||
{
|
||||
C7H16 C7H16 defaultCoeffs;
|
||||
C7H16
|
||||
}
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
@ -1,23 +1,17 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / O peration | Version: 1.4.2 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object turbulenceProperties;
|
||||
location "constant";
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Reference in New Issue
Block a user