Merge branch 'master' into cvm

This commit is contained in:
graham
2009-07-09 10:24:23 +01:00
379 changed files with 11316 additions and 5281 deletions

View File

@ -449,7 +449,11 @@ meshTools = meshes/meshTools
$(meshTools)/matchPoints.C
$(meshTools)/mergePoints.C
fields/UniformDimensionedFields/uniformDimensionedFields.C
fields/cloud/cloud.C
Fields = fields/Fields
$(Fields)/labelField/labelField.C
$(Fields)/scalarField/scalarField.C
$(Fields)/sphericalTensorField/sphericalTensorField.C
@ -458,8 +462,6 @@ $(Fields)/symmTensorField/symmTensorField.C
$(Fields)/tensorField/tensorField.C
$(Fields)/complexFields/complexFields.C
fields/cloud/cloud.C
$(Fields)/labelField/labelIOField.C
$(Fields)/scalarField/scalarIOField.C
$(Fields)/vectorField/vectorIOField.C

View File

@ -63,17 +63,28 @@ class OutputFilterFunctionObject
{
// Private data
//- Output filter name
word name_;
//- Reference to the time database
const Time& time_;
//- Input dictionary
dictionary dict_;
//- Name of region
word regionName_;
//- Optional dictionary name to supply required inputs
word dictName_;
//- Switch for the execution of the functionObject
bool enabled_;
//- Output controls
outputFilterOutputControl outputControl_;
//- Pointer to the output filter
autoPtr<OutputFilter> ptr_;
@ -108,31 +119,78 @@ public:
// Member Functions
//- Return name
virtual const word& name() const
{
return name_;
}
// Access
//- Switch the function object on
virtual void on();
//- Return name
virtual const word& name() const
{
return name_;
}
//- Switch the function object off
virtual void off();
//- Return time database
virtual const Time& time() const
{
return time_;
}
//- Return the input dictionary
virtual const dictionary& dict() const
{
return dict_;
}
//- Return the region name
virtual const word& regionName() const
{
return regionName_;
}
//- Return the optional dictionary name
virtual const word& dictName() const
{
return dictName_;
}
//- Return the enabled flag
virtual bool enabled() const
{
return enabled_;
}
//- Return the output control object
virtual const outputFilterOutputControl& outputControl() const
{
return outputControl_;
}
//- Return the output filter
virtual const OutputFilter& outputFilter() const
{
return ptr_();
}
//- Called at the start of the time-loop
virtual bool start();
// Function object control
//- Called at each ++ or += of the time-loop
virtual bool execute();
//- Switch the function object on
virtual void on();
//- Called when Time::run() determines that the time-loop exits
virtual bool end();
//- Switch the function object off
virtual void off();
//- Read and set the function object if its data have changed
virtual bool read(const dictionary&);
//- Called at the start of the time-loop
virtual bool start();
//- Called at each ++ or += of the time-loop
virtual bool execute();
//- Called when Time::run() determines that the time-loop exits
virtual bool end();
//- Read and set the function object if its data have changed
virtual bool read(const dictionary&);
};

View File

@ -217,9 +217,8 @@ public:
tmp<DimensionedField<Type, GeoMesh> > clone() const;
// Destructor
~DimensionedField();
//- Destructor
virtual ~DimensionedField();
// Member Functions

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
\*---------------------------------------------------------------------------*/
#include "UniformDimensionedField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::UniformDimensionedField<Type>::UniformDimensionedField
(
const IOobject& io,
const dimensioned<Type>& dt
)
:
regIOobject(io),
dimensioned<Type>(dt)
{}
template<class Type>
Foam::UniformDimensionedField<Type>::UniformDimensionedField
(
const UniformDimensionedField<Type>& rdt
)
:
regIOobject(rdt),
dimensioned<Type>(rdt)
{}
template<class Type>
Foam::UniformDimensionedField<Type>::UniformDimensionedField
(
const IOobject& io
)
:
regIOobject(io),
dimensioned<Type>(regIOobject::name(), dimless, pTraits<Type>::zero)
{
dictionary dict(readStream(typeName));
this->dimensions().reset(dict.lookup("dimensions"));
this->value() = dict.lookup("value");
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::UniformDimensionedField<Type>::~UniformDimensionedField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
bool Foam::UniformDimensionedField<Type>::writeData(Ostream& os) const
{
os.writeKeyword("dimensions") << this->dimensions() << token::END_STATEMENT
<< nl;
os.writeKeyword("value") << this->value() << token::END_STATEMENT
<< nl << nl;
return (os.good());
}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class Type>
void Foam::UniformDimensionedField<Type>::operator=
(
const UniformDimensionedField<Type>& rhs
)
{
dimensioned<Type>::operator=(rhs);
}
template<class Type>
void Foam::UniformDimensionedField<Type>::operator=
(
const dimensioned<Type>& rhs
)
{
dimensioned<Type>::operator=(rhs);
}
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
Class
Foam::UniformDimensionedField
Description
Dimensioned<Type> registered with the database as a registered IOobject
which has the functionality of a uniform field and allows values from the
top-level code to be passed to boundary conditions etc.
SourceFiles
UniformDimensionedField.C
\*---------------------------------------------------------------------------*/
#ifndef UniformDimensionedField_H
#define UniformDimensionedField_H
#include "regIOobject.H"
#include "dimensionedType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class UniformDimensionedField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class UniformDimensionedField
:
public regIOobject,
public dimensioned<Type>
{
public:
//- Runtime type information
TypeName("UniformDimensionedField");
// Constructors
//- Construct null
UniformDimensionedField();
//- Construct from components
UniformDimensionedField(const IOobject&, const dimensioned<Type>&);
//- Construct as copy
UniformDimensionedField(const UniformDimensionedField<Type>&);
//- Construct from Istream
UniformDimensionedField(const IOobject&);
//- Destructor
virtual ~UniformDimensionedField();
// Member Functions
//- Name function provided to resolve the ambiguity between the
// name functions in regIOobject and dimensioned<Type>
virtual const word& name() const
{
return dimensioned<Type>::name();
}
bool writeData(Ostream&) const;
// Member Operators
void operator=(const UniformDimensionedField<Type>&);
void operator=(const dimensioned<Type>&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "UniformDimensionedField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplateTypeNameAndDebug(uniformDimensionedScalarField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedVectorField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedSphericalTensorField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedSymmTensorField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedTensorField, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
InClass
Foam::UniformDimensionedField
Description
SourceFiles
uniformDimensionedFields.C
\*---------------------------------------------------------------------------*/
#ifndef UniformDimensionedFields_H
#define UniformDimensionedFields_H
#include "UniformDimensionedField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef UniformDimensionedField<scalar> uniformDimensionedScalarField;
typedef UniformDimensionedField<vector> uniformDimensionedVectorField;
typedef UniformDimensionedField<sphericalTensor> uniformDimensionedSphericalTensorField;
typedef UniformDimensionedField<symmTensor> uniformDimensionedSymmTensorField;
typedef UniformDimensionedField<tensor> uniformDimensionedTensorField;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -113,7 +113,7 @@ Foam::label Foam::meshRefinement::createBaffle
true, // face flip
neiPatch, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
!zoneFlip // face flip in zone
)
);
}

View File

@ -56,7 +56,7 @@ Foam::trackedParticle::trackedParticle
bool readFields
)
:
ExactParticle<trackedParticle>(c, is)
ExactParticle<trackedParticle>(c, is, readFields)
{
if (readFields)
{

View File

@ -108,7 +108,7 @@ $(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C

View File

@ -9,6 +9,7 @@
#include "fvMatrices.H"
#include "fvm.H"
#include "linear.H"
#include "uniformDimensionedFields.H"
#include "calculatedFvPatchFields.H"
#include "fixedValueFvPatchFields.H"
#include "adjustPhi.H"

View File

@ -1,15 +0,0 @@
Info << "\nReading environmentalProperties" << endl;
IOdictionary environmentalProperties
(
IOobject
(
"environmentalProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dimensionedVector g(environmentalProperties.lookup("g"));

View File

@ -0,0 +1,12 @@
Info << "\nReading g" << endl;
uniformDimensionedVectorField g
(
IOobject
(
"g",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

View File

@ -13,7 +13,3 @@
int nOuterCorr =
piso.lookupOrDefault<int>("nOuterCorrectors", 1);
bool ddtPhiCorr =
piso.lookupOrDefault<Switch>("ddtPhiCorr", false);

View File

@ -24,10 +24,11 @@ License
\*---------------------------------------------------------------------------*/
#include "fixedFluxBuoyantPressureFvPatchScalarField.H"
#include "buoyantPressureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -36,8 +37,8 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
fixedFluxBuoyantPressureFvPatchScalarField::
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField::
buoyantPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
@ -48,8 +49,8 @@ fixedFluxBuoyantPressureFvPatchScalarField
{}
fixedFluxBuoyantPressureFvPatchScalarField::
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField::
buoyantPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
@ -64,10 +65,10 @@ fixedFluxBuoyantPressureFvPatchScalarField
}
fixedFluxBuoyantPressureFvPatchScalarField::
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField::
buoyantPressureFvPatchScalarField
(
const fixedFluxBuoyantPressureFvPatchScalarField& ptf,
const buoyantPressureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
@ -78,10 +79,10 @@ fixedFluxBuoyantPressureFvPatchScalarField
{}
fixedFluxBuoyantPressureFvPatchScalarField::
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField::
buoyantPressureFvPatchScalarField
(
const fixedFluxBuoyantPressureFvPatchScalarField& ptf
const buoyantPressureFvPatchScalarField& ptf
)
:
fixedGradientFvPatchScalarField(ptf),
@ -89,10 +90,10 @@ fixedFluxBuoyantPressureFvPatchScalarField
{}
fixedFluxBuoyantPressureFvPatchScalarField::
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField::
buoyantPressureFvPatchScalarField
(
const fixedFluxBuoyantPressureFvPatchScalarField& ptf,
const buoyantPressureFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
@ -103,17 +104,15 @@ fixedFluxBuoyantPressureFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs()
void buoyantPressureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
dimensionedVector g(environmentalProperties.lookup("g"));
const uniformDimensionedVectorField& g =
db().lookupObject<uniformDimensionedVectorField>("g");
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
@ -134,7 +133,7 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs()
}
void fixedFluxBuoyantPressureFvPatchScalarField::write(Ostream& os) const
void buoyantPressureFvPatchScalarField::write(Ostream& os) const
{
fixedGradientFvPatchScalarField::write(os);
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
@ -147,7 +146,7 @@ void fixedFluxBuoyantPressureFvPatchScalarField::write(Ostream& os) const
makePatchTypeField
(
fvPatchScalarField,
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::fixedFluxBuoyantPressureFvPatchScalarField
Foam::buoyantPressureFvPatchScalarField
Description
Set the pressure gradient boundary condition appropriately for buoyant flow.
@ -32,12 +32,12 @@ Description
appropriately. Otherwise assume the variable is the static pressure.
SourceFiles
fixedFluxBuoyantPressureFvPatchScalarField.C
buoyantPressureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef fixedFluxBuoyantPressureFvPatchScalarFields_H
#define fixedFluxBuoyantPressureFvPatchScalarFields_H
#ifndef buoyantPressureFvPatchScalarFields_H
#define buoyantPressureFvPatchScalarFields_H
#include "fvPatchFields.H"
#include "fixedGradientFvPatchFields.H"
@ -48,10 +48,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedFluxBuoyantPressureFvPatch Declaration
Class buoyantPressureFvPatch Declaration
\*---------------------------------------------------------------------------*/
class fixedFluxBuoyantPressureFvPatchScalarField
class buoyantPressureFvPatchScalarField
:
public fixedGradientFvPatchScalarField
{
@ -64,20 +64,20 @@ class fixedFluxBuoyantPressureFvPatchScalarField
public:
//- Runtime type information
TypeName("fixedFluxBuoyantPressure");
TypeName("buoyantPressure");
// Constructors
//- Construct from patch and internal field
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
@ -85,19 +85,19 @@ public:
);
//- Construct by mapping given
// fixedFluxBuoyantPressureFvPatchScalarField onto a new patch
fixedFluxBuoyantPressureFvPatchScalarField
// buoyantPressureFvPatchScalarField onto a new patch
buoyantPressureFvPatchScalarField
(
const fixedFluxBuoyantPressureFvPatchScalarField&,
const buoyantPressureFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField
(
const fixedFluxBuoyantPressureFvPatchScalarField&
const buoyantPressureFvPatchScalarField&
);
//- Construct and return a clone
@ -105,14 +105,14 @@ public:
{
return tmp<fvPatchScalarField>
(
new fixedFluxBuoyantPressureFvPatchScalarField(*this)
new buoyantPressureFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
fixedFluxBuoyantPressureFvPatchScalarField
buoyantPressureFvPatchScalarField
(
const fixedFluxBuoyantPressureFvPatchScalarField&,
const buoyantPressureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
@ -124,7 +124,7 @@ public:
{
return tmp<fvPatchScalarField>
(
new fixedFluxBuoyantPressureFvPatchScalarField(*this, iF)
new buoyantPressureFvPatchScalarField(*this, iF)
);
}

View File

@ -29,7 +29,7 @@ License
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -126,10 +126,8 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::updateCoeffs()
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
dimensionedVector g(environmentalProperties.lookup("g"));
const uniformDimensionedVectorField& g =
db().lookupObject<uniformDimensionedVectorField>("g");
operator==
(

View File

@ -42,15 +42,12 @@ Foam::Cloud<ParticleType>::Cloud
)
:
cloud(pMesh),
IDLList<ParticleType>(particles),
IDLList<ParticleType>(),
polyMesh_(pMesh),
allFaces_(pMesh.faces()),
points_(pMesh.points()),
cellFaces_(pMesh.cells()),
allFaceCentres_(pMesh.faceCentres()),
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
{}
particleCount_(0)
{
IDLList<ParticleType>::operator=(particles);
}
template<class ParticleType>
@ -62,19 +59,31 @@ Foam::Cloud<ParticleType>::Cloud
)
:
cloud(pMesh, cloudName),
IDLList<ParticleType>(particles),
IDLList<ParticleType>(),
polyMesh_(pMesh),
allFaces_(pMesh.faces()),
points_(pMesh.points()),
cellFaces_(pMesh.cells()),
allFaceCentres_(pMesh.faceCentres()),
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
{}
particleCount_(0)
{
IDLList<ParticleType>::operator=(particles);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParticleType>
Foam::label Foam::Cloud<ParticleType>::getNewParticleID() const
{
label id = particleCount_++;
if (id == labelMax)
{
WarningIn("Cloud<ParticleType>::getNewParticleID() const")
<< "Particle counter has overflowed. This might cause problems"
<< " when reconstructing particle tracks." << endl;
}
return id;
}
template<class ParticleType>
void Foam::Cloud<ParticleType>::addParticle(ParticleType* pPtr)
{

View File

@ -50,6 +50,9 @@ namespace Foam
template<class ParticleType>
class Cloud;
template<class ParticleType>
class IOPosition;
template<class ParticleType>
Ostream& operator<<
(
@ -71,12 +74,9 @@ class Cloud
// Private data
const polyMesh& polyMesh_;
const faceList& allFaces_;
const vectorField& points_;
const cellList& cellFaces_;
const vectorField& allFaceCentres_;
const unallocLabelList& owner_;
const unallocLabelList& neighbour_;
//- Overall count of particles ever created. Never decreases.
mutable label particleCount_;
//- Temporary storage for addressing. Used in findFaces.
mutable DynamicList<label> labels_;
@ -92,6 +92,8 @@ public:
template<class ParticleT>
friend class Particle;
template<class ParticleT>
friend class IOPosition;
typedef ParticleType particleType;
@ -218,6 +220,9 @@ public:
return IDLList<ParticleType>::clear();
};
//- Get unique particle creation id
label getNewParticleID() const;
//- Transfer particle to cloud
void addParticle(ParticleType* pPtr);
@ -251,13 +256,15 @@ public:
const IOField<DataType>& data
) const;
//- Read the field data for the cloud of particles
void readFields();
//- Read the field data for the cloud of particles. Dummy at
// this level.
virtual void readFields();
// Write
//- Write the field data for the cloud of particles
//- Write the field data for the cloud of particles Dummy at
// this level.
virtual void writeFields() const;
//- Write using given format, version and compression.

View File

@ -67,12 +67,7 @@ Foam::Cloud<ParticleType>::Cloud
:
cloud(pMesh),
polyMesh_(pMesh),
allFaces_(pMesh.faces()),
points_(pMesh.points()),
cellFaces_(pMesh.cells()),
allFaceCentres_(pMesh.faceCentres()),
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
particleCount_(0)
{
initCloud(checkClass);
}
@ -88,12 +83,7 @@ Foam::Cloud<ParticleType>::Cloud
:
cloud(pMesh, cloudName),
polyMesh_(pMesh),
allFaces_(pMesh.faces()),
points_(pMesh.points()),
cellFaces_(pMesh.cells()),
allFaceCentres_(pMesh.faceCentres()),
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
particleCount_(0)
{
initCloud(checkClass);
}

View File

@ -34,6 +34,7 @@ Foam::word Foam::IOPosition<ParticleType>::particlePropertiesName
"particleProperties"
);
// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
template<class ParticleType>
@ -58,7 +59,7 @@ void Foam::IOPosition<ParticleType>::readParticleProperties()
if (propsDict.found(procName))
{
propsDict.subDict(procName).lookup("particleCount")
>> Particle<ParticleType>::particleCount;
>> cloud_.particleCount_;
}
}
}
@ -83,11 +84,7 @@ void Foam::IOPosition<ParticleType>::writeParticleProperties() const
word procName("processor" + Foam::name(Pstream::myProcNo()));
propsDict.add(procName, dictionary());
propsDict.subDict(procName).add
(
"particleCount",
Particle<ParticleType>::particleCount
);
propsDict.subDict(procName).add("particleCount", cloud_.particleCount_);
propsDict.regIOobject::write();
}
@ -135,13 +132,20 @@ bool Foam::IOPosition<ParticleType>::write() const
template<class ParticleType>
bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
{
// Write global cloud data
writeParticleProperties();
os<< cloud_.size() << nl << token::BEGIN_LIST << nl;
forAllConstIter(typename Cloud<ParticleType>, cloud_, iter)
{
os<< static_cast<const Particle<ParticleType>&>(iter()) << nl;
// Prevent writing additional fields
static_cast<const Particle<ParticleType>&>(iter()).write
(
os,
false
);
os << nl;
}
os<< token::END_LIST << endl;
@ -157,6 +161,7 @@ void Foam::IOPosition<ParticleType>::readData
bool checkClass
)
{
// Read global cloud data. Resets count on cloud.
readParticleProperties();
Istream& is = readStream(checkClass ? typeName : "");
@ -172,6 +177,7 @@ void Foam::IOPosition<ParticleType>::readData
for (label i=0; i<s; i++)
{
// Do not read any fields, position only
c.append(new ParticleType(c, is, false));
}
@ -202,6 +208,7 @@ void Foam::IOPosition<ParticleType>::readData
)
{
is.putBack(lastToken);
// Do not read any fields, position only
c.append(new ParticleType(c, is, false));
is >> lastToken;
}

View File

@ -26,7 +26,7 @@ Class
Foam::IOPosition
Description
Helper IO class to write particle positions
Helper IO class to read and write particle positions
SourceFiles
IOPosition.C
@ -72,7 +72,7 @@ public:
// Static data
//- Runtime type name information
//- Runtime type name information. Use cloud type.
virtual const word& type() const
{
return cloud_.type();
@ -90,11 +90,11 @@ public:
// Member functions
void readData(Cloud<ParticleType>& c, bool checkClass);
virtual void readData(Cloud<ParticleType>& c, bool checkClass);
bool write() const;
virtual bool write() const;
bool writeData(Ostream& os) const;
virtual bool writeData(Ostream& os) const;
};

View File

@ -33,12 +33,6 @@ License
#include "wallPolyPatch.H"
#include "transform.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class ParticleType>
Foam::label Foam::Particle<ParticleType>::particleCount = 0;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ParticleType>
@ -75,7 +69,7 @@ void Foam::Particle<ParticleType>::findFaces
DynamicList<label>& faceList
) const
{
const polyMesh& mesh = cloud_.mesh();
const polyMesh& mesh = cloud_.pMesh();
const labelList& faces = mesh.cells()[celli];
const vector& C = mesh.cellCentres()[celli];
@ -184,7 +178,7 @@ Foam::Particle<ParticleType>::Particle
facei_(-1),
stepFraction_(0.0),
origProc_(Pstream::myProcNo()),
origId_(particleCount++)
origId_(cloud_.getNewParticleID())
{}
@ -313,13 +307,13 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
// change cell
if (internalFace) // Internal face
{
if (celli_ == cloud_.owner_[facei_])
if (celli_ == mesh.faceOwner()[facei_])
{
celli_ = cloud_.neighbour_[facei_];
celli_ = mesh.faceNeighbour()[facei_];
}
else if (celli_ == cloud_.neighbour_[facei_])
else if (celli_ == mesh.faceNeighbour()[facei_])
{
celli_ = cloud_.owner_[facei_];
celli_ = mesh.faceOwner()[facei_];
}
else
{

View File

@ -279,9 +279,6 @@ public:
//- String representation of properties
static string propHeader;
//- Cumulative particle count used for particle id
static label particleCount;
// Constructors
@ -330,7 +327,15 @@ public:
autoPtr<ParticleType> operator()(Istream& is) const
{
return autoPtr<ParticleType>(new ParticleType(cloud_, is));
return autoPtr<ParticleType>
(
new ParticleType
(
cloud_,
is,
true
)
);
}
};
@ -454,9 +459,14 @@ public:
// I-O
//- Read the fields associated with the owner cloud
static void readFields(Cloud<ParticleType>& c);
//- Write the fields associated with the owner cloud
static void writeFields(const Cloud<ParticleType>& c);
//- Write the particle data
void write(Ostream& os, bool writeFields) const;
// Ostream Operator

View File

@ -50,23 +50,49 @@ Foam::Particle<ParticleType>::Particle
origProc_(Pstream::myProcNo()),
origId_(-1)
{
// readFields : read additional data. Should be consistent with writeFields.
if (is.format() == IOstream::ASCII)
{
is >> position_ >> celli_ >> origProc_ >> origId_;
is >> position_ >> celli_;
if (readFields)
{
is >> origProc_ >> origId_;
}
else
{
origId_ = cloud_.getNewParticleID();
}
}
else
{
// In binary read all particle data - needed for parallel transfer
is.read
(
reinterpret_cast<char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
+ sizeof(origProc_)
+ sizeof(origId_)
);
if (readFields)
{
is.read
(
reinterpret_cast<char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
+ sizeof(origProc_)
+ sizeof(origId_)
);
}
else
{
is.read
(
reinterpret_cast<char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
);
origId_ = cloud_.getNewParticleID();
}
}
if (celli_ == -1)
@ -79,6 +105,39 @@ Foam::Particle<ParticleType>::Particle
}
template<class ParticleType>
void Foam::Particle<ParticleType>::readFields
(
Cloud<ParticleType>& c
)
{
if (!c.size())
{
return;
}
IOobject procIO(c.fieldIOobject("origProcId", IOobject::MUST_READ));
if (procIO.headerOk())
{
IOField<label> origProcId(procIO);
c.checkFieldIOobject(c, origProcId);
IOField<label> origId(c.fieldIOobject("origId", IOobject::MUST_READ));
c.checkFieldIOobject(c, origId);
label i = 0;
forAllIter(typename Cloud<ParticleType>, c, iter)
{
ParticleType& p = iter();
p.origProc_ = origProcId[i];
p.origId_ = origId[i];
i++;
}
}
}
template<class ParticleType>
void Foam::Particle<ParticleType>::writeFields
(
@ -88,36 +147,91 @@ void Foam::Particle<ParticleType>::writeFields
// Write the cloud position file
IOPosition<ParticleType> ioP(c);
ioP.write();
label np = c.size();
IOField<label> origProc
(
c.fieldIOobject
(
"origProcId",
IOobject::NO_READ
),
np
);
IOField<label> origId(c.fieldIOobject("origId", IOobject::NO_READ), np);
label i = 0;
forAllConstIter(typename Cloud<ParticleType>, c, iter)
{
origProc[i] = iter().origProc_;
origId[i] = iter().origId_;
i++;
}
origProc.write();
origId.write();
}
template<class ParticleType>
void Foam::Particle<ParticleType>::write(Ostream& os, bool writeFields) const
{
if (os.format() == IOstream::ASCII)
{
if (writeFields)
{
// Write the additional entries
os << position_
<< token::SPACE << celli_
<< token::SPACE << origProc_
<< token::SPACE << origId_;
}
else
{
os << position_
<< token::SPACE << celli_;
}
}
else
{
// In binary write both celli_ and facei_, needed for parallel transfer
if (writeFields)
{
os.write
(
reinterpret_cast<const char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
+ sizeof(origProc_)
+ sizeof(origId_)
);
}
else
{
os.write
(
reinterpret_cast<const char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
);
}
}
// Check state of Ostream
os.check("Particle<ParticleType>::write(Ostream& os, bool) const");
}
template<class ParticleType>
Foam::Ostream& Foam::operator<<(Ostream& os, const Particle<ParticleType>& p)
{
if (os.format() == IOstream::ASCII)
{
os << p.position_
<< token::SPACE << p.celli_
<< token::SPACE << p.origProc_
<< token::SPACE << p.origId_;
}
else
{
// In binary write both celli_ and facei_, needed for parallel transfer
os.write
(
reinterpret_cast<const char*>(&p.position_),
sizeof(p.position_)
+ sizeof(p.celli_)
+ sizeof(p.facei_)
+ sizeof(p.stepFraction_)
+ sizeof(p.origProc_)
+ sizeof(p.origId_)
);
}
// Check state of Ostream
os.check("Ostream& operator<<(Ostream&, const Particle<ParticleType>&)");
// Write all data
p.write(os, true);
return os;
}

View File

@ -84,7 +84,7 @@ public:
bool readFields = true
)
:
Particle<indexedParticle>(c, is)
Particle<indexedParticle>(c, is, readFields)
{}
//- Construct as a copy

View File

@ -22,12 +22,9 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "indexedParticle.H"
#include "Cloud.H"
#include "indexedParticleCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,4 +40,25 @@ defineTemplateTypeNameAndDebug(Cloud<indexedParticle>, 0);
} // End namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::indexedParticleCloud::indexedParticleCloud
(
const polyMesh& mesh,
const word& cloudName
)
:
Cloud<indexedParticle>(mesh, cloudName, false)
{
indexedParticle::readFields(*this);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::indexedParticleCloud::writeFields() const
{
indexedParticle::writeFields(*this);
}
// ************************************************************************* //

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Class
Foam::indexedParticleCloud
Description
A Cloud of particles carrying an additional index.
SourceFiles
indexedParticleCloud.C
\*---------------------------------------------------------------------------*/
#ifndef indexedParticleCloud_H
#define indexedParticleCloud_H
#include "Cloud.H"
#include "indexedParticle.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class indexedParticleCloud Declaration
\*---------------------------------------------------------------------------*/
class indexedParticleCloud
:
public Cloud<indexedParticle>
{
// Private Member Functions
//- Disallow default bitwise copy construct
indexedParticleCloud(const indexedParticleCloud&);
//- Disallow default bitwise assignment
void operator=(const indexedParticleCloud&);
public:
// Constructors
//- Construct given mesh
indexedParticleCloud
(
const polyMesh&,
const word& cloudName = "defaultCloud"
);
// Member Functions
//- Write fields
virtual void writeFields() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -28,9 +28,6 @@ Class
Description
SourceFiles
passiveParticleI.H
passiveParticle.C
passiveParticleIO.C
\*---------------------------------------------------------------------------*/
@ -78,7 +75,7 @@ public:
bool readFields = true
)
:
Particle<passiveParticle>(c, is)
Particle<passiveParticle>(c, is, readFields)
{}
//- Construct as copy

View File

@ -22,12 +22,9 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "passiveParticle.H"
#include "Cloud.H"
#include "passiveParticleCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,8 +36,34 @@ namespace Foam
defineParticleTypeNameAndDebug(passiveParticle, 0);
defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::passiveParticleCloud::passiveParticleCloud
(
const polyMesh& mesh,
const word& cloudName
)
:
Cloud<passiveParticle>(mesh, cloudName, false)
{
readFields();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::passiveParticleCloud::readFields()
{
passiveParticle::readFields(*this);
}
void Foam::passiveParticleCloud::writeFields() const
{
passiveParticle::writeFields(*this);
}
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Class
Foam::passiveParticleCloud
Description
A Cloud of passive particles
SourceFiles
passiveParticleCloud.C
\*---------------------------------------------------------------------------*/
#ifndef passiveParticleCloud_H
#define passiveParticleCloud_H
#include "Cloud.H"
#include "passiveParticle.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class passiveParticleCloud Declaration
\*---------------------------------------------------------------------------*/
class passiveParticleCloud
:
public Cloud<passiveParticle>
{
// Private Member Functions
//- Disallow default bitwise copy construct
passiveParticleCloud(const passiveParticleCloud&);
//- Disallow default bitwise assignment
void operator=(const passiveParticleCloud&);
public:
// Constructors
//- Construct given mesh
passiveParticleCloud
(
const polyMesh&,
const word& cloudName = "defaultCloud"
);
// Member Functions
//- Read fields
virtual void readFields();
//- Write fields
virtual void writeFields() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -87,7 +87,7 @@ public:
// Member Functions
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

0
src/lagrangian/coalCombustion/Make/files Executable file → Normal file
View File

0
src/lagrangian/coalCombustion/Make/options Executable file → Normal file
View File

View File

@ -36,7 +36,7 @@ Foam::parcel::parcel
bool readFields
)
:
Particle<parcel>(cloud, is),
Particle<parcel>(cloud, is, readFields),
liquidComponents_
(

View File

@ -59,7 +59,7 @@ Foam::spray::spray
const basicMultiComponentMixture& composition,
const PtrList<gasThermoPhysics>& gasProperties,
const dictionary&,
const dictionary& environmentalProperties
const dimensionedVector& g
)
:
Cloud<parcel>(U.mesh(), false), // suppress className checking on positions
@ -181,7 +181,7 @@ Foam::spray::spray
),
subCycles_(readLabel(sprayProperties_.lookup("subCycles"))),
g_(dimensionedVector(environmentalProperties.lookup("g")).value()),
g_(g.value()),
gasProperties_(gasProperties),
composition_(composition),
@ -266,7 +266,7 @@ Foam::spray::spray
"const volScalarField& T, const combustionMixture& composition,"
"const PtrList<gasThermoPhsyics>& gaseousFuelProperties, "
"const dictionary& thermophysicalProperties, "
"const dictionary& environmentalProperties)"
"const dimensionedScalar& g)"
) << "spray::(...) only one wedgePolyPatch found. "
"Please check you BC-setup."
<< abort(FatalError);

View File

@ -122,7 +122,7 @@ class spray
//- Acceleration due to gravity
vector g_;
const vector& g_;
// Composition properties
@ -195,7 +195,7 @@ public:
const basicMultiComponentMixture& composition,
const PtrList<gasThermoPhysics>& gasProperties,
const dictionary& thermophysicalProperties,
const dictionary& environmentalProperties
const dimensionedVector& g
);
@ -345,7 +345,7 @@ public:
// I/O
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};

View File

@ -1,211 +0,0 @@
// The FOAM Project // File: reflectParcel.C
/*
-------------------------------------------------------------------------------
========= | Class Implementation
\\ / |
\\ / | Name: reflectParcel
\\ / | Family: wallModel
\\/ |
F ield | FOAM version: 2.3
O peration |
A and | Copyright (C) 1991-2009 OpenCFD Ltd.
M anipulation | All Rights Reserved.
-------------------------------------------------------------------------------
DESCRIPTION
AUTHOR
Henry G Weller.
-------------------------------------------------------------------------------
*/
#include "reflectParcel.H"
#include "addToRunTimeSelectionTable.H"
#include "wallPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(reflectParcel, 0);
addToRunTimeSelectionTable
(
wallModel,
reflectParcel,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
reflectParcel::reflectParcel
(
const dictionary& dict,
const fvMesh& mesh,
spray& sm
)
:
wallModel(dict, mesh, sm),
coeffsDict_(dict.subDict(typeName + "Coeffs")),
elasticity_(readScalar(coeffsDict_.lookup("elasticity")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
reflectParcel::~reflectParcel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Return 'keepParcel'
bool reflectParcel::wallTreatment
(
parcel& p
) const
{
label patchi = p.patch();
label facei = p.patchFace(patchi);
const polyMesh& mesh = spray_.mesh();
if (typeid(mesh_.boundaryMesh()[patchi]) == typeid(wallPolyPatch))
{
// wallNormal defined to point outwards of domain
vector Sf = mesh_.Sf().boundaryField()[patchi][facei];
Sf /= mag(Sf);
// adjust velocity when wall is moving
if (!mesh.moving())
{
scalar Un = p.U() & Sf;
if (Un > 0)
{
p.U() -= (1.0 + elasticity_)*Un*Sf;
}
}
else
{
label facep = p.face();
scalar dt = spray_.runTime().deltaT().value();
scalar fraction = p.t0()/dt;
const vectorField& oldPoints = mesh.oldPoints();
const vector& Cf1 = mesh.faceCentres()[facep];
vector Cf0 = mesh.faces()[facep].centre(oldPoints);
vector Cf = Cf0 + fraction*(Cf1 - Cf0);
vector Sf0 = mesh.faces()[facep].normal(oldPoints);
Sf0 /= mag(Sf0);
scalar magSfDiff = mag(Sf - Sf0);
if (magSfDiff > SMALL)
{
bool pureRotation = false;
if (pureRotation)
{
// rotation
// find center of rotation
vector omega = Sf0 ^ Sf;
scalar magOmega = mag(omega);
omega /= magOmega+SMALL;
vector n0 = omega ^ Sf0;
scalar lam = ((Cf1 - Cf0) & Sf)/(n0 & Sf);
vector r0 = Cf0 + lam*n0;
scalar phiVel = ::asin(magOmega)/dt;
vector pos = p.position() - r0;
vector v = phiVel*(omega ^ pos);
vector Sfp = Sf0 + fraction*(Sf - Sf0);
//vector Sfp = Sf;
vector Ur = p.U() - v;
scalar Urn = Ur & Sfp;
/*
scalar dd = (p.position() - r0) & Sfp;
Info << "Urn = " << Urn
<< ", dd = " << dd
<< ", pos = " << p.position()
<< ", Sfp = " << Sfp
<< ", omega = " << omega
<< ", r0 = " << r0
<< endl;
*/
if (Urn > 0.0)
{
p.U() -= (1.0 + elasticity_)*Urn*Sfp;
}
}
else
{
vector Sfp = Sf0 + fraction*(Sf - Sf0);
//vector Sfp = Sf;
vector omega = Sf0 ^ Sf;
scalar magOmega = mag(omega);
omega /= magOmega+SMALL;
scalar phiVel = ::asin(magOmega)/dt;
scalar dist = (p.position() - Cf) & Sfp;
vector pos = p.position() - dist*Sfp;
vector vrot = phiVel*(omega ^ (pos - Cf));
vector vtrans = (Cf1 - Cf0)/dt;
vector v = vtrans + vrot;
scalar Un = ((p.U() - v) & Sfp);
if (Un > 0.0)
{
p.U() -= (1.0 + elasticity_)*Un*Sfp;
}
}
}
else
{
// translation
vector v = (Cf1 - Cf0)/dt;
vector Ur = p.U() - v;
scalar Urn = Ur & Sf;
if (Urn > 0.0)
{
Ur -= (1.0 + elasticity_)*Urn*Sf;
p.U() = Ur + v;
}
}
}
}
else
{
FatalError
<< "bool reflectParcel::wallTreatment(parcel& parcel) const "
<< " parcel has hit a boundary "
<< mesh_.boundary()[patchi].type()
<< " which not yet has been implemented."
<< abort(FatalError);
}
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -299,7 +299,7 @@ void Foam::DsmcCloud<ParcelType>::collisions()
// Temporary storage for subCells
List<DynamicList<label> > subCells(8);
scalar deltaT = mesh_.time().deltaT().value();
scalar deltaT = cachedDeltaT();
label collisionCandidates = 0;
@ -778,6 +778,9 @@ Foam::DsmcCloud<ParcelType>::~DsmcCloud()
template<class ParcelType>
void Foam::DsmcCloud<ParcelType>::evolve()
{
// cache the value of deltaT for this timestep
storeDeltaT();
typename ParcelType::trackData td(*this);
// Reset the surface data collection fields

View File

@ -116,6 +116,10 @@ class DsmcCloud
//- Random number generator
Random rndGen_;
//- In-cloud cache of deltaT, lookup in submodels and parcel is
// expensive
scalar cachedDeltaT_;
// References to the macroscopic fields
@ -243,6 +247,12 @@ public:
//- Return refernce to the random object
inline Random& rndGen();
//- Store (cache) the current value of deltaT
inline void storeDeltaT();
//- Return the cached value of deltaT
inline scalar cachedDeltaT() const;
// References to the surface data collection fields

View File

@ -120,6 +120,20 @@ inline Foam::Random& Foam::DsmcCloud<ParcelType>::rndGen()
}
template<class ParcelType>
inline void Foam::DsmcCloud<ParcelType>::storeDeltaT()
{
cachedDeltaT_ = mesh().time().deltaT().value();
}
template<class ParcelType>
inline Foam::scalar Foam::DsmcCloud<ParcelType>::cachedDeltaT() const
{
return cachedDeltaT_;
}
template<class ParcelType>
inline const Foam::volScalarField& Foam::DsmcCloud<ParcelType>::q() const
{

View File

@ -91,7 +91,7 @@ public:
// Member functions
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -44,7 +44,7 @@ bool Foam::DsmcParcel<ParcelType>::move
const polyMesh& mesh = td.cloud().pMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const scalar deltaT = mesh.time().deltaT().value();
const scalar deltaT = td.cloud().cachedDeltaT();
scalar tEnd = (1.0 - p.stepFraction())*deltaT;
const scalar dtMax = tEnd;
@ -145,7 +145,7 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch
const scalar fA = mag(wpp.faceAreas()[wppLocalFace]);
const scalar deltaT = td.cloud().mesh().time().deltaT().value();
const scalar deltaT = td.cloud().cachedDeltaT();
scalar deltaQ = td.cloud().nParticle()*(preIE - postIE)/(deltaT*fA);

View File

@ -126,7 +126,7 @@ void Foam::FreeStream<CloudType>::inflow()
const polyMesh& mesh(cloud.mesh());
const scalar deltaT = mesh.time().deltaT().value();
const scalar deltaT = cloud.cachedDeltaT();
Random& rndGen(cloud.rndGen());

View File

@ -59,6 +59,7 @@ submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C
/* data entries */
submodels/IO/DataEntry/makeDataEntries.C
submodels/IO/DataEntry/polynomial/polynomial.C
submodels/IO/DataEntry/polynomial/polynomialIO.C
/* integration schemes */

View File

@ -177,6 +177,7 @@ template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::preEvolve()
{
this->dispersion().cacheFields(true);
forces_.cacheFields(true);
}
@ -189,6 +190,7 @@ void Foam::KinematicCloud<ParcelType>::postEvolve()
}
this->dispersion().cacheFields(false);
forces_.cacheFields(false);
this->postProcessing().post();
}

View File

@ -274,18 +274,6 @@ public:
inline const dictionary& interpolationSchemes() const;
// Forces to include in particle motion evaluation
//- Return reference to the gravity force flag
inline Switch forceGravity() const;
//- Return reference to the virtual mass force flag
inline Switch forceVirtualMass() const;
//- Return reference to the pressure gradient force flag
inline Switch forcePressureGradient() const;
// Sub-models
//- Return const-access to the dispersion model

View File

@ -92,7 +92,7 @@ public:
// Member Functions
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};

View File

@ -92,7 +92,7 @@ public:
// Member Functions
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};

View File

@ -87,7 +87,7 @@ public:
// Member functions
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -90,7 +90,7 @@ public:
// Member Functions
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};

View File

@ -27,6 +27,7 @@ License
#include "particleForces.H"
#include "fvMesh.H"
#include "volFields.H"
#include "fvcGrad.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -40,21 +41,17 @@ Foam::particleForces::particleForces
mesh_(mesh),
dict_(dict.subDict("particleForces")),
g_(g),
gradUPtr_(NULL),
gravity_(dict_.lookup("gravity")),
virtualMass_(dict_.lookup("virtualMass")),
Cvm_(0.0),
pressureGradient_(dict_.lookup("pressureGradient")),
gradUName_("unknown_gradUName")
UName_(dict_.lookupOrDefault<word>("U", "U"))
{
if (gravity_)
if (virtualMass_)
{
dict_.lookup("Cvm") >> Cvm_;
}
if (pressureGradient_)
{
dict_.lookup("gradU") >> gradUName_;
}
}
@ -63,18 +60,21 @@ Foam::particleForces::particleForces(const particleForces& f)
mesh_(f.mesh_),
dict_(f.dict_),
g_(f.g_),
gradUPtr_(f.gradUPtr_),
gravity_(f.gravity_),
virtualMass_(f.virtualMass_),
Cvm_(f.Cvm_),
pressureGradient_(f.pressureGradient_),
gradUName_(f.gradUName_)
UName_(f.UName_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::particleForces::~particleForces()
{}
{
cacheFields(false);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -109,9 +109,26 @@ Foam::Switch Foam::particleForces::pressureGradient() const
}
const Foam::word& Foam::particleForces::gradUName() const
const Foam::word& Foam::particleForces::UName() const
{
return gradUName_;
return UName_;
}
void Foam::particleForces::cacheFields(const bool store)
{
if (store && pressureGradient_)
{
const volVectorField U = mesh_.lookupObject<volVectorField>(UName_);
gradUPtr_ = fvc::grad(U).ptr();
}
else
{
if (gradUPtr_)
{
delete gradUPtr_;
}
}
}
@ -130,15 +147,17 @@ Foam::vector Foam::particleForces::calcCoupled
// Virtual mass force
if (virtualMass_)
{
notImplemented("Foam::particleForces::calc(...) - virtualMass force");
notImplemented
(
"Foam::particleForces::calcCoupled(...) - virtual mass force"
);
// Ftot += Cvm_*rhoc/rho*d(Uc - U)/dt;
}
// Pressure gradient force
if (pressureGradient_)
{
const volSymmTensorField& gradU =
mesh_.lookupObject<volSymmTensorField>(gradUName_);
const volTensorField& gradU = *gradUPtr_;
Ftot += rhoc/rho*(U & gradU[cellI]);
}

View File

@ -39,6 +39,7 @@ SourceFiles
#include "dictionary.H"
#include "Switch.H"
#include "vector.H"
#include "volFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,6 +66,9 @@ class particleForces
//- Gravity
const vector g_;
//- Velocity gradient field
const volTensorField* gradUPtr_;
// Forces to include in particle motion evaluation
@ -80,8 +84,11 @@ class particleForces
//- Pressure gradient
Switch pressureGradient_;
//- Name of velocity gradient field for pressure gradient force
word gradUName_;
// Additional info
//- Name of velucity field - default = "U"
const word UName_;
public:
@ -126,12 +133,15 @@ public:
//- Return pressure gradient force activate switch
Switch pressureGradient() const;
//- Return the name of the velocity gradient field
const word& gradUName() const;
//- Return name of velocity field
const word& UName() const;
// Evaluation
//- Cache carrier fields
void cacheFields(const bool store);
//- Calculate action/reaction forces between carrier and particles
vector calcCoupled
(

View File

@ -233,7 +233,8 @@ void Foam::InjectionModel<CloudType>::postInjectCheck(const label parcelsAdded)
{
if (parcelsAdded > 0)
{
Pout<< "\n--> Cloud: " << owner_.name() << nl
Pout<< nl
<< "--> Cloud: " << owner_.name() << nl
<< " Added " << parcelsAdded
<< " new parcels" << nl << endl;
}

0
src/lagrangian/molecularDynamics/molecule/Make/files Executable file → Normal file
View File

0
src/lagrangian/molecularDynamics/molecule/Make/options Executable file → Normal file
View File

View File

@ -507,7 +507,7 @@ void Foam::moleculeCloud::initialiseMolecules
else
{
const dictionary& zoneDict =
mdInitialiseDict.subDict(zone.name());
mdInitialiseDict.subDict(zone.name());
const scalar temperature
(
@ -530,7 +530,7 @@ void Foam::moleculeCloud::initialiseMolecules
{
FatalErrorIn("Foam::moleculeCloud::initialiseMolecules")
<< "latticeIds and latticePositions must be the same "
<< " size." << nl
<< " size." << nl
<< abort(FatalError);
}
@ -548,6 +548,15 @@ void Foam::moleculeCloud::initialiseMolecules
zoneDict.lookup("numberDensity")
);
if (numberDensity < VSMALL)
{
WarningIn("moleculeCloud::initialiseMolecules")
<< "numberDensity too small, not filling zone "
<< zone.name() << endl;
continue;
}
latticeCellScale = pow
(
latticeIds.size()/(det(latticeCellShape)*numberDensity),
@ -572,9 +581,19 @@ void Foam::moleculeCloud::initialiseMolecules
zoneDict.lookup("massDensity")
);
if (massDensity < VSMALL)
{
WarningIn("moleculeCloud::initialiseMolecules")
<< "massDensity too small, not filling zone "
<< zone.name() << endl;
continue;
}
latticeCellScale = pow
(
unitCellMass /(det(latticeCellShape)*massDensity),
unitCellMass/(det(latticeCellShape)*massDensity),
(1.0/3.0)
);
}
@ -906,7 +925,7 @@ void Foam::moleculeCloud::initialiseMolecules
)
{
WarningIn("Foam::moleculeCloud::initialiseMolecules()")
<< "A whole layer of unit cells was placed "
<< "A whole layer of unit cells was placed "
<< "outside the bounds of the mesh, but no "
<< "molecules have been placed in zone '"
<< zone.name()

View File

@ -108,10 +108,10 @@ public:
void move(const dimensionedVector& g);
// I-O
// Write
//- Write fields
void writeFields() const;
virtual void writeFields() const;
};

View File

@ -127,11 +127,11 @@ void Foam::staticPressure::write()
{
const volScalarField& p = obr_.lookupObject<volScalarField>(pName_);
volScalarField pDyn
volScalarField pStatic
(
IOobject
(
"pDyn",
"pStatic",
obr_.time().timeName(),
obr_,
IOobject::NO_READ
@ -139,7 +139,7 @@ void Foam::staticPressure::write()
dimensionedScalar("rho", dimDensity, rho_)*p
);
pDyn.write();
pStatic.write();
}
}

View File

@ -0,0 +1,4 @@
faceZoneIntegration/faceZonesIntegration.C
faceZoneIntegration/faceZonesIntegrationFunctionObject.C
LIB = $(FOAM_LIBBIN)/libzoneFunctionObjects

View File

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
Typedef
Foam::IOfaceZonesIntegration
Description
Instance of the generic IOOutputFilter for faceZonesIntegration.
\*---------------------------------------------------------------------------*/
#ifndef IOfaceZonesIntegration_H
#define IOfaceZonesIntegration_H
#include "faceZonesIntegration.H"
#include "IOOutputFilter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOOutputFilter<faceZonesIntegration> IOfaceZonesIntegration;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,322 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
\*---------------------------------------------------------------------------*/
#include "faceZonesIntegration.H"
#include "volFields.H"
#include "dictionary.H"
#include "Time.H"
#include "IOmanip.H"
#include "ListListOps.H"
#include "processorPolyPatch.H"
#include "cyclicPolyPatch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(faceZonesIntegration, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::faceZonesIntegration::faceZonesIntegration
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
:
name_(name),
obr_(obr),
active_(true),
log_(false),
faceZonesSet_(),
fItems_(),
faceZonesIntegrationFilePtr_(NULL)
{
// Check if the available mesh is an fvMesh otherise deactivate
if (!isA<fvMesh>(obr_))
{
active_ = false;
WarningIn
(
"Foam::faceZonesIntegration::faceZonesIntegration"
"("
"const word&, "
"const objectRegistry&, "
"const dictionary&, "
"const bool"
")"
) << "No fvMesh available, deactivating."
<< endl;
}
read(dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::faceZonesIntegration::~faceZonesIntegration()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::faceZonesIntegration::read(const dictionary& dict)
{
if (active_)
{
log_ = dict.lookupOrDefault<Switch>("log", false);
dict.lookup("fields") >> fItems_;
dict.lookup("faceZones") >> faceZonesSet_;
}
}
void Foam::faceZonesIntegration::makeFile()
{
// Create the face Zone file if not already created
if (faceZonesIntegrationFilePtr_.empty())
{
if (debug)
{
Info<< "Creating faceZonesIntegration file." << endl;
}
// File update
if (Pstream::master())
{
fileName faceZonesIntegrationDir;
if (Pstream::parRun())
{
// Put in undecomposed case (Note: gives problems for
// distributed data running)
faceZonesIntegrationDir =
obr_.time().path()/".."/name_/obr_.time().timeName();
}
else
{
faceZonesIntegrationDir =
obr_.time().path()/name_/obr_.time().timeName();
}
// Create directory if does not exist.
mkDir(faceZonesIntegrationDir);
// Open new file at start up
faceZonesIntegrationFilePtr_.resize(fItems_.size());
forAll(fItems_, Ifields)
{
const word& fieldName = fItems_[Ifields];
OFstream* sPtr = new OFstream
(
faceZonesIntegrationDir/fieldName
);
faceZonesIntegrationFilePtr_.insert(fieldName, sPtr);
}
// Add headers to output data
writeFileHeader();
}
}
}
void Foam::faceZonesIntegration::writeFileHeader()
{
forAllIter(HashPtrTable<OFstream>, faceZonesIntegrationFilePtr_, iter)
{
unsigned int w = IOstream::defaultPrecision() + 7;
OFstream& os = *faceZonesIntegrationFilePtr_[iter.key()];
os << "#Time " << setw(w);
forAll (faceZonesSet_, zoneI)
{
const word name = faceZonesSet_[zoneI];
os << name << setw(w);
}
os << nl << endl;
}
}
void Foam::faceZonesIntegration::execute()
{
// Do nothing - only valid on write
}
void Foam::faceZonesIntegration::end()
{
// Do nothing - only valid on write
}
void Foam::faceZonesIntegration::write()
{
if (active_)
{
makeFile();
scalar dm = 0.0;
forAll(fItems_, fieldI)
{
const word& fieldName = fItems_[fieldI];
const surfaceScalarField& fD =
obr_.lookupObject<surfaceScalarField>(fieldName);
const fvMesh& mesh = fD.mesh();
unsigned int w = IOstream::defaultPrecision() + 7;
if
(
Pstream::master()
&& faceZonesIntegrationFilePtr_.found(fieldName)
)
{
OFstream& os = *faceZonesIntegrationFilePtr_(fieldName);
os << obr_.time().value();
const faceZoneMesh& faceZoneList = mesh.faceZones();
forAll(faceZonesSet_, zoneI)
{
const word name = faceZonesSet_[zoneI];
label zoneID = faceZoneList.findZoneID(name);
const faceZone& fz = mesh.faceZones()[zoneID];
dm = calcFaceZonesIntegral(fD, fz);
reduce(dm, sumOp<scalar>());
os << ' ' << setw(w) << dm;
if (log_)
{
Info<< "faceZonesIntegration output:" << nl
<< " Integration" << dm << endl;
}
}
os << endl;
}
}
}
}
Foam::scalar Foam::faceZonesIntegration::calcFaceZonesIntegral
(
const surfaceScalarField& fD,
const faceZone& fz
) const
{
scalar dm = 0.0;
const fvMesh& mesh = fD.mesh();
forAll (fz, i)
{
label faceI = fz[i];
if (mesh.isInternalFace(faceI))
{
if (fz.flipMap()[faceI])
{
dm -= fD[faceI];
}
else
{
dm += fD[faceI];
}
}
else
{
label patchI = mesh.boundaryMesh().whichPatch(faceI);
const polyPatch& pp = mesh.boundaryMesh()[patchI];
if (isA<processorPolyPatch>(pp))
{
if (refCast<const processorPolyPatch>(pp).owner())
{
if (fz.flipMap()[faceI])
{
dm -= fD.boundaryField()[patchI][pp.whichFace(faceI)];
}
else
{
dm += fD.boundaryField()[patchI][pp.whichFace(faceI)];
}
}
}
else if (isA<cyclicPolyPatch>(pp))
{
label patchFaceI = faceI - pp.start();
if (patchFaceI < pp.size()/2)
{
if (fz.flipMap()[patchFaceI])
{
dm -= fD.boundaryField()[patchI][patchFaceI];
}
else
{
dm += fD.boundaryField()[patchI][patchFaceI];
}
}
}
else if (!isA<emptyPolyPatch>(pp))
{
label patchFaceI = faceI - pp.start();
if (fz.flipMap()[patchFaceI])
{
dm -= fD.boundaryField()[patchI][patchFaceI];
}
else
{
dm += fD.boundaryField()[patchI][patchFaceI];
}
}
}
}
return dm;
}
// ************************************************************************* //

View File

@ -0,0 +1,178 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
Class
Foam::faceZonesIntegration
Description
Integrates surfaceScalarFields on faceZones
SourceFiles
faceZonesIntegration.C
IOfaceZonesIntegration.H
\*---------------------------------------------------------------------------*/
#ifndef faceZonesIntegration_H
#define faceZonesIntegration_H
#include "fvCFD.H"
#include "primitiveFieldsFwd.H"
#include "volFieldsFwd.H"
#include "HashPtrTable.H"
#include "OFstream.H"
#include "Switch.H"
#include "pointFieldFwd.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class objectRegistry;
class dictionary;
class mapPolyMesh;
/*---------------------------------------------------------------------------*\
Class faceZonesIntegration Declaration
\*---------------------------------------------------------------------------*/
class faceZonesIntegration
{
protected:
// Private data
//- Name of this set of face zone integration,
// Also used as the name of the probes directory.
word name_;
const objectRegistry& obr_;
//- on/off switch
bool active_;
//- Switch to send output to Info as well as to file
Switch log_;
//- Current open files
HashPtrTable<OFstream> faceZonesIntegrationFilePtr_;
// Read from dictionary
//- faceZones to integrate over
wordList faceZonesSet_;
//- Names of the surface fields
wordList fItems_;
// Private Member Functions
//- If the integration file has not been created create it
void makeFile();
scalar calcFaceZonesIntegral
(
const surfaceScalarField& fD,
const faceZone& fz
) const;
//- Disallow default bitwise copy construct
faceZonesIntegration(const faceZonesIntegration&);
//- Disallow default bitwise assignment
void operator=(const faceZonesIntegration&);
//- Output file header information
virtual void writeFileHeader();
public:
//- Runtime type information
TypeName("faceZonesIntegration");
// Constructors
//- Construct for given objectRegistry and dictionary.
// Allow the possibility to load fields from files
faceZonesIntegration
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
// Destructor
virtual ~faceZonesIntegration();
// Member Functions
//- Return name of the set of zones
virtual const word& name() const
{
return name_;
};
//- Read the zone integration data
virtual void read(const dictionary&);
//- Execute, currently does nothing
virtual void execute();
//- Execute at the final time-loop, currently does nothing
virtual void end();
//- Write the integration
virtual void write();
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh&)
{}
//- Update for changes of mesh
virtual void movePoints(const pointField&)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
\*---------------------------------------------------------------------------*/
#include "faceZonesIntegrationFunctionObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineNamedTemplateTypeNameAndDebug(faceZonesIntegrationFunctionObject, 0);
addToRunTimeSelectionTable
(
functionObject,
faceZonesIntegrationFunctionObject,
dictionary
);
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
Typedef
Foam::faceZonesIntegrationFunctionObject
Description
FunctionObject wrapper around faceZonesIntegration to allow them to be
created via the functions list within controlDict.
SourceFiles
faceZonesIntegrationFunctionObject.C
\*---------------------------------------------------------------------------*/
#ifndef faceZonesIntegrationFunctionObject_H
#define faceZonesIntegrationFunctionObject_H
#include "faceZonesIntegration.H"
#include "OutputFilterFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef OutputFilterFunctionObject<faceZonesIntegration>
faceZonesIntegrationFunctionObject;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -175,9 +175,8 @@ public:
);
// Destructor
virtual ~probes();
//- Destructor
virtual ~probes();
// Member Functions
@ -188,6 +187,18 @@ public:
return name_;
}
//- Return names of fields to probe
virtual const wordList& fieldNames() const
{
return fieldNames_;
}
//- Return locations to probe
virtual const vectorField& probeLocations() const
{
return probeLocations_;
}
//- Cells to be probed (obtained from the locations)
const labelList& cells() const
{

View File

@ -87,13 +87,13 @@ public:
// Member functions
//- Return the compostion of the combustion mixture
//- Return the compostion of the mixture
virtual basicMixture& composition()
{
return *this;
}
//- Return the compostion of the combustion mixture
//- Return the compostion of the mixture
virtual const basicMixture& composition() const
{
return *this;

View File

@ -87,13 +87,13 @@ public:
// Member functions
//- Return the compostion of the combustion mixture
//- Return the compostion of the mixture
virtual basicMixture& composition()
{
return *this;
}
//- Return the compostion of the combustion mixture
//- Return the compostion of the mixture
virtual const basicMixture& composition() const
{
return *this;

View File

@ -246,11 +246,9 @@ Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::omega
{
pr *= pow(cr, exp - 1.0);
}
}
return pf*cf - pr*cr;
}
@ -468,10 +466,27 @@ Foam::ODEChemistryModel<CompType, ThermoType>::tc() const
this->thermo().rho()
);
label nCells = rho.size();
label nReaction = reactions_.size();
tmp<volScalarField> tsource
(
new volScalarField
(
IOobject
(
"tc",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar("zero", dimTime, SMALL),
zeroGradientFvPatchScalarField::typeName
)
);
scalarField t(nCells, SMALL);
scalarField& t = tsource();
label nReaction = reactions_.size();
if (this->chemistry_)
{
@ -509,25 +524,7 @@ Foam::ODEChemistryModel<CompType, ThermoType>::tc() const
}
}
tmp<volScalarField> tsource
(
new volScalarField
(
IOobject
(
"tc",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh_,
dimensionedScalar("zero", dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
tsource().internalField() = t;
tsource().correctBoundaryConditions();
return tsource;
@ -682,7 +679,7 @@ Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::solve
forAll(rho, celli)
{
for (label i=0; i<nSpecie(); i++)
for (label i=0; i<nSpecie_; i++)
{
RR_[i][celli] = 0.0;
}

View File

@ -26,7 +26,7 @@ Class
Foam::rhoChemistryModel
Description
Chemistry model for compressibility-based thermodynamics
Chemistry model for density-based thermodynamics
SourceFiles
rhoChemistryModelI.H

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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);
}
// ************************************************************************* //

View File

@ -27,19 +27,124 @@ License
#include "C10H22.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(C10H22, 0);
addToRunTimeSelectionTable(liquid, C10H22,);
addToRunTimeSelectionTable(liquid, C10H22, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
defineTypeNameAndDebug(C10H22, 0);
addToRunTimeSelectionTable(liquid, C10H22,);
addToRunTimeSelectionTable(liquid, C10H22, Istream);
Foam::C10H22::C10H22()
:
liquid
(
142.285,
617.70,
2.11e+6,
0.6,
0.247,
243.51,
1.393,
447.30,
0.0,
0.4923,
1.57e+4
),
rho_(60.94208835, 0.25745, 617.7, 0.28912),
pv_(112.73, -9749.6, -13.245, 7.1266e-06, 2.0),
hl_(617.70, 464743.296904101, 0.39797, 0.0, 0.0, 0.0),
cp_
(
1958.18252099659,
-1.39094071757388,
0.00754612221948905,
0.0,
0.0,
0.0
),
h_
(
-2699436.15229142,
1958.18252099659,
-0.695470358786942,
0.00251537407316302,
0.0,
0.0
),
cpg_(1175.10630073444, 3762.16748076045, 1614.1, 2658.04547211582, 742),
B_
(
0.00337351091119935,
-4.13606494008504,
-534560.916470464,
-1.13364022911762e+19,
2.80704220402713e+21
),
mu_(-16.468, 1533.5, 0.7511, 0.0, 0.0),
mug_(2.64e-08, 0.9487, 71.0, 0.0),
K_(0.2063, -0.000254, 0.0, 0.0, 0.0, 0.0),
Kg_(-668.4, 0.9323, -4071000000.0, 0.0),
sigma_(617.70, 0.055435, 1.3095, 0.0, 0.0, 0.0),
D_(147.18, 20.1, 142.285, 28.0) // note: Same as nHeptane
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
Foam::C10H22::C10H22
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc0& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc7& 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::C10H22::C10H22(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)
{}
// ************************************************************************* //

View File

@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
C10H22()
:
liquid(142.285, 617.70, 2.11e+6, 0.6, 0.247, 243.51, 1.393, 447.30, 0.0, 0.4923, 1.57e+4),
rho_(60.94208835, 0.25745, 617.7, 0.28912),
pv_(112.73, -9749.6, -13.245, 7.1266e-06, 2),
hl_(617.70, 464743.296904101, 0.39797, 0, 0, 0),
cp_(1958.18252099659, -1.39094071757388, 0.00754612221948905, 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_(-2699436.15229142, 1958.18252099659, -0.695470358786942, 0.00251537407316302, 0, 0),
cpg_(1175.10630073444, 3762.16748076045, 1614.1, 2658.04547211582, 742),
B_(0.00337351091119935, -4.13606494008504, -534560.916470464, -1.13364022911762e+19, 2.80704220402713e+21),
mu_(-16.468, 1533.5, 0.7511, 0, 0),
mug_(2.64e-08, 0.9487, 71, 0),
K_(0.2063, -0.000254, 0, 0, 0, 0),
Kg_(-668.4, 0.9323, -4071000000.0, 0),
sigma_(617.70, 0.055435, 1.3095, 0, 0, 0),
D_(147.18, 20.1, 142.285, 28) // NN: Same as nHeptane
{}
C10H22();
//- Construct from components
C10H22
(
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
C10H22(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)
{}
C10H22(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
{
@ -261,8 +175,7 @@ public:
}
// Ostream Operator
//- Ostream Operator
friend Ostream& operator<<(Ostream& os, const C10H22& l)
{
l.writeData(os);
@ -277,6 +190,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "C10H22I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::C10H22::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::C10H22::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::C10H22::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::C10H22::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::C10H22::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::C10H22::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::C10H22::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::C10H22::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::C10H22::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::C10H22::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::C10H22::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::C10H22::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::C10H22::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //

View File

@ -27,19 +27,116 @@ License
#include "C12H26.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(C12H26, 0);
addToRunTimeSelectionTable(liquid, C12H26,);
addToRunTimeSelectionTable(liquid, C12H26, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
defineTypeNameAndDebug(C12H26, 0);
addToRunTimeSelectionTable(liquid, C12H26,);
addToRunTimeSelectionTable(liquid, C12H26, Istream);
Foam::C12H26::C12H26()
:
liquid
(
170.338,
658.0,
1.82e+6,
0.716,
0.238,
263.57,
6.152e-1,
489.47,
0.0,
0.5764,
1.59e+4
),
rho_(60.53982858, 0.25511, 658.0, 0.29368),
pv_(137.47, -11976.0, -16.698, 8.0906e-06, 2.0),
hl_(658.0, 454020.829174935, 0.40681, 0.0, 0.0, 0.0),
cp_(2983.53861146661, -8.0352006011577, 0.018207916025784, 0.0, 0.0, 0.0),
h_
(
-2755166.83820769,
2983.53861146661,
-4.01760030057885,
0.00606930534192801,
0.0,
0.0
),
cpg_(1250.16144371778, 3894.02247296552, 1715.5, 2650.67101879792, 777.5),
B_
(
0.00516619896910848,
-6.40491258556517,
-295295.236529723,
-3.22147729807794e+19,
8.78195117941974e+21
),
mu_(-20.607, 1943, 1.3205, 0.0, 0.0),
mug_(6.344e-08, 0.8287, 219.5, 0.0),
K_(0.2047, -0.0002326, 0.0, 0.0, 0.0, 0.0),
Kg_(5.719e-06, 1.4699, 579.4, 0.0),
sigma_(658.0, 0.055493, 1.3262, 0.0, 0.0, 0.0),
D_(147.18, 20.1, 170.338, 28.0) // note: Same as nHeptane
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
Foam::C12H26::C12H26
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc0& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc7& 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::C12H26::C12H26(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)
{}
// ************************************************************************* //

View File

@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
C12H26()
:
liquid(170.338, 658.0, 1.82e+6, 0.716, 0.238, 263.57, 6.152e-1, 489.47, 0, 0.5764, 1.59e+4),
rho_(60.53982858, 0.25511, 658, 0.29368),
pv_(137.47, -11976, -16.698, 8.0906e-06, 2),
hl_(658.0, 454020.829174935, 0.40681, 0, 0, 0),
cp_(2983.53861146661, -8.0352006011577, 0.018207916025784, 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_(-2755166.83820769, 2983.53861146661, -4.01760030057885, 0.00606930534192801, 0, 0),
cpg_(1250.16144371778, 3894.02247296552, 1715.5, 2650.67101879792, 777.5),
B_(0.00516619896910848, -6.40491258556517, -295295.236529723, -3.22147729807794e+19, 8.78195117941974e+21),
mu_(-20.607, 1943, 1.3205, 0, 0),
mug_(6.344e-08, 0.8287, 219.5, 0),
K_(0.2047, -0.0002326, 0, 0, 0, 0),
Kg_(5.719e-06, 1.4699, 579.4, 0),
sigma_(658.0, 0.055493, 1.3262, 0, 0, 0),
D_(147.18, 20.1, 170.338, 28) // NN: Same as nHeptane
{}
C12H26();
//- Construct from conponents
C12H26
(
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
C12H26(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)
{}
C12H26(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 C12H26& l)
{
l.writeData(os);
@ -277,6 +189,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "C12H26I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::C12H26::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::C12H26::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::C12H26::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::C12H26::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::C12H26::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::C12H26::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::C12H26::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::C12H26::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::C12H26::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::C12H26::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::C12H26::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::C12H26::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::C12H26::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //

View File

@ -27,19 +27,124 @@ License
#include "C13H28.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(C13H28, 0);
addToRunTimeSelectionTable(liquid, C13H28,);
addToRunTimeSelectionTable(liquid, C13H28, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
defineTypeNameAndDebug(C13H28, 0);
addToRunTimeSelectionTable(liquid, C13H28,);
addToRunTimeSelectionTable(liquid, C13H28, Istream);
Foam::C13H28::C13H28()
:
liquid
(
184.365,
675.80,
1.7225e+6,
0.77,
0.236,
267.76,
3.801e-1,
508.62,
0.0,
0.6186,
1.5901e+4
),
rho_(59.513022, 0.2504, 675.8, 0.312),
pv_(118.27, -11432, -13.769, 5.9641e-06, 2.0),
hl_(675.80, 444227.48352453, 0.4162, 0.0, 0.0, 0.0),
cp_
(
4275.05220622135,
-16.6539202126217,
0.0325755973205326,
0.0,
0.0,
0.0
),
h_
(
-2860442.0545124,
4275.05220622135,
-8.32696010631085,
0.0108585324401775,
0.0,
0.0
),
cpg_(1136.87522035093, 3641.14663846175, -1443, 2277.00485450058, -683.0),
B_
(
0.00246321156401703,
-2.66601578390692,
-1249532.17801643,
-1.0460770753668e+19,
1.90117430097904e+21
),
mu_(-23.341, 2121.9, 1.7208, 0.0, 0.0),
mug_(3.5585e-08, 0.8987, 165.3, 0.0),
K_(0.1981, -0.0002046, 0.0, 0.0, 0.0, 0.0),
Kg_(5.3701e-06, 1.4751, 599.09, 0.0),
sigma_(675.80, 0.05561, 1.3361, 0.0, 0.0, 0.0),
D_(147.18, 20.1, 184.365, 28.0) // note: Same as nHeptane
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
Foam::C13H28::C13H28
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc0& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc7& 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::C13H28::C13H28(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)
{}
// ************************************************************************* //

View File

@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
C13H28()
:
liquid(184.365, 675.80, 1.7225e+6, 0.77, 0.236, 267.76, 3.801e-1, 508.62, 0.0, 0.6186, 1.5901e+4),
rho_(59.513022, 0.2504, 675.8, 0.312),
pv_(118.27, -11432, -13.769, 5.9641e-06, 2),
hl_(675.80, 444227.48352453, 0.4162, 0, 0, 0),
cp_(4275.05220622135, -16.6539202126217, 0.0325755973205326, 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_(-2860442.0545124, 4275.05220622135, -8.32696010631085, 0.0108585324401775, 0, 0),
cpg_(1136.87522035093, 3641.14663846175, -1443, 2277.00485450058, -683),
B_(0.00246321156401703, -2.66601578390692, -1249532.17801643, -1.0460770753668e+19, 1.90117430097904e+21),
mu_(-23.341, 2121.9, 1.7208, 0, 0),
mug_(3.5585e-08, 0.8987, 165.3, 0),
K_(0.1981, -0.0002046, 0, 0, 0, 0),
Kg_(5.3701e-06, 1.4751, 599.09, 0),
sigma_(675.80, 0.05561, 1.3361, 0, 0, 0),
D_(147.18, 20.1, 184.365, 28) // NN: Same as nHeptane
{}
C13H28();
//- Construct from components
C13H28
(
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
C13H28(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)
{}
C13H28(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 C13H28& l)
{
l.writeData(os);
@ -277,6 +189,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "C13H28I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::C13H28::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::C13H28::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::C13H28::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::C13H28::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::C13H28::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::C13H28::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::C13H28::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::C13H28::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::C13H28::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::C13H28::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::C13H28::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::C13H28::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::C13H28::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //

View File

@ -27,19 +27,124 @@ License
#include "C14H30.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(C14H30, 0);
addToRunTimeSelectionTable(liquid, C14H30,);
addToRunTimeSelectionTable(liquid, C14H30, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
defineTypeNameAndDebug(C14H30, 0);
addToRunTimeSelectionTable(liquid, C14H30,);
addToRunTimeSelectionTable(liquid, C14H30, Istream);
Foam::C14H30::C14H30()
:
liquid
(
198.392,
692.40,
1.6212e+6,
0.8428,
0.237,
279.01,
1.8849e-1,
526.73,
0.0,
0.6617,
1.6173e+4
),
rho_(60.92023144, 0.2582, 692.4, 0.26628),
pv_(249.21, -16915, -35.195, 0.028451, 1.0),
hl_(692.40, 455764.345336506, 0.428, 0.0, 0.0, 0.0),
cp_
(
2565.72845679261,
-4.78114036856325,
0.0120362716238558,
0.0,
0.0,
0.0
),
h_
(
-2690601.01887934,
2565.72845679261,
-2.39057018428162,
0.00401209054128527,
0.0,
0.0
),
cpg_(1134.11831122223, 3629.17859591113, -1440.3, 2275.29335860317, -682),
B_
(
0.00247837614419936,
-2.62692044034034,
-1427174.48284205,
-1.68288035807895e+19,
3.48854792531957e+21
),
mu_(-18.964, 2010.9, 1.0648, 0.0, 0.0),
mug_(4.4565e-08, 0.8684, 228.16, -4347.2),
K_(0.1957, -0.0001993, 0.0, 0.0, 0.0, 0.0),
Kg_(-0.000628, 0.944, -5490, 0.0),
sigma_(692.40, 0.056436, 1.3658, 0.0, 0.0, 0.0),
D_(147.18, 20.1, 198.392, 28.0) // note: Same as nHeptane
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
Foam::C14H30::C14H30
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc0& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc7& 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::C14H30::C14H30(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)
{}
// ************************************************************************* //

View File

@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
C14H30()
:
liquid(198.392, 692.40, 1.6212e+6, 0.8428, 0.237, 279.01, 1.8849e-1, 526.73, 0.0, 0.6617, 1.6173e+4),
rho_(60.92023144, 0.2582, 692.4, 0.26628),
pv_(249.21, -16915, -35.195, 0.028451, 1),
hl_(692.40, 455764.345336506, 0.428, 0, 0, 0),
cp_(2565.72845679261, -4.78114036856325, 0.0120362716238558, 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_(-2690601.01887934, 2565.72845679261, -2.39057018428162, 0.00401209054128527, 0, 0),
cpg_(1134.11831122223, 3629.17859591113, -1440.3, 2275.29335860317, -682),
B_(0.00247837614419936, -2.62692044034034, -1427174.48284205, -1.68288035807895e+19, 3.48854792531957e+21),
mu_(-18.964, 2010.9, 1.0648, 0, 0),
mug_(4.4565e-08, 0.8684, 228.16, -4347.2),
K_(0.1957, -0.0001993, 0, 0, 0, 0),
Kg_(-0.000628, 0.944, -5490, 0),
sigma_(692.40, 0.056436, 1.3658, 0, 0, 0),
D_(147.18, 20.1, 198.392, 28) // NN: Same as nHeptane
{}
C14H30();
//- Construct from components
C14H30
(
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
C14H30(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)
{}
C14H30(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);
}
//- Liquid thermal conductivity [W/(m K)]
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);
}
//- Vapour thermal conductivity [W/(m K)]
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 C14H30& l)
{
l.writeData(os);
@ -277,6 +189,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "C14H30I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::C14H30::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::C14H30::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::C14H30::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::C14H30::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::C14H30::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::C14H30::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::C14H30::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::C14H30::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::C14H30::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::C14H30::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::C14H30::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::C14H30::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::C14H30::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //

View File

@ -27,19 +27,124 @@ License
#include "C16H34.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(C16H34, 0);
addToRunTimeSelectionTable(liquid, C16H34,);
addToRunTimeSelectionTable(liquid, C16H34, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
defineTypeNameAndDebug(C16H34, 0);
addToRunTimeSelectionTable(liquid, C16H34,);
addToRunTimeSelectionTable(liquid, C16H34, Istream);
Foam::C16H34::C16H34()
:
liquid
(
226.446,
720.60,
1.4186e+6,
0.93,
0.22,
291.32,
8.7467e-2,
560.01,
0.0,
0.7471,
1.6052e+4
),
rho_(61.94656776, 0.25442, 720.6, 0.3238),
pv_(233.1, -17346, -32.251, 0.02407, 1.0),
hl_(720.60, 430654.548987397, 0.4122, 0.0, 0.0, 0.0),
cp_
(
3769.90540791182,
-12.5871068599136,
0.0247211255663602,
0.0,
0.0,
0.0
),
h_
(
-2777201.30410301,
3769.90540791182,
-6.29355342995681,
0.00824037518878673,
0.0,
0.0
),
cpg_(1128.74592618108, 3600.8584828171, -1429.7, 2259.69988429913, 679.0),
B_
(
0.0025091191718997,
-2.46668079807106,
-1704070.72767901,
-3.00623548219001e+19,
7.07320950690231e+21
),
mu_(-18.388, 2056.8, 0.98681, 0.0, 0.0),
mug_(1.2463e-07, 0.7322, 395.0, 6000.0),
K_(0.1963, -0.00019, 0.0, 0.0, 0.0, 0.0),
Kg_(3.075e-06, 1.552, 678.0, 0.0),
sigma_(720.60, 0.05699, 1.3929, 0.0, 0.0, 0.0),
D_(147.18, 20.1, 226.446, 28.0) // note: Same as nHeptane
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
Foam::C16H34::C16H34
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc0& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc7& 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::C16H34::C16H34(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)
{}
// ************************************************************************* //

View File

@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
C16H34()
:
liquid(226.446, 720.60, 1.4186e+6, 0.93, 0.22, 291.32, 8.7467e-2, 560.01, 0, 0.7471, 1.6052e+4),
rho_(61.94656776, 0.25442, 720.6, 0.3238),
pv_(233.1, -17346, -32.251, 0.02407, 1),
hl_(720.60, 430654.548987397, 0.4122, 0, 0, 0),
cp_(3769.90540791182, -12.5871068599136, 0.0247211255663602, 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_(-2777201.30410301, 3769.90540791182, -6.29355342995681, 0.00824037518878673, 0, 0),
cpg_(1128.74592618108, 3600.8584828171, -1429.7, 2259.69988429913, 679),
B_(0.0025091191718997, -2.46668079807106, -1704070.72767901, -3.00623548219001e+19, 7.07320950690231e+21),
mu_(-18.388, 2056.8, 0.98681, 0, 0),
mug_(1.2463e-07, 0.7322, 395, 6000),
K_(0.1963, -0.00019, 0, 0, 0, 0),
Kg_(3.075e-06, 1.552, 678, 0),
sigma_(720.60, 0.05699, 1.3929, 0, 0, 0),
D_(147.18, 20.1, 226.446, 28) // NN: Same as nHeptane
{}
C16H34();
//- Construct from components
C16H34
(
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
C16H34(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)
{}
C16H34(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 C16H34& l)
{
l.writeData(os);
@ -277,6 +189,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "C16H34I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::C16H34::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::C16H34::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::C16H34::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::C16H34::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::C16H34::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::C16H34::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::C16H34::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::C16H34::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::C16H34::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::C16H34::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::C16H34::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::C16H34::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::C16H34::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //

View File

@ -27,19 +27,124 @@ License
#include "C2H5OH.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(C2H5OH, 0);
addToRunTimeSelectionTable(liquid, C2H5OH,);
addToRunTimeSelectionTable(liquid, C2H5OH, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
defineTypeNameAndDebug(C2H5OH, 0);
addToRunTimeSelectionTable(liquid, C2H5OH,);
addToRunTimeSelectionTable(liquid, C2H5OH, Istream);
Foam::C2H5OH::C2H5OH()
:
liquid
(
46.069,
516.25,
6.3835e+6,
0.16692,
0.248,
159.05,
7.1775e-5,
351.44,
5.6372e-30,
0.6371,
2.6421e+4
),
rho_(70.1308387, 0.26395, 516.25, 0.2367),
pv_(59.796, -6595, -5.0474, 6.3e-07, 2),
hl_(516.25, 958345.091059064, -0.4134, 0.75362, 0.0, 0.0),
cp_
(
2052.57331394213,
-1.21990926653498,
0.00714146172046278,
5.20523562482363e-05,
0.0,
0.0
),
h_
(
-6752827.25039109,
2052.57331394213,
-0.60995463326749,
0.00238048724015426,
1.30130890620591e-05,
0.0
),
cpg_(909.505307256507, 3358.00646855803, 1530, 2029.56434912848, 640),
B_
(
-0.00358158414552085,
3.90718270420456,
-1180837.43949293,
9.81136990166923e+18,
-3.58592545963663e+21
),
mu_(8.049, 776, -3.068, 0.0, 0.0),
mug_(1.0613e-07, 0.8066, 52.7, 0.0),
K_(0.253, -0.000281, 0.0, 0.0, 0.0, 0.0),
Kg_(-3.12, 0.7152, -3550000.0, 0.0),
sigma_(516.25, 0.04064, -4.34e-05, -6.42e-08, 0.0, 0.0),
D_(147.18, 20.1, 46.069, 28) // note: Same as nHeptane
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
Foam::C2H5OH::C2H5OH
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc0& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc7& 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::C2H5OH::C2H5OH(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)
{}
// ************************************************************************* //

View File

@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
C2H5OH()
:
liquid(46.069, 516.25, 6.3835e+6, 0.16692, 0.248, 159.05, 7.1775e-5, 351.44, 5.6372e-30, 0.6371, 2.6421e+4),
rho_(70.1308387, 0.26395, 516.25, 0.2367),
pv_(59.796, -6595, -5.0474, 6.3e-07, 2),
hl_(516.25, 958345.091059064, -0.4134, 0.75362, 0, 0),
cp_(2052.57331394213, -1.21990926653498, 0.00714146172046278, 5.20523562482363e-05, 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_(-6752827.25039109, 2052.57331394213, -0.60995463326749, 0.00238048724015426, 1.30130890620591e-05, 0),
cpg_(909.505307256507, 3358.00646855803, 1530, 2029.56434912848, 640),
B_(-0.00358158414552085, 3.90718270420456, -1180837.43949293, 9.81136990166923e+18, -3.58592545963663e+21),
mu_(8.049, 776, -3.068, 0, 0),
mug_(1.0613e-07, 0.8066, 52.7, 0),
K_(0.253, -0.000281, 0, 0, 0, 0),
Kg_(-3.12, 0.7152, -3550000.0, 0),
sigma_(516.25, 0.04064, -4.34e-05, -6.42e-08, 0, 0),
D_(147.18, 20.1, 46.069, 28) // NN: Same as nHeptane
{}
C2H5OH();
//- Construct from components
C2H5OH
(
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
C2H5OH(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)
{}
C2H5OH(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 C2H5OH& l)
{
l.writeData(os);
@ -277,6 +189,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "C2H5OHI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::C2H5OH::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::C2H5OH::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //

View File

@ -27,19 +27,115 @@ License
#include "C2H6.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(C2H6, 0);
addToRunTimeSelectionTable(liquid, C2H6,);
addToRunTimeSelectionTable(liquid, C2H6, Istream);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
defineTypeNameAndDebug(C2H6, 0);
addToRunTimeSelectionTable(liquid, C2H6,);
addToRunTimeSelectionTable(liquid, C2H6, Istream);
Foam::C2H6::C2H6()
:
liquid
(
30.070,
305.32,
4.872e+6,
0.14550,
0.279,
90.35,
1.13,
184.55,
0.0,
0.0995,
1.24e+4
),
rho_(57.499854, 0.27937, 305.32, 0.29187),
pv_(51.857, -2598.7, -5.1283, 1.4913e-05, 2.0),
hl_(305.32, 701396.740937812, 0.60646, -0.55492, 0.32799, 0.0),
cp_
(
305.32,
8.02554965861611,
2983.63817758563,
167.548325566287,
-343.93389207094
),
h_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
cpg_(1341.07083471899, 4463.58496840705, 1655.5, 2435.08480212837, 752.87),
B_
(
0.00269205187894912,
-2.05221150648487,
-47721.9820419022,
2.24808779514466e+15,
-3.23910874625873e+17
),
mu_(-3.4134, 197.05, -1.2193, -9.2023e-26, 10.0),
mug_(2.5906e-07, 0.67988, 98.902, 0.0),
K_(0.35758, -0.0011458, 6.1866e-07, 0.0, 0.0, 0.0),
Kg_(7.3869e-05, 1.1689, 500.73, 0.0),
sigma_(305.32, 0.048643, 1.1981, 0.0, 0.0, 0.0),
D_(147.18, 20.1, 30.070, 28) // note: Same as nHeptane
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
Foam::C2H6::C2H6
(
const liquid& l,
const NSRDSfunc5& density,
const NSRDSfunc1& vapourPressure,
const NSRDSfunc6& heatOfVapourisation,
const NSRDSfunc14& heatCapacity,
const NSRDSfunc0& enthalpy,
const NSRDSfunc7& 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::C2H6::C2H6(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)
{}
// ************************************************************************* //

View File

@ -87,26 +87,9 @@ public:
// Constructors
//- Construct null
C2H6()
:
liquid(30.070, 305.32, 4.872e+6, 0.14550, 0.279, 90.35, 1.13, 184.55, 0.0, 0.0995, 1.24e+4),
rho_(57.499854, 0.27937, 305.32, 0.29187),
pv_(51.857, -2598.7, -5.1283, 1.4913e-05, 2),
hl_(305.32, 701396.740937812, 0.60646, -0.55492, 0.32799, 0),
cp_(305.32, 8.02554965861611, 2983.63817758563, 167.548325566287, -343.93389207094),
// 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_(0, 0, 0, 0, 0, 0),
cpg_(1341.07083471899, 4463.58496840705, 1655.5, 2435.08480212837, 752.87),
B_(0.00269205187894912, -2.05221150648487, -47721.9820419022, 2.24808779514466e+15, -3.23910874625873e+17),
mu_(-3.4134, 197.05, -1.2193, -9.2023e-26, 10),
mug_(2.5906e-07, 0.67988, 98.902, 0),
K_(0.35758, -0.0011458, 6.1866e-07, 0, 0, 0),
Kg_(7.3869e-05, 1.1689, 500.73, 0),
sigma_(305.32, 0.048643, 1.1981, 0, 0, 0),
D_(147.18, 20.1, 30.070, 28) // NN: Same as nHeptane
{}
C2H6();
//- Construct from components
C2H6
(
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
C2H6(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)
{}
C2H6(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 C2H6& l)
{
l.writeData(os);
@ -277,6 +189,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "C2H6I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::C2H6::rho(scalar p, scalar T) const
{
return rho_.f(p, T);
}
inline Foam::scalar Foam::C2H6::pv(scalar p, scalar T) const
{
return pv_.f(p, T);
}
inline Foam::scalar Foam::C2H6::hl(scalar p, scalar T) const
{
return hl_.f(p, T);
}
inline Foam::scalar Foam::C2H6::cp(scalar p, scalar T) const
{
return cp_.f(p, T);
}
inline Foam::scalar Foam::C2H6::h(scalar p, scalar T) const
{
return h_.f(p, T);
}
inline Foam::scalar Foam::C2H6::cpg(scalar p, scalar T) const
{
return cpg_.f(p, T);
}
inline Foam::scalar Foam::C2H6::B(scalar p, scalar T) const
{
return B_.f(p, T);
}
inline Foam::scalar Foam::C2H6::mu(scalar p, scalar T) const
{
return mu_.f(p, T);
}
inline Foam::scalar Foam::C2H6::mug(scalar p, scalar T) const
{
return mug_.f(p, T);
}
inline Foam::scalar Foam::C2H6::K(scalar p, scalar T) const
{
return K_.f(p, T);
}
inline Foam::scalar Foam::C2H6::Kg(scalar p, scalar T) const
{
return Kg_.f(p, T);
}
inline Foam::scalar Foam::C2H6::sigma(scalar p, scalar T) const
{
return sigma_.f(p, T);
}
inline Foam::scalar Foam::C2H6::D(scalar p, scalar T) const
{
return D_.f(p, T);
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More