Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2012-09-26 10:05:44 +01:00
472 changed files with 16810 additions and 3236 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -168,7 +168,7 @@ namespace Foam
FatalErrorIn("fileMonitorWatcher(const bool, const label)")
<< "You selected inotify but this file was compiled"
<< " without FOAM_USE_INOTIFY"
<< "Please select another fileModification test method"
<< " Please select another fileModification test method"
<< exit(FatalError);
#endif
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,8 @@ License
template<class Type>
Foam::CompatibilityConstant<Type>::CompatibilityConstant
(
const word& entryName, const dictionary& dict
const word& entryName,
const dictionary& dict
)
:
DataEntry<Type>(entryName),
@ -69,6 +70,7 @@ Foam::CompatibilityConstant<Type>::CompatibilityConstant
dimensions_(cnst.dimensions_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>

View File

@ -27,13 +27,13 @@ Class
Description
Templated table container data entry. Items are stored in a list of
Tuple2's. First column is always stored as scalar entries. Data is read
in the form, e.g. for an entry \<entryName\> that is (scalar, vector):
in Tuple2 form, e.g. for an entry \<entryName\> that is (scalar, vector):
\verbatim
<entryName> table [0 1 0 0 0] //dimension set optional
<entryName> table
(
0.0 (1 2 3)
1.0 (4 5 6)
(0.0 (1 2 3))
(1.0 (4 5 6))
);
\endverbatim

View File

@ -119,7 +119,7 @@ singleStepCombustion<CombThermoType, ThermoType>::R
{
const label fNorm = singleMixturePtr_->specieProd()[specieI];
const volScalarField fres(singleMixturePtr_->fres(specieI));
wSpecie /= max(fNorm*(Y - fres), 1e-2);
wSpecie /= max(fNorm*(Y - fres), scalar(1e-2));
return -fNorm*wSpecie*fres + fNorm*fvm::Sp(wSpecie, Y);
}

View File

@ -0,0 +1,32 @@
Foam::word regionName;
if (args.optionReadIfPresent("region", regionName))
{
Foam::Info
<< "Create mesh " << regionName << " for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
else
{
regionName = Foam::fvMesh::defaultRegion;
Foam::Info
<< "Create mesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
autoPtr<dynamicFvMesh> meshPtr
(
dynamicFvMesh::New
(
IOobject
(
regionName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
dynamicFvMesh& mesh = meshPtr();

View File

@ -308,6 +308,7 @@ $(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C
$(ddtSchemes)/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C
$(ddtSchemes)/boundedDdtScheme/boundedDdtSchemes.C
d2dt2Schemes = finiteVolume/d2dt2Schemes
$(d2dt2Schemes)/d2dt2Scheme/d2dt2Schemes.C

View File

@ -40,8 +40,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(p, iF),
flowRate_(),
phiName_("phi"),
rhoName_("rho")
volumetric_(false),
rhoName_("rho"),
rhoInlet_(0.0)
{}
@ -56,8 +57,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
flowRate_(ptf.flowRate_().clone().ptr()),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_)
{}
@ -69,11 +71,47 @@ flowRateInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchField<vector>(p, iF, dict),
flowRate_(DataEntry<scalar>::New("flowRate", dict)),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{}
fixedValueFvPatchField<vector>(p, iF),
rhoInlet_(dict.lookupOrDefault<scalar>("rhoInlet", -VGREAT))
{
if (dict.found("volumetricFlowRate"))
{
volumetric_ = true;
flowRate_ = DataEntry<scalar>::New("volumetricFlowRate", dict);
rhoName_ = "rho";
}
else if (dict.found("massFlowRate"))
{
volumetric_ = false;
flowRate_ = DataEntry<scalar>::New("massFlowRate", dict);
rhoName_ = word(dict.lookupOrDefault<word>("rho", "rho"));
}
else
{
FatalIOErrorIn
(
"flowRateInletVelocityFvPatchVectorField::"
"flowRateInletVelocityFvPatchVectorField"
"(const fvPatch&, const DimensionedField<vector, volMesh>&,"
" const dictionary&)",
dict
) << "Please supply either 'volumetricFlowRate' or"
<< " 'massFlowRate' and 'rho'" << exit(FatalIOError);
}
// Value field require if mass based
if (dict.found("value"))
{
fvPatchField<vector>::operator=
(
vectorField("value", dict, p.size())
);
}
else
{
evaluate(Pstream::blocking);
}
}
Foam::flowRateInletVelocityFvPatchVectorField::
@ -84,8 +122,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf),
flowRate_(ptf.flowRate_().clone().ptr()),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_)
{}
@ -98,13 +137,44 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf, iF),
flowRate_(ptf.flowRate_().clone().ptr()),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs
(
const scalar uniformRho
)
{
if (updated())
{
return;
}
const scalar t = db().time().timeOutputValue();
// a simpler way of doing this would be nice
const scalar avgU = -flowRate_->value(t)/gSum(patch().magSf());
tmp<vectorField> n = patch().nf();
if (volumetric_ || rhoName_ == "none")
{
// volumetric flow-rate
operator==(n*avgU);
}
else
{
// mass flow-rate
operator==(n*avgU/uniformRho);
}
}
void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
@ -119,40 +189,38 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
tmp<vectorField> n = patch().nf();
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
if (phi.dimensions() == dimVelocity*dimArea)
if (volumetric_ || rhoName_ == "none")
{
// volumetric flow-rate
// volumetric flow-rate or density not given
operator==(n*avgU);
}
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
else
{
if (rhoName_ == "none")
// mass flow-rate
if
(
patch().boundaryMesh().mesh().foundObject<volScalarField>(rhoName_)
)
{
// volumetric flow-rate if density not given
operator==(n*avgU);
}
else
{
// mass flow-rate
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(n*avgU/rhop);
}
}
else
{
FatalErrorIn
(
"flowRateInletVelocityFvPatchVectorField::updateCoeffs()"
) << "dimensions of " << phiName_ << " are incorrect" << nl
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< nl << exit(FatalError);
else
{
// Use constant density
if (rhoInlet_ < 0)
{
FatalErrorIn
(
"flowRateInletVelocityFvPatchVectorField::updateCoeffs()"
) << "Did not find registered density field " << rhoName_
<< " and no constant density 'rhoInlet' specified"
<< exit(FatalError);
}
operator==(n*avgU/rhoInlet_);
}
}
fixedValueFvPatchField<vector>::updateCoeffs();
@ -163,8 +231,11 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchField<vector>::write(os);
flowRate_->writeData(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
if (!volumetric_)
{
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<scalar>(os, "rhoInlet", -VGREAT, rhoInlet_);
}
writeEntry("value", os);
}

View File

@ -28,21 +28,26 @@ Description
Describes a volumetric/mass flow normal vector boundary condition by its
magnitude as an integral over its area.
The basis of the patch (volumetric or mass) is determined by the
dimensions of the flux, phi.
If the flux is mass-based
- the current density is used to correct the velocity
- volumetric flow rate can be applied by setting the 'rho' entry to 'none'
Either specify 'volumetricFlowRate' or 'massFlowRate' (requires additional
'rho' or 'rhoInlet' entry).
Example of the boundary condition specification:
\verbatim
inlet
{
type flowRateInletVelocity;
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
rho rho; // none | rho [m3/s or kg/s]
value uniform (0 0 0); // placeholder
type flowRateInletVelocity;
volumetricFlowRate 0.2; // Volumetric [m3/s]
}
\endverbatim
\verbatim
inlet
{
type flowRateInletVelocity;
massFlowRate 0.2; // mass flow rate [kg/s]
rho rho; // rho [m3/s or kg/s]
rhoInlet 1.0 // uniform rho if no rho field registered
// (e.g. at startup)
}
\endverbatim
@ -79,12 +84,15 @@ class flowRateInletVelocityFvPatchVectorField
//- Inlet integral flow rate
autoPtr<DataEntry<scalar> > flowRate_;
//- Name of the flux transporting the field
word phiName_;
//- Is volumetric?
bool volumetric_;
//- Name of the density field used to normalize the mass flux
word rhoName_;
//- Rho initialisation value (for start; if value not supplied)
scalar rhoInlet_;
public:
@ -157,6 +165,10 @@ public:
// Member functions
//- Update the coefficients associated with the patch field given
// uniform density field
void updateCoeffs(const scalar uniformRho);
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();

View File

@ -0,0 +1,170 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "boundedDdtScheme.H"
#include "fvcDiv.H"
#include "fvcDdt.H"
#include "fvMatrices.H"
#include "fvmSup.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace fv
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> >
boundedDdtScheme<Type>::fvcDdt
(
const dimensioned<Type>& dt
)
{
return scheme_().fvcDdt(dt);
}
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> >
boundedDdtScheme<Type>::fvcDdt
(
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return scheme_().fvcDdt(vf);
}
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> >
boundedDdtScheme<Type>::fvcDdt
(
const dimensionedScalar& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return scheme_().fvcDdt(rho, vf);
}
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> >
boundedDdtScheme<Type>::fvcDdt
(
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return scheme_().fvcDdt(rho, vf) - fvc::ddt(rho)*vf;
}
template<class Type>
tmp<fvMatrix<Type> >
boundedDdtScheme<Type>::fvmDdt
(
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return scheme_().fvmDdt(vf);
}
template<class Type>
tmp<fvMatrix<Type> >
boundedDdtScheme<Type>::fvmDdt
(
const dimensionedScalar& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return scheme_().fvmDdt(rho, vf);
}
template<class Type>
tmp<fvMatrix<Type> >
boundedDdtScheme<Type>::fvmDdt
(
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return scheme_().fvmDdt(rho, vf) - fvm::Sp(fvc::ddt(rho), vf);
}
template<class Type>
tmp<typename boundedDdtScheme<Type>::fluxFieldType>
boundedDdtScheme<Type>::fvcDdtPhiCorr
(
const volScalarField& rA,
const GeometricField<Type, fvPatchField, volMesh>& U,
const fluxFieldType& phi
)
{
return scheme_().fvcDdtPhiCorr(rA, U, phi);
}
template<class Type>
tmp<typename boundedDdtScheme<Type>::fluxFieldType>
boundedDdtScheme<Type>::fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& U,
const fluxFieldType& phi
)
{
return scheme_().fvcDdtPhiCorr(rA, rho, U, phi);
}
template<class Type>
tmp<surfaceScalarField> boundedDdtScheme<Type>::meshPhi
(
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return scheme_().meshPhi(vf);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,207 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::boundedDdtScheme
Description
Bounded form of the selected ddt scheme.
Boundedness is achieved by subtracting ddt(phi)*vf or Sp(ddt(rho), vf)
which is non-conservative if ddt(rho) != 0 but conservative otherwise.
Can be used for the ddt of bounded scalar properties to improve stability
if insufficient convergence of the pressure equation causes temporary
divergence of the flux field.
SourceFiles
boundedDdtScheme.C
\*---------------------------------------------------------------------------*/
#ifndef boundedDdtScheme_H
#define boundedDdtScheme_H
#include "ddtScheme.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace fv
{
/*---------------------------------------------------------------------------*\
Class boundedDdtScheme Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class boundedDdtScheme
:
public fv::ddtScheme<Type>
{
// Private data
tmp<fv::ddtScheme<Type> > scheme_;
// Private Member Functions
//- Disallow default bitwise copy construct
boundedDdtScheme(const boundedDdtScheme&);
//- Disallow default bitwise assignment
void operator=(const boundedDdtScheme&);
public:
//- Runtime type information
TypeName("bounded");
// Constructors
//- Construct from mesh and Istream
boundedDdtScheme(const fvMesh& mesh, Istream& is)
:
ddtScheme<Type>(mesh, is),
scheme_
(
fv::ddtScheme<Type>::New(mesh, is)
)
{}
// Member Functions
//- Return mesh reference
const fvMesh& mesh() const
{
return fv::ddtScheme<Type>::mesh();
}
tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
(
const dimensioned<Type>&
);
tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
(
const GeometricField<Type, fvPatchField, volMesh>&
);
tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
(
const dimensionedScalar&,
const GeometricField<Type, fvPatchField, volMesh>&
);
tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
(
const volScalarField&,
const GeometricField<Type, fvPatchField, volMesh>&
);
tmp<fvMatrix<Type> > fvmDdt
(
const GeometricField<Type, fvPatchField, volMesh>&
);
tmp<fvMatrix<Type> > fvmDdt
(
const dimensionedScalar&,
const GeometricField<Type, fvPatchField, volMesh>&
);
tmp<fvMatrix<Type> > fvmDdt
(
const volScalarField&,
const GeometricField<Type, fvPatchField, volMesh>&
);
typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType;
tmp<fluxFieldType> fvcDdtPhiCorr
(
const volScalarField& rA,
const GeometricField<Type, fvPatchField, volMesh>& U,
const fluxFieldType& phi
);
tmp<fluxFieldType> fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& U,
const fluxFieldType& phi
);
tmp<surfaceScalarField> meshPhi
(
const GeometricField<Type, fvPatchField, volMesh>&
);
};
template<>
tmp<surfaceScalarField> boundedDdtScheme<scalar>::fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& U,
const surfaceScalarField& phi
);
template<>
tmp<surfaceScalarField> boundedDdtScheme<scalar>::fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& rho,
const volScalarField& U,
const surfaceScalarField& phi
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "boundedDdtScheme.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "boundedDdtScheme.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
makeFvDdtScheme(boundedDdtScheme)
}
}
// ************************************************************************* //

View File

@ -53,7 +53,6 @@ class motionDiffusivity;
class displacementSBRStressFvMotionSolver
:
// public displacementFvMotionSolver
public displacementMotionSolver,
public fvMotionSolverCore
{

View File

@ -99,76 +99,6 @@ void Foam::autoLayerDriver::sumWeights
// Smooth field on moving patch
//void Foam::autoLayerDriver::smoothField
//(
// const motionSmoother& meshMover,
// const PackedBoolList& isMasterEdge,
// const labelList& meshEdges,
// const scalarField& fieldMin,
// const label nSmoothDisp,
// scalarField& field
//) const
//{
// const indirectPrimitivePatch& pp = meshMover.patch();
// const edgeList& edges = pp.edges();
// const labelList& meshPoints = pp.meshPoints();
//
// scalarField invSumWeight(pp.nPoints());
// sumWeights
// (
// isMasterEdge,
// meshEdges,
// meshPoints,
// edges,
// invSumWeight
// );
//
// // Get smoothly varying patch field.
// Info<< "shrinkMeshDistance : Smoothing field ..." << endl;
//
// for (label iter = 0; iter < nSmoothDisp; iter++)
// {
// scalarField average(pp.nPoints());
// averageNeighbours
// (
// meshMover.mesh(),
// isMasterEdge,
// meshEdges,
// meshPoints,
// pp.edges(),
// invSumWeight,
// field,
// average
// );
//
// // Transfer to field
// forAll(field, pointI)
// {
// //full smoothing neighbours + point value
// average[pointI] = 0.5*(field[pointI]+average[pointI]);
//
// // perform monotonic smoothing
// if
// (
// average[pointI] < field[pointI]
// && average[pointI] >= fieldMin[pointI]
// )
// {
// field[pointI] = average[pointI];
// }
// }
//
// // Do residual calculation every so often.
// if ((iter % 10) == 0)
// {
// Info<< " Iteration " << iter << " residual "
// << gSum(mag(field-average))
// /returnReduce(average.size(), sumOp<label>())
// << endl;
// }
// }
//}
//XXXXXXXXX
void Foam::autoLayerDriver::smoothField
(
const motionSmoother& meshMover,
@ -196,15 +126,9 @@ void Foam::autoLayerDriver::smoothField
// Get smoothly varying patch field.
Info<< "shrinkMeshDistance : Smoothing field ..." << endl;
const scalar lambda = 0.33;
const scalar mu = -0.34;
for (label iter = 0; iter < 90; iter++)
for (label iter = 0; iter < nSmoothDisp; iter++)
{
scalarField average(pp.nPoints());
// Calculate average of field
averageNeighbours
(
meshMover.mesh(),
@ -217,37 +141,23 @@ void Foam::autoLayerDriver::smoothField
average
);
forAll(field, i)
// Transfer to field
forAll(field, pointI)
{
if (field[i] >= fieldMin[i])
//full smoothing neighbours + point value
average[pointI] = 0.5*(field[pointI]+average[pointI]);
// perform monotonic smoothing
if
(
average[pointI] < field[pointI]
&& average[pointI] >= fieldMin[pointI]
)
{
field[i] = (1-lambda)*field[i]+lambda*average[i];
field[pointI] = average[pointI];
}
}
// Calculate average of field
averageNeighbours
(
meshMover.mesh(),
isMasterEdge,
meshEdges,
meshPoints,
pp.edges(),
invSumWeight,
field,
average
);
forAll(field, i)
{
if (field[i] >= fieldMin[i])
{
field[i] = (1-mu)*field[i]+mu*average[i];
}
}
// Do residual calculation every so often.
if ((iter % 10) == 0)
{
@ -259,6 +169,96 @@ void Foam::autoLayerDriver::smoothField
}
}
//XXXXXXXXX
//void Foam::autoLayerDriver::smoothField
//(
// const motionSmoother& meshMover,
// const PackedBoolList& isMasterEdge,
// const labelList& meshEdges,
// const scalarField& fieldMin,
// const label nSmoothDisp,
// scalarField& field
//) const
//{
// const indirectPrimitivePatch& pp = meshMover.patch();
// const edgeList& edges = pp.edges();
// const labelList& meshPoints = pp.meshPoints();
//
// scalarField invSumWeight(pp.nPoints());
// sumWeights
// (
// isMasterEdge,
// meshEdges,
// meshPoints,
// edges,
// invSumWeight
// );
//
// // Get smoothly varying patch field.
// Info<< "shrinkMeshDistance : (lambda-mu) Smoothing field ..." << endl;
//
//
// const scalar lambda = 0.33;
// const scalar mu = -0.34;
//
// for (label iter = 0; iter < 90; iter++)
// {
// scalarField average(pp.nPoints());
//
// // Calculate average of field
// averageNeighbours
// (
// meshMover.mesh(),
// isMasterEdge,
// meshEdges,
// meshPoints,
// pp.edges(),
// invSumWeight,
// field,
// average
// );
//
// forAll(field, i)
// {
// if (field[i] >= fieldMin[i])
// {
// field[i] = (1-lambda)*field[i]+lambda*average[i];
// }
// }
//
//
// // Calculate average of field
// averageNeighbours
// (
// meshMover.mesh(),
// isMasterEdge,
// meshEdges,
// meshPoints,
// pp.edges(),
// invSumWeight,
// field,
// average
// );
//
// forAll(field, i)
// {
// if (field[i] >= fieldMin[i])
// {
// field[i] = (1-mu)*field[i]+mu*average[i];
// }
// }
//
//
// // Do residual calculation every so often.
// if ((iter % 10) == 0)
// {
// Info<< " Iteration " << iter << " residual "
// << gSum(mag(field-average))
// /returnReduce(average.size(), sumOp<label>())
// << endl;
// }
// }
//}
//XXXXXXXXX
// Smooth normals on moving patch.
void Foam::autoLayerDriver::smoothPatchNormals

View File

@ -45,9 +45,6 @@ inline bool Foam::patchEdgeFaceRegion::update
if (w2.region_ == -2 || region_ == -2)
{
Pout<< "update : " << *this << " w2:" << w2 << " return FALSE" << endl;
// Blocked edge/face
return false;
}
@ -55,27 +52,18 @@ Pout<< "update : " << *this << " w2:" << w2 << " return FALSE" << endl;
if (!valid(td))
{
// current not yet set so use any value
label oldRegion = region_;
operator=(w2);
Pout<< "update : " << *this << " was:" << oldRegion
<< " w2:" << w2 << " return TRUE" << endl;
return true;
}
else
{
if (w2.region_ < region_)
{
label oldRegion = region_;
operator=(w2);
Pout<< "update : " << *this << " was:" << oldRegion
<< " w2:" << w2 << " return TRUE" << endl;
return true;
return true;
}
else
{
Pout<< "update : " << *this
<< " w2:" << w2 << " return FALSE" << endl;
return false;
}
}

View File

@ -58,7 +58,7 @@ Description
<pureSolidMixture
<constIsoSolidTransport
<constSolidRad
<specieThermo
<thermo
<hConstThermo<incompressible>,sensibleEnthalpy>
>
>

View File

@ -105,6 +105,7 @@ public:
//- Selector
static autoPtr<basicThermo> New(const fvMesh&);
//- Destructor
virtual ~basicThermo();

View File

@ -80,6 +80,7 @@ public:
//- Selector
static autoPtr<fluidThermo> New(const fvMesh&);
//- Destructor
virtual ~fluidThermo();

View File

@ -25,18 +25,19 @@ InClass
Foam::fluidThermo
Description
Macros for creating 'basic' density-based thermo packages
Macros for creating basic fluid thermo packages
\*---------------------------------------------------------------------------*/
#ifndef makeThermo_H
#define makeThermo_H
#include "fluidThermo.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeThermo(BaseThermo,Cthermo,Mixture,Transport,Type,Thermo,EqnOfState)\
#define makeThermo(BaseThermo,Cthermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie)\
\
typedef Cthermo \
< \
@ -44,88 +45,53 @@ typedef Cthermo \
< \
Transport \
< \
specieThermo \
species::thermo \
< \
Thermo \
< \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
> \
> \
> Cthermo##Mixture##Transport##Type##Thermo##EqnOfState; \
> Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \
\
defineTemplateTypeNameAndDebugWithName \
( \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState, \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
#Cthermo \
"<" \
#Mixture \
"<" \
#Transport \
"<specieThermo<" \
"<" \
#Thermo \
"<" \
#EqnOfState \
"<" \
#Specie \
">" \
">," \
#Type \
">>>>", \
">>>", \
0 \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState, \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
fluidThermo, \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState, \
fvMesh \
);
#define makePolyThermo(BaseThermo,Cthermo,Mixture,Order,Type) \
\
typedef polynomialTransport \
< \
specieThermo \
< \
hPolynomialThermo \
< \
icoPolynomial<Order>, \
Order \
>, \
Type \
>, \
Order \
> icoPoly##Order##Type##ThermoPhysics; \
\
typedef Cthermo<Mixture<icoPoly##Order##Type##ThermoPhysics> > \
Cthermo##Mixture##icoPoly##Order##Type##ThermoPhysics; \
\
defineTemplateTypeNameAndDebugWithName \
( \
Cthermo##Mixture##icoPoly##Order##Type##ThermoPhysics, \
#Cthermo"<"#Mixture"<icoPoly"#Order#Type"ThermoPhysics>>", \
0 \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##icoPoly##Order##Type##ThermoPhysics, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
fluidThermo, \
Cthermo##Mixture##icoPoly##Order##Type##ThermoPhysics, \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
fvMesh \
);

View File

@ -31,6 +31,7 @@ Description
#include "basicMixture.H"
#include "makeBasicMixture.H"
#include "specie.H"
#include "perfectGas.H"
#include "rhoConst.H"
#include "incompressiblePerfectGas.H"
@ -41,7 +42,7 @@ Description
#include "janafThermo.H"
#include "sensibleInternalEnergy.H"
#include "sensibleEnthalpy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "constTransport.H"
#include "sutherlandTransport.H"
@ -67,7 +68,8 @@ makeBasicMixture
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -76,7 +78,8 @@ makeBasicMixture
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -85,7 +88,8 @@ makeBasicMixture
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -94,31 +98,28 @@ makeBasicMixture
constTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
rhoConst,
specie
);
makeBasicPolyMixture
makeBasicMixture
(
pureMixture,
3,
sensibleEnthalpy
polynomialTransport,
sensibleEnthalpy,
hPolynomialThermo,
icoPolynomial,
specie
);
makeBasicPolyMixture
(
pureMixture,
8,
sensibleEnthalpy
);
makeBasicMixture
(
pureMixture,
constTransport,
sensibleEnthalpy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeBasicMixture
@ -127,7 +128,8 @@ makeBasicMixture
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeBasicMixture
@ -136,7 +138,8 @@ makeBasicMixture
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
@ -148,7 +151,8 @@ makeBasicMixture
constTransport,
sensibleInternalEnergy,
eConstThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -157,7 +161,8 @@ makeBasicMixture
sutherlandTransport,
sensibleInternalEnergy,
eConstThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -166,7 +171,8 @@ makeBasicMixture
constTransport,
sensibleInternalEnergy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -175,7 +181,8 @@ makeBasicMixture
sutherlandTransport,
sensibleInternalEnergy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -184,7 +191,8 @@ makeBasicMixture
sutherlandTransport,
sensibleInternalEnergy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeBasicMixture
@ -193,31 +201,28 @@ makeBasicMixture
constTransport,
sensibleInternalEnergy,
hConstThermo,
rhoConst
rhoConst,
specie
);
makeBasicPolyMixture
makeBasicMixture
(
pureMixture,
3,
sensibleInternalEnergy
polynomialTransport,
sensibleInternalEnergy,
hPolynomialThermo,
icoPolynomial,
specie
);
makeBasicPolyMixture
(
pureMixture,
8,
sensibleInternalEnergy
);
makeBasicMixture
(
pureMixture,
constTransport,
sensibleInternalEnergy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeBasicMixture
@ -226,7 +231,8 @@ makeBasicMixture
sutherlandTransport,
sensibleInternalEnergy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeBasicMixture
@ -235,7 +241,8 @@ makeBasicMixture
sutherlandTransport,
sensibleInternalEnergy,
janafThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);

View File

@ -25,6 +25,7 @@ InClass
Foam::basicMixture
Description
Macros for creating 'basic' mixtures for basic fluid thermo packages
\*---------------------------------------------------------------------------*/
@ -32,44 +33,19 @@ Description
#define makeBasicMixture_H
#include "basicMixture.H"
#include "sensibleEnthalpy.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeBasicMixture(Mixture,Transport,Type,Thermo,EqnOfState) \
#define makeBasicMixture(Mixture,Transport,Type,Thermo,EqnOfState,Specie) \
\
typedef \
Mixture<Transport<specieThermo<Thermo<EqnOfState>, Type> > > \
Mixture##Transport##Type##Thermo##EqnOfState; \
Mixture<Transport<species::thermo<Thermo<EqnOfState<Specie> >, Type> > > \
Mixture##Transport##Type##Thermo##EqnOfState##Specie; \
\
defineTemplateTypeNameAndDebugWithName \
(Mixture##Transport##Type##Thermo##EqnOfState, \
#Mixture"<"#Transport"<specieThermo<"#Thermo"<"#EqnOfState">,"#Type">>>", 0)
#define makeBasicPolyMixture(Mixture,Order,Type) \
\
typedef polynomialTransport \
< \
specieThermo \
< \
hPolynomialThermo \
< \
icoPolynomial<Order>, \
Order \
>, \
Type \
>, \
Order \
> icoPoly##Order##Type##ThermoPhysics; \
\
typedef Mixture<icoPoly##Order##Type##ThermoPhysics> \
Mixture##icoPoly##Order##Type##ThermoPhysics; \
\
defineTemplateTypeNameAndDebugWithName \
(Mixture##icoPoly##Order##Type##ThermoPhysics, \
#Mixture"<icoPoly"#Order#Type"ThermoPhysics>", 0)
(Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
#Mixture"<"#Transport"<"#Thermo"<"#EqnOfState"<"#Specie">>,"#Type">>", 0)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -26,14 +26,14 @@ License
#include "psiThermo.H"
#include "makeThermo.H"
#include "specie.H"
#include "perfectGas.H"
#include "hConstThermo.H"
#include "eConstThermo.H"
#include "janafThermo.H"
#include "sensibleEnthalpy.H"
#include "sensibleInternalEnergy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "constTransport.H"
#include "sutherlandTransport.H"
@ -56,7 +56,8 @@ makeThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -67,7 +68,8 @@ makeThermo
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -78,7 +80,8 @@ makeThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
@ -92,7 +95,8 @@ makeThermo
constTransport,
sensibleInternalEnergy,
eConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -103,7 +107,8 @@ makeThermo
sutherlandTransport,
sensibleInternalEnergy,
eConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -114,7 +119,8 @@ makeThermo
constTransport,
sensibleInternalEnergy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -125,7 +131,8 @@ makeThermo
sutherlandTransport,
sensibleInternalEnergy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -136,7 +143,8 @@ makeThermo
sutherlandTransport,
sensibleInternalEnergy,
janafThermo,
perfectGas
perfectGas,
specie
);

View File

@ -32,33 +32,56 @@ Foam::autoPtr<Foam::psiThermo> Foam::psiThermo::New
const fvMesh& mesh
)
{
// get model name, but do not register the dictionary
// otherwise it is registered in the database twice
const word modelType
IOdictionary thermoDict
(
IOdictionary
IOobject
(
IOobject
(
"thermophysicalProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).lookup("thermoType")
"thermophysicalProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);
Info<< "Selecting thermodynamics package " << modelType << endl;
word thermoTypeName;
if (thermoDict.isDict("thermoType"))
{
const dictionary& thermoTypeDict(thermoDict.subDict("thermoType"));
word type(thermoTypeDict.lookup("type"));
word mixture(thermoTypeDict.lookup("mixture"));
word transport(thermoTypeDict.lookup("transport"));
word thermo(thermoTypeDict.lookup("thermo"));
word energy(thermoTypeDict.lookup("energy"));
word equationOfState(thermoTypeDict.lookup("equationOfState"));
word specie(thermoTypeDict.lookup("specie"));
thermoTypeName =
type + '<'
+ mixture + '<'
+ transport + '<'
+ thermo + '<'
+ equationOfState + '<'
+ specie + ">>,"
+ energy + ">>>";
}
else
{
thermoTypeName = word(thermoDict.lookup("thermoType"));
}
Info<< "Selecting thermodynamics package " << thermoTypeName << endl;
fvMeshConstructorTable::iterator cstrIter =
fvMeshConstructorTablePtr_->find(modelType);
fvMeshConstructorTablePtr_->find(thermoTypeName);
if (cstrIter == fvMeshConstructorTablePtr_->end())
{
FatalErrorIn("psiThermo::New(const fvMesh&)")
<< "Unknown psiThermo type " << modelType << nl << nl
<< "Unknown psiThermo type " << thermoTypeName << nl << nl
<< "Valid psiThermo types are:" << nl
<< fvMeshConstructorTablePtr_->sortedToc() << nl
<< exit(FatalError);

View File

@ -26,15 +26,15 @@ License
#include "rhoThermo.H"
#include "makeThermo.H"
#include "specie.H"
#include "perfectGas.H"
#include "incompressiblePerfectGas.H"
#include "rhoConst.H"
#include "hConstThermo.H"
#include "janafThermo.H"
#include "sensibleEnthalpy.H"
#include "sensibleInternalEnergy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "constTransport.H"
#include "sutherlandTransport.H"
@ -61,7 +61,8 @@ makeThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -72,7 +73,8 @@ makeThermo
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -83,7 +85,8 @@ makeThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -94,25 +97,20 @@ makeThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
rhoConst,
specie
);
makePolyThermo
makeThermo
(
rhoThermo,
heRhoThermo,
pureMixture,
3,
sensibleEnthalpy
);
makePolyThermo
(
rhoThermo,
heRhoThermo,
pureMixture,
8,
sensibleEnthalpy
polynomialTransport,
sensibleEnthalpy,
hPolynomialThermo,
icoPolynomial,
specie
);
makeThermo
@ -123,7 +121,8 @@ makeThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeThermo
@ -134,7 +133,8 @@ makeThermo
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeThermo
@ -145,7 +145,8 @@ makeThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
@ -159,7 +160,8 @@ makeThermo
constTransport,
sensibleInternalEnergy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -170,7 +172,8 @@ makeThermo
sutherlandTransport,
sensibleInternalEnergy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -181,7 +184,8 @@ makeThermo
sutherlandTransport,
sensibleInternalEnergy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeThermo
@ -192,25 +196,20 @@ makeThermo
constTransport,
sensibleInternalEnergy,
hConstThermo,
rhoConst
rhoConst,
specie
);
makePolyThermo
makeThermo
(
rhoThermo,
heRhoThermo,
pureMixture,
3,
sensibleInternalEnergy
);
makePolyThermo
(
rhoThermo,
heRhoThermo,
pureMixture,
8,
sensibleInternalEnergy
polynomialTransport,
sensibleInternalEnergy,
hPolynomialThermo,
icoPolynomial,
specie
);
makeThermo
@ -221,7 +220,8 @@ makeThermo
constTransport,
sensibleInternalEnergy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeThermo
@ -232,7 +232,8 @@ makeThermo
sutherlandTransport,
sensibleInternalEnergy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeThermo
@ -243,7 +244,8 @@ makeThermo
sutherlandTransport,
sensibleInternalEnergy,
janafThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -619,7 +619,7 @@ bool finishReaction = false;
currentSpecieName,
new gasThermoPhysics
(
janafThermo<perfectGas>
janafThermo<perfectGas<specie> >
(
specie
(

View File

@ -31,7 +31,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReactionThermo(BaseThermo,CThermo,MixtureThermo,Mixture,Transport,Type,Thermo,EqnOfState) \
#define makeReactionThermo(BaseThermo,CThermo,MixtureThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \
\
typedef MixtureThermo \
< \
@ -41,48 +41,54 @@ typedef MixtureThermo \
< \
Transport \
< \
specieThermo \
species::thermo \
< \
Thermo \
< \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
> \
> \
> \
> MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState; \
> MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \
\
defineTemplateTypeNameAndDebugWithName \
( \
MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState, \
MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
#MixtureThermo \
"<" \
#Mixture \
"<" \
#Transport \
"<specieThermo<" \
"<" \
#Thermo \
"<" \
#EqnOfState \
"<" \
#Specie \
">" \
">," \
#Type \
">>>>", \
">>>", \
0 \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState, \
MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
CThermo, \
MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState, \
MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
fvMesh \
)

View File

@ -71,20 +71,20 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
(
const dictionary& thermoDict,
const wordList& specieNames,
const HashPtrTable<ThermoType>& specieThermoData,
const HashPtrTable<ThermoType>& thermoData,
const fvMesh& mesh
)
:
basicMultiComponentMixture(thermoDict, specieNames, mesh),
speciesData_(species_.size()),
mixture_("mixture", *specieThermoData[specieNames[0]])
mixture_("mixture", *thermoData[specieNames[0]])
{
forAll(species_, i)
{
speciesData_.set
(
i,
new ThermoType(*specieThermoData[species_[i]])
new ThermoType(*thermoData[species_[i]])
);
}

View File

@ -87,7 +87,7 @@ public:
(
const dictionary&,
const wordList& specieNames,
const HashPtrTable<ThermoType>& specieThermoData,
const HashPtrTable<ThermoType>& thermoData,
const fvMesh&
);

View File

@ -28,13 +28,12 @@ License
#include "psiReactionThermo.H"
#include "hePsiReactionThermo.H"
#include "specie.H"
#include "perfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
#include "sensibleEnthalpy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "constTransport.H"
#include "sutherlandTransport.H"
@ -65,7 +64,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -77,7 +77,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -89,7 +90,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
@ -104,7 +106,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -116,7 +119,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -128,7 +132,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
@ -143,7 +148,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -155,7 +161,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -167,7 +174,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);

View File

@ -29,13 +29,12 @@ License
#include "makeReactionThermo.H"
#include "addToRunTimeSelectionTable.H"
#include "specie.H"
#include "perfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
#include "absoluteEnthalpy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "constTransport.H"
#include "sutherlandTransport.H"
@ -62,7 +61,8 @@ makeReactionThermo
constTransport,
absoluteEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -74,7 +74,8 @@ makeReactionThermo
constTransport,
absoluteEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -86,7 +87,8 @@ makeReactionThermo
constTransport,
absoluteEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -98,7 +100,8 @@ makeReactionThermo
sutherlandTransport,
absoluteEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -110,7 +113,8 @@ makeReactionThermo
sutherlandTransport,
absoluteEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -122,7 +126,8 @@ makeReactionThermo
sutherlandTransport,
absoluteEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -134,7 +139,8 @@ makeReactionThermo
constTransport,
absoluteEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -146,7 +152,8 @@ makeReactionThermo
sutherlandTransport,
absoluteEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);

View File

@ -28,13 +28,13 @@ License
#include "rhoReactionThermo.H"
#include "heRhoReactionThermo.H"
#include "specie.H"
#include "perfectGas.H"
#include "incompressiblePerfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
#include "sensibleEnthalpy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "constTransport.H"
#include "sutherlandTransport.H"
@ -64,7 +64,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -76,7 +77,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -88,7 +90,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -100,7 +103,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -112,7 +116,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
makeReactionThermo
@ -124,7 +129,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
perfectGas,
specie
);
@ -137,7 +143,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeReactionThermo
@ -149,7 +156,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeReactionThermo
@ -161,7 +169,8 @@ makeReactionThermo
constTransport,
sensibleEnthalpy,
hConstThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeReactionThermo
@ -173,7 +182,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeReactionThermo
@ -185,7 +195,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);
makeReactionThermo
@ -197,7 +208,8 @@ makeReactionThermo
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
incompressiblePerfectGas
incompressiblePerfectGas,
specie
);

View File

@ -32,19 +32,16 @@ Description
#ifndef solidThermoPhysicsTypes_H
#define solidThermoPhysicsTypes_H
#include "specie.H"
#include "rhoConst.H"
#include "hConstThermo.H"
#include "hExponentialThermo.H"
#include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H"
#include "constSolidRad.H"
#include "sensibleEnthalpy.H"
#include "specieThermo.H"
#include "thermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,11 +52,11 @@ namespace Foam
<
constSolidRad
<
specieThermo
species::thermo
<
hConstThermo
<
rhoConst
rhoConst<specie>
>,
sensibleEnthalpy
>
@ -72,11 +69,11 @@ namespace Foam
<
constSolidRad
<
specieThermo
species::thermo
<
hExponentialThermo
<
rhoConst
rhoConst<specie>
>,
sensibleEnthalpy
>

View File

@ -26,24 +26,20 @@ License
#include "makeSolidThermo.H"
#include "specie.H"
#include "rhoConst.H"
#include "hConstThermo.H"
#include "hExponentialThermo.H"
#include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H"
#include "constSolidRad.H"
#include "pureSolidMixture.H"
#include "multiComponentSolidMixture.H"
#include "reactingSolidMixture.H"
#include "sensibleEnthalpy.H"
#include "sensibleInternalEnergy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "heThermo.H"
@ -67,7 +63,8 @@ makeSolidThermo
constSolidRad,
sensibleEnthalpy,
hConstThermo,
rhoConst
rhoConst,
specie
);
makeSolidThermo
@ -79,7 +76,8 @@ makeSolidThermo
constSolidRad,
sensibleEnthalpy,
hConstThermo,
rhoConst
rhoConst,
specie
);
makeSolidThermo
@ -91,7 +89,8 @@ makeSolidThermo
constSolidRad,
sensibleEnthalpy,
hExponentialThermo,
rhoConst
rhoConst,
specie
);
makeSolidThermo
@ -103,7 +102,8 @@ makeSolidThermo
constSolidRad,
sensibleEnthalpy,
hConstThermo,
rhoConst
rhoConst,
specie
);
makeSolidThermo
@ -115,7 +115,8 @@ makeSolidThermo
constSolidRad,
sensibleEnthalpy,
hConstThermo,
rhoConst
rhoConst,
specie
);

View File

@ -43,7 +43,7 @@ Description
#include "sensibleInternalEnergy.H"
#include "sensibleEnthalpy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "pureSolidMixture.H"
#include "multiComponentSolidMixture.H"

View File

@ -36,10 +36,8 @@ Description
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
#define makeSolidThermo(BaseThermo,Cthermo,Mixture,Transport,Radiation,Type,Thermo,Rho)\
#define makeSolidThermo(BaseThermo,Cthermo,Mixture,Transport,Radiation,Type,Thermo,EqnOfState,Specie)\
\
typedef Cthermo \
< \
@ -49,11 +47,14 @@ typedef Cthermo \
< \
Radiation \
< \
specieThermo \
species::thermo \
< \
Thermo \
< \
Rho \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
@ -61,11 +62,13 @@ typedef Cthermo \
> \
>, \
BaseThermo \
> Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo; \
> Cthermo##Mixture##Transport##Radiation##Type##Thermo \
##EqnOfState##Specie##BaseThermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo \
##EqnOfState##Specie##BaseThermo, \
#Cthermo \
"<" \
#Mixture \
@ -73,14 +76,16 @@ defineTemplateTypeNameAndDebugWithName \
#Transport \
"<" \
#Radiation \
"<specieThermo<" \
"<" \
#Thermo \
"<" \
#Rho \
#EqnOfState \
"<" \
#Specie \
">" \
">," \
#Type \
">>>>" \
">", \
">>>>", \
0 \
); \
\
@ -91,61 +96,65 @@ typedef Mixture \
< \
Radiation \
< \
specieThermo \
species::thermo \
< \
Thermo \
< \
Rho \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
> \
> \
> Mixture##Transport##Radiation##Type##Thermo##Rho; \
\
> Mixture##Transport##Radiation##Type##Thermo##EqnOfState##Specie; \
\
\
defineTemplateTypeNameAndDebugWithName \
( \
Mixture##Transport##Radiation##Type##Thermo##Rho, \
Mixture##Transport##Radiation##Type##Thermo##EqnOfState##Specie, \
#Mixture \
"<" \
#Transport \
"<" \
#Radiation \
"<specieThermo<" \
"<" \
#Thermo \
"<" \
#Rho \
#EqnOfState \
">," \
#Type \
">>>>", \
">>>", \
0 \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo \
##EqnOfState##Specie##BaseThermo, \
mesh \
); \
\
addToRunTimeSelectionTable \
( \
basicThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
basicThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo \
##EqnOfState##Specie##BaseThermo, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo \
##EqnOfState##Specie##BaseThermo, \
dictionary \
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -5,9 +5,6 @@ reactions = reaction/reactions
$(atomicWeights)/atomicWeights.C
$(specie)/specie.C
$(equationOfState)/perfectGas/perfectGas.C
$(equationOfState)/rhoConst/rhoConst.C
$(equationOfState)/incompressiblePerfectGas/incompressiblePerfectGas.C
$(reactions)/makeReactionThermoReactions.C
$(reactions)/makeLangmuirHinshelwoodReactions.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,20 +33,20 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<int PolySize>
icoPolynomial<PolySize>::icoPolynomial(Istream& is)
template<class Specie, int PolySize>
icoPolynomial<Specie, PolySize>::icoPolynomial(Istream& is)
:
specie(is),
Specie(is),
rhoCoeffs_("rhoCoeffs<" + Foam::name(PolySize) + '>', is)
{
rhoCoeffs_ *= this->W();
}
template<int PolySize>
icoPolynomial<PolySize>::icoPolynomial(const dictionary& dict)
template<class Specie, int PolySize>
icoPolynomial<Specie, PolySize>::icoPolynomial(const dictionary& dict)
:
specie(dict),
Specie(dict),
rhoCoeffs_
(
dict.subDict("equationOfState").lookup
@ -61,10 +61,10 @@ icoPolynomial<PolySize>::icoPolynomial(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<int PolySize>
void icoPolynomial<PolySize>::write(Ostream& os) const
template<class Specie, int PolySize>
void icoPolynomial<Specie, PolySize>::write(Ostream& os) const
{
specie::write(os);
Specie::write(os);
dictionary dict("equationOfState");
dict.add
@ -79,16 +79,17 @@ void icoPolynomial<PolySize>::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<int PolySize>
Ostream& operator<<(Ostream& os, const icoPolynomial<PolySize>& ip)
template<class Specie, int PolySize>
Ostream& operator<<(Ostream& os, const icoPolynomial<Specie, PolySize>& ip)
{
os << static_cast<const specie&>(ip) << tab
os << static_cast<const Specie&>(ip) << tab
<< "rhoCoeffs<" << Foam::name(PolySize) << '>' << tab
<< ip.rhoCoeffs_/ip.W();
os.check
(
"Ostream& operator<<(Ostream& os, const icoPolynomial<PolySize>& ip)"
"Ostream& operator<<"
"(Ostream& os, const icoPolynomial<Specie, PolySize>& ip)"
);
return os;

View File

@ -37,7 +37,6 @@ SourceFiles
#ifndef icoPolynomial_H
#define icoPolynomial_H
#include "specie.H"
#include "autoPtr.H"
#include "Polynomial.H"
@ -48,42 +47,42 @@ namespace Foam
// Forward declaration of friend functions and operators
template<int PolySize>
template<class Specie, int PolySize>
class icoPolynomial;
template<int PolySize>
icoPolynomial<PolySize> operator+
template<class Specie, int PolySize>
icoPolynomial<Specie, PolySize> operator+
(
const icoPolynomial<PolySize>&,
const icoPolynomial<PolySize>&
const icoPolynomial<Specie, PolySize>&,
const icoPolynomial<Specie, PolySize>&
);
template<int PolySize>
icoPolynomial<PolySize> operator-
template<class Specie, int PolySize>
icoPolynomial<Specie, PolySize> operator-
(
const icoPolynomial<PolySize>&,
const icoPolynomial<PolySize>&
const icoPolynomial<Specie, PolySize>&,
const icoPolynomial<Specie, PolySize>&
);
template<int PolySize>
icoPolynomial<PolySize> operator*
template<class Specie, int PolySize>
icoPolynomial<Specie, PolySize> operator*
(
const scalar,
const icoPolynomial<PolySize>&
const icoPolynomial<Specie, PolySize>&
);
template<int PolySize>
icoPolynomial<PolySize> operator==
template<class Specie, int PolySize>
icoPolynomial<Specie, PolySize> operator==
(
const icoPolynomial<PolySize>&,
const icoPolynomial<PolySize>&
const icoPolynomial<Specie, PolySize>&,
const icoPolynomial<Specie, PolySize>&
);
template<int PolySize>
template<class Specie, int PolySize>
Ostream& operator<<
(
Ostream&,
const icoPolynomial<PolySize>&
const icoPolynomial<Specie, PolySize>&
);
@ -91,10 +90,10 @@ Ostream& operator<<
Class icoPolynomial Declaration
\*---------------------------------------------------------------------------*/
template<int PolySize>
template<class Specie, int PolySize=8>
class icoPolynomial
:
public specie
public Specie
{
// Private data
@ -110,7 +109,7 @@ public:
//- Construct from components
inline icoPolynomial
(
const specie& sp,
const Specie& sp,
const Polynomial<PolySize>& rhoPoly
);
@ -176,25 +175,25 @@ public:
// Friend operators
friend icoPolynomial operator+ <PolySize>
friend icoPolynomial operator+ <Specie, PolySize>
(
const icoPolynomial&,
const icoPolynomial&
);
friend icoPolynomial operator- <PolySize>
friend icoPolynomial operator- <Specie, PolySize>
(
const icoPolynomial&,
const icoPolynomial&
);
friend icoPolynomial operator* <PolySize>
friend icoPolynomial operator* <Specie, PolySize>
(
const scalar s,
const icoPolynomial&
);
friend icoPolynomial operator== <PolySize>
friend icoPolynomial operator== <Specie, PolySize>
(
const icoPolynomial&,
const icoPolynomial&
@ -203,7 +202,11 @@ public:
// Ostream Operator
friend Ostream& operator<< <PolySize>(Ostream&, const icoPolynomial&);
friend Ostream& operator<< <Specie, PolySize>
(
Ostream&,
const icoPolynomial&
);
};
@ -217,7 +220,7 @@ public:
\
defineTemplateTypeNameAndDebugWithName \
( \
icoPolynomial<PolySize>, \
icoPolynomial<Specie, PolySize>, \
"icoPolynomial<"#PolySize">", \
0 \
);

View File

@ -27,98 +27,113 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<int PolySize>
inline Foam::icoPolynomial<PolySize>::icoPolynomial
template<class Specie, int PolySize>
inline Foam::icoPolynomial<Specie, PolySize>::icoPolynomial
(
const specie& sp,
const Specie& sp,
const Polynomial<PolySize>& rhoCoeffs
)
:
specie(sp),
Specie(sp),
rhoCoeffs_(rhoCoeffs)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<int PolySize>
inline Foam::icoPolynomial<PolySize>::icoPolynomial
template<class Specie, int PolySize>
inline Foam::icoPolynomial<Specie, PolySize>::icoPolynomial
(
const icoPolynomial<PolySize>& ip
const icoPolynomial<Specie, PolySize>& ip
)
:
specie(ip),
Specie(ip),
rhoCoeffs_(ip.rhoCoeffs_)
{}
template<int PolySize>
inline Foam::icoPolynomial<PolySize>::icoPolynomial
template<class Specie, int PolySize>
inline Foam::icoPolynomial<Specie, PolySize>::icoPolynomial
(
const word& name,
const icoPolynomial<PolySize>& ip
const icoPolynomial<Specie, PolySize>& ip
)
:
specie(name, ip),
Specie(name, ip),
rhoCoeffs_(ip.rhoCoeffs_)
{}
template<int PolySize>
inline Foam::autoPtr<Foam::icoPolynomial<PolySize> >
Foam::icoPolynomial<PolySize>::clone() const
template<class Specie, int PolySize>
inline Foam::autoPtr<Foam::icoPolynomial<Specie, PolySize> >
Foam::icoPolynomial<Specie, PolySize>::clone() const
{
return autoPtr<icoPolynomial<PolySize> >
return autoPtr<icoPolynomial<Specie, PolySize> >
(
new icoPolynomial<PolySize>(*this)
new icoPolynomial<Specie, PolySize>(*this)
);
}
template<int PolySize>
inline Foam::autoPtr<Foam::icoPolynomial<PolySize> >
Foam::icoPolynomial<PolySize>::New(Istream& is)
template<class Specie, int PolySize>
inline Foam::autoPtr<Foam::icoPolynomial<Specie, PolySize> >
Foam::icoPolynomial<Specie, PolySize>::New(Istream& is)
{
return autoPtr<icoPolynomial<PolySize> >(new icoPolynomial<PolySize>(is));
return autoPtr<icoPolynomial<Specie, PolySize> >
(
new icoPolynomial<Specie, PolySize>(is)
);
}
template<int PolySize>
inline Foam::autoPtr<Foam::icoPolynomial<PolySize> >
Foam::icoPolynomial<PolySize>::New(const dictionary& dict)
template<class Specie, int PolySize>
inline Foam::autoPtr<Foam::icoPolynomial<Specie, PolySize> >
Foam::icoPolynomial<Specie, PolySize>::New(const dictionary& dict)
{
return autoPtr<icoPolynomial<PolySize> >
return autoPtr<icoPolynomial<Specie, PolySize> >
(
new icoPolynomial<PolySize>(dict)
new icoPolynomial<Specie, PolySize>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<int PolySize>
inline Foam::scalar Foam::icoPolynomial<PolySize>::rho(scalar, scalar T) const
template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::rho
(
scalar,
scalar T
) const
{
return rhoCoeffs_.value(T)/this->W();
}
template<int PolySize>
inline Foam::scalar Foam::icoPolynomial<PolySize>::psi(scalar, scalar) const
template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::psi
(
scalar,
scalar
) const
{
return 0.0;
}
template<int PolySize>
inline Foam::scalar Foam::icoPolynomial<PolySize>::Z(scalar, scalar) const
template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::Z
(
scalar,
scalar
) const
{
return 0.0;
}
template<int PolySize>
inline Foam::scalar Foam::icoPolynomial<PolySize>::cpMcv
template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::cpMcv
(
scalar p,
scalar T
@ -130,13 +145,14 @@ inline Foam::scalar Foam::icoPolynomial<PolySize>::cpMcv
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<int PolySize>
inline Foam::icoPolynomial<PolySize>& Foam::icoPolynomial<PolySize>::operator=
template<class Specie, int PolySize>
inline Foam::icoPolynomial<Specie, PolySize>&
Foam::icoPolynomial<Specie, PolySize>::operator=
(
const icoPolynomial<PolySize>& ip
const icoPolynomial<Specie, PolySize>& ip
)
{
specie::operator=(ip);
Specie::operator=(ip);
rhoCoeffs_ = ip.rhoCoeffs_;
@ -144,15 +160,15 @@ inline Foam::icoPolynomial<PolySize>& Foam::icoPolynomial<PolySize>::operator=
}
template<int PolySize>
inline void Foam::icoPolynomial<PolySize>::operator+=
template<class Specie, int PolySize>
inline void Foam::icoPolynomial<Specie, PolySize>::operator+=
(
const icoPolynomial<PolySize>& ip
const icoPolynomial<Specie, PolySize>& ip
)
{
scalar molr1 = this->nMoles();
specie::operator+=(ip);
Specie::operator+=(ip);
molr1 /= this->nMoles();
scalar molr2 = ip.nMoles()/this->nMoles();
@ -161,15 +177,15 @@ inline void Foam::icoPolynomial<PolySize>::operator+=
}
template<int PolySize>
inline void Foam::icoPolynomial<PolySize>::operator-=
template<class Specie, int PolySize>
inline void Foam::icoPolynomial<Specie, PolySize>::operator-=
(
const icoPolynomial<PolySize>& ip
const icoPolynomial<Specie, PolySize>& ip
)
{
scalar molr1 = this->nMoles();
specie::operator-=(ip);
Specie::operator-=(ip);
molr1 /= this->nMoles();
scalar molr2 = ip.nMoles()/this->nMoles();
@ -178,75 +194,75 @@ inline void Foam::icoPolynomial<PolySize>::operator-=
}
template<int PolySize>
inline void Foam::icoPolynomial<PolySize>::operator*=(const scalar s)
template<class Specie, int PolySize>
inline void Foam::icoPolynomial<Specie, PolySize>::operator*=(const scalar s)
{
specie::operator*=(s);
Specie::operator*=(s);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<int PolySize>
Foam::icoPolynomial<PolySize> Foam::operator+
template<class Specie, int PolySize>
Foam::icoPolynomial<Specie, PolySize> Foam::operator+
(
const icoPolynomial<PolySize>& ip1,
const icoPolynomial<PolySize>& ip2
const icoPolynomial<Specie, PolySize>& ip1,
const icoPolynomial<Specie, PolySize>& ip2
)
{
scalar nMoles = ip1.nMoles() + ip2.nMoles();
scalar molr1 = ip1.nMoles()/nMoles;
scalar molr2 = ip2.nMoles()/nMoles;
return icoPolynomial<PolySize>
return icoPolynomial<Specie, PolySize>
(
static_cast<const specie&>(ip1)
+ static_cast<const specie&>(ip2),
static_cast<const Specie&>(ip1)
+ static_cast<const Specie&>(ip2),
molr1*ip1.rhoCoeffs_ + molr2*ip2.rhoCoeffs_
);
}
template<int PolySize>
Foam::icoPolynomial<PolySize> Foam::operator-
template<class Specie, int PolySize>
Foam::icoPolynomial<Specie, PolySize> Foam::operator-
(
const icoPolynomial<PolySize>& ip1,
const icoPolynomial<PolySize>& ip2
const icoPolynomial<Specie, PolySize>& ip1,
const icoPolynomial<Specie, PolySize>& ip2
)
{
scalar nMoles = ip1.nMoles() + ip2.nMoles();
scalar molr1 = ip1.nMoles()/nMoles;
scalar molr2 = ip2.nMoles()/nMoles;
return icoPolynomial<PolySize>
return icoPolynomial<Specie, PolySize>
(
static_cast<const specie&>(ip1)
- static_cast<const specie&>(ip2),
static_cast<const Specie&>(ip1)
- static_cast<const Specie&>(ip2),
molr1*ip1.rhoCoeffs_ - molr2*ip2.rhoCoeffs_
);
}
template<int PolySize>
Foam::icoPolynomial<PolySize> Foam::operator*
template<class Specie, int PolySize>
Foam::icoPolynomial<Specie, PolySize> Foam::operator*
(
const scalar s,
const icoPolynomial<PolySize>& ip
const icoPolynomial<Specie, PolySize>& ip
)
{
return icoPolynomial<PolySize>
return icoPolynomial<Specie, PolySize>
(
s*static_cast<const specie&>(ip),
s*static_cast<const Specie&>(ip),
ip.rhoCoeffs_
);
}
template<int PolySize>
Foam::icoPolynomial<PolySize> Foam::operator==
template<class Specie, int PolySize>
Foam::icoPolynomial<Specie, PolySize> Foam::operator==
(
const icoPolynomial<PolySize>& ip1,
const icoPolynomial<PolySize>& ip2
const icoPolynomial<Specie, PolySize>& ip1,
const icoPolynomial<Specie, PolySize>& ip2
)
{
return ip2 - ip1;

View File

@ -28,27 +28,37 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::incompressiblePerfectGas::incompressiblePerfectGas(Istream& is)
template<class Specie>
Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas(Istream& is)
:
specie(is),
Specie(is),
pRef_(readScalar(is))
{
is.check("incompressiblePerfectGas::incompressiblePerfectGas(Istream& is)");
is.check
(
"incompressiblePerfectGas<Specie>::"
"incompressiblePerfectGas(Istream& is)"
);
}
Foam::incompressiblePerfectGas::incompressiblePerfectGas(const dictionary& dict)
template<class Specie>
Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas
(
const dictionary& dict
)
:
specie(dict),
Specie(dict),
pRef_(readScalar(dict.subDict("equationOfState").lookup("pRef")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::incompressiblePerfectGas::write(Ostream& os) const
template<class Specie>
void Foam::incompressiblePerfectGas<Specie>::write(Ostream& os) const
{
specie::write(os);
Specie::write(os);
dictionary dict("equationOfState");
dict.add("pRef", pRef_);
@ -58,14 +68,20 @@ void Foam::incompressiblePerfectGas::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const incompressiblePerfectGas& pg)
template<class Specie>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const incompressiblePerfectGas<Specie>& pg
)
{
os << static_cast<const specie&>(pg)
os << static_cast<const Specie&>(pg)
<< token::SPACE << pg.pRef_;
os.check
(
"Ostream& operator<<(Ostream& os, const incompressiblePerfectGas& st)"
"Ostream& operator<<"
"(Ostream& os, const incompressiblePerfectGas<Specie>& st)"
);
return os;
}

View File

@ -38,7 +38,6 @@ SourceFiles
#ifndef incompressiblePerfectGas_H
#define incompressiblePerfectGas_H
#include "specie.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,13 +45,54 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Specie> class incompressiblePerfectGas;
template<class Specie>
inline incompressiblePerfectGas<Specie> operator+
(
const incompressiblePerfectGas<Specie>&,
const incompressiblePerfectGas<Specie>&
);
template<class Specie>
inline incompressiblePerfectGas<Specie> operator-
(
const incompressiblePerfectGas<Specie>&,
const incompressiblePerfectGas<Specie>&
);
template<class Specie>
inline incompressiblePerfectGas<Specie> operator*
(
const scalar,
const incompressiblePerfectGas<Specie>&
);
template<class Specie>
inline incompressiblePerfectGas<Specie> operator==
(
const incompressiblePerfectGas<Specie>&,
const incompressiblePerfectGas<Specie>&
);
template<class Specie>
Ostream& operator<<
(
Ostream&,
const incompressiblePerfectGas<Specie>&
);
/*---------------------------------------------------------------------------*\
Class incompressiblePerfectGas Declaration
\*---------------------------------------------------------------------------*/
template<class Specie>
class incompressiblePerfectGas
:
public specie
public Specie
{
// Private data
@ -65,7 +105,7 @@ public:
// Constructors
//- Construct from components
inline incompressiblePerfectGas(const specie& sp);
inline incompressiblePerfectGas(const Specie& sp);
//- Construct from Istream
incompressiblePerfectGas(Istream&);
@ -132,25 +172,25 @@ public:
// Friend operators
inline friend incompressiblePerfectGas operator+
friend incompressiblePerfectGas operator+ <Specie>
(
const incompressiblePerfectGas&,
const incompressiblePerfectGas&
);
inline friend incompressiblePerfectGas operator-
friend incompressiblePerfectGas operator- <Specie>
(
const incompressiblePerfectGas&,
const incompressiblePerfectGas&
);
inline friend incompressiblePerfectGas operator*
friend incompressiblePerfectGas operator* <Specie>
(
const scalar s,
const incompressiblePerfectGas&
);
inline friend incompressiblePerfectGas operator==
friend incompressiblePerfectGas operator== <Specie>
(
const incompressiblePerfectGas&,
const incompressiblePerfectGas&
@ -159,7 +199,11 @@ public:
// Ostream Operator
friend Ostream& operator<<(Ostream&, const incompressiblePerfectGas&);
friend Ostream& operator<< <Specie>
(
Ostream&,
const incompressiblePerfectGas&
);
};
@ -171,6 +215,10 @@ public:
#include "incompressiblePerfectGasI.H"
#ifdef NoRepository
# include "incompressiblePerfectGas.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -27,85 +27,109 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline Foam::incompressiblePerfectGas::incompressiblePerfectGas
template<class Specie>
inline Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas
(
const specie& sp
const Specie& sp
)
:
specie(sp)
Specie(sp)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::incompressiblePerfectGas::incompressiblePerfectGas
template<class Specie>
inline Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas
(
const word& name,
const incompressiblePerfectGas& pg
const incompressiblePerfectGas<Specie>& pg
)
:
specie(name, pg)
Specie(name, pg)
{}
inline Foam::autoPtr<Foam::incompressiblePerfectGas>
Foam::incompressiblePerfectGas::clone() const
template<class Specie>
inline Foam::autoPtr<Foam::incompressiblePerfectGas<Specie> >
Foam::incompressiblePerfectGas<Specie>::clone() const
{
return autoPtr<incompressiblePerfectGas>
return autoPtr<incompressiblePerfectGas<Specie> >
(
new incompressiblePerfectGas(*this)
new incompressiblePerfectGas<Specie>(*this)
);
}
inline Foam::autoPtr<Foam::incompressiblePerfectGas>
Foam::incompressiblePerfectGas::New
template<class Specie>
inline Foam::autoPtr<Foam::incompressiblePerfectGas<Specie> >
Foam::incompressiblePerfectGas<Specie>::New
(
Istream& is
)
{
return autoPtr<incompressiblePerfectGas>(new incompressiblePerfectGas(is));
return autoPtr<incompressiblePerfectGas<Specie> >
(
new incompressiblePerfectGas<Specie>(is)
);
}
inline Foam::autoPtr<Foam::incompressiblePerfectGas>
Foam::incompressiblePerfectGas::New
template<class Specie>
inline Foam::autoPtr<Foam::incompressiblePerfectGas<Specie> >
Foam::incompressiblePerfectGas<Specie>::New
(
const dictionary& dict
)
{
return autoPtr<incompressiblePerfectGas>
return autoPtr<incompressiblePerfectGas<Specie> >
(
new incompressiblePerfectGas(dict)
new incompressiblePerfectGas<Specie>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::scalar Foam::incompressiblePerfectGas::rho
template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::rho
(
scalar p,
scalar T
) const
{
return pRef_/(R()*T);
return pRef_/(this->R()*T);
}
inline Foam::scalar Foam::incompressiblePerfectGas::psi(scalar, scalar T) const
template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::psi
(
scalar,
scalar T
) const
{
return 0.0;
}
inline Foam::scalar Foam::incompressiblePerfectGas::Z(scalar, scalar) const
template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::Z
(
scalar,
scalar
) const
{
return 0.0;
}
inline Foam::scalar Foam::incompressiblePerfectGas::cpMcv(scalar, scalar) const
template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::cpMcv
(
scalar,
scalar
) const
{
return this->RR;
}
@ -114,74 +138,81 @@ inline Foam::scalar Foam::incompressiblePerfectGas::cpMcv(scalar, scalar) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void Foam::incompressiblePerfectGas::operator+=
template<class Specie>
inline void Foam::incompressiblePerfectGas<Specie>::operator+=
(
const incompressiblePerfectGas& pg
const incompressiblePerfectGas<Specie>& pg
)
{
specie::operator+=(pg);
Specie::operator+=(pg);
}
inline void Foam::incompressiblePerfectGas::operator-=
template<class Specie>
inline void Foam::incompressiblePerfectGas<Specie>::operator-=
(
const incompressiblePerfectGas& pg
const incompressiblePerfectGas<Specie>& pg
)
{
specie::operator-=(pg);
Specie::operator-=(pg);
}
inline void Foam::incompressiblePerfectGas::operator*=(const scalar s)
template<class Specie>
inline void Foam::incompressiblePerfectGas<Specie>::operator*=(const scalar s)
{
specie::operator*=(s);
Specie::operator*=(s);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline Foam::incompressiblePerfectGas Foam::operator+
template<class Specie>
inline Foam::incompressiblePerfectGas<Specie> Foam::operator+
(
const incompressiblePerfectGas& pg1,
const incompressiblePerfectGas& pg2
const incompressiblePerfectGas<Specie>& pg1,
const incompressiblePerfectGas<Specie>& pg2
)
{
return incompressiblePerfectGas
return incompressiblePerfectGas<Specie>
(
static_cast<const specie&>(pg1)
+ static_cast<const specie&>(pg2)
static_cast<const Specie&>(pg1)
+ static_cast<const Specie&>(pg2)
);
}
inline Foam::incompressiblePerfectGas Foam::operator-
template<class Specie>
inline Foam::incompressiblePerfectGas<Specie> Foam::operator-
(
const incompressiblePerfectGas& pg1,
const incompressiblePerfectGas& pg2
const incompressiblePerfectGas<Specie>& pg1,
const incompressiblePerfectGas<Specie>& pg2
)
{
return incompressiblePerfectGas
return incompressiblePerfectGas<Specie>
(
static_cast<const specie&>(pg1)
- static_cast<const specie&>(pg2)
static_cast<const Specie&>(pg1)
- static_cast<const Specie&>(pg2)
);
}
inline Foam::incompressiblePerfectGas Foam::operator*
template<class Specie>
inline Foam::incompressiblePerfectGas<Specie> Foam::operator*
(
const scalar s,
const incompressiblePerfectGas& pg
const incompressiblePerfectGas<Specie>& pg
)
{
return incompressiblePerfectGas(s*static_cast<const specie&>(pg));
return incompressiblePerfectGas<Specie>(s*static_cast<const Specie&>(pg));
}
inline Foam::incompressiblePerfectGas Foam::operator==
template<class Specie>
inline Foam::incompressiblePerfectGas<Specie> Foam::operator==
(
const incompressiblePerfectGas& pg1,
const incompressiblePerfectGas& pg2
const incompressiblePerfectGas<Specie>& pg1,
const incompressiblePerfectGas<Specie>& pg2
)
{
return pg2 - pg1;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,35 +28,39 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::perfectGas::perfectGas(Istream& is)
template<class Specie>
Foam::perfectGas<Specie>::perfectGas(Istream& is)
:
specie(is)
Specie(is)
{
is.check("perfectGas::perfectGas(Istream& is)");
is.check("perfectGas<Specie>::perfectGas(Istream& is)");
}
Foam::perfectGas::perfectGas(const dictionary& dict)
template<class Specie>
Foam::perfectGas<Specie>::perfectGas(const dictionary& dict)
:
specie(dict)
Specie(dict)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::perfectGas::write(Ostream& os) const
template<class Specie>
void Foam::perfectGas<Specie>::write(Ostream& os) const
{
specie::write(os);
Specie::write(os);
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const perfectGas& pg)
template<class Specie>
Foam::Ostream& Foam::operator<<(Ostream& os, const perfectGas<Specie>& pg)
{
os << static_cast<const specie&>(pg);
os << static_cast<const Specie&>(pg);
os.check("Ostream& operator<<(Ostream& os, const perfectGas& st)");
os.check("Ostream& operator<<(Ostream& os, const perfectGas<Specie>& st)");
return os;
}

View File

@ -36,7 +36,6 @@ SourceFiles
#ifndef perfectGas_H
#define perfectGas_H
#include "specie.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,13 +43,54 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Specie> class perfectGas;
template<class Specie>
inline perfectGas<Specie> operator+
(
const perfectGas<Specie>&,
const perfectGas<Specie>&
);
template<class Specie>
inline perfectGas<Specie> operator-
(
const perfectGas<Specie>&,
const perfectGas<Specie>&
);
template<class Specie>
inline perfectGas<Specie> operator*
(
const scalar,
const perfectGas<Specie>&
);
template<class Specie>
inline perfectGas<Specie> operator==
(
const perfectGas<Specie>&,
const perfectGas<Specie>&
);
template<class Specie>
Ostream& operator<<
(
Ostream&,
const perfectGas<Specie>&
);
/*---------------------------------------------------------------------------*\
Class perfectGas Declaration
\*---------------------------------------------------------------------------*/
template<class Specie>
class perfectGas
:
public specie
public Specie
{
public:
@ -58,7 +98,7 @@ public:
// Constructors
//- Construct from components
inline perfectGas(const specie& sp);
inline perfectGas(const Specie& sp);
//- Construct from Istream
perfectGas(Istream&);
@ -118,25 +158,25 @@ public:
// Friend operators
inline friend perfectGas operator+
friend perfectGas operator+ <Specie>
(
const perfectGas&,
const perfectGas&
);
inline friend perfectGas operator-
friend perfectGas operator- <Specie>
(
const perfectGas&,
const perfectGas&
);
inline friend perfectGas operator*
friend perfectGas operator* <Specie>
(
const scalar s,
const perfectGas&
);
inline friend perfectGas operator==
friend perfectGas operator== <Specie>
(
const perfectGas&,
const perfectGas&
@ -145,7 +185,11 @@ public:
// Ostream Operator
friend Ostream& operator<<(Ostream&, const perfectGas&);
friend Ostream& operator<< <Specie>
(
Ostream&,
const perfectGas&
);
};
@ -157,6 +201,10 @@ public:
#include "perfectGasI.H"
#ifdef NoRepository
# include "perfectGas.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -27,62 +27,77 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline Foam::perfectGas::perfectGas(const specie& sp)
template<class Specie>
inline Foam::perfectGas<Specie>::perfectGas(const Specie& sp)
:
specie(sp)
Specie(sp)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::perfectGas::perfectGas(const word& name, const perfectGas& pg)
template<class Specie>
inline Foam::perfectGas<Specie>::perfectGas
(
const word& name,
const perfectGas<Specie>& pg
)
:
specie(name, pg)
Specie(name, pg)
{}
inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::clone() const
template<class Specie>
inline Foam::autoPtr<Foam::perfectGas<Specie> >
Foam::perfectGas<Specie>::clone() const
{
return autoPtr<perfectGas>(new perfectGas(*this));
return autoPtr<perfectGas<Specie> >(new perfectGas<Specie>(*this));
}
inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::New(Istream& is)
template<class Specie>
inline Foam::autoPtr<Foam::perfectGas<Specie> >
Foam::perfectGas<Specie>::New(Istream& is)
{
return autoPtr<perfectGas>(new perfectGas(is));
return autoPtr<perfectGas<Specie> >(new perfectGas<Specie>(is));
}
inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::New
template<class Specie>
inline Foam::autoPtr<Foam::perfectGas<Specie> > Foam::perfectGas<Specie>::New
(
const dictionary& dict
)
{
return autoPtr<perfectGas>(new perfectGas(dict));
return autoPtr<perfectGas<Specie> >(new perfectGas<Specie>(dict));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::scalar Foam::perfectGas::rho(scalar p, scalar T) const
template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::rho(scalar p, scalar T) const
{
return p/(R()*T);
return p/(this->R()*T);
}
inline Foam::scalar Foam::perfectGas::psi(scalar, scalar T) const
template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::psi(scalar, scalar T) const
{
return 1.0/(R()*T);
return 1.0/(this->R()*T);
}
inline Foam::scalar Foam::perfectGas::Z(scalar, scalar) const
template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::Z(scalar, scalar) const
{
return 1.0;
}
inline Foam::scalar Foam::perfectGas::cpMcv(scalar, scalar) const
template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::cpMcv(scalar, scalar) const
{
return this->RR;
}
@ -90,68 +105,75 @@ inline Foam::scalar Foam::perfectGas::cpMcv(scalar, scalar) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void Foam::perfectGas::operator+=(const perfectGas& pg)
template<class Specie>
inline void Foam::perfectGas<Specie>::operator+=(const perfectGas<Specie>& pg)
{
specie::operator+=(pg);
Specie::operator+=(pg);
}
inline void Foam::perfectGas::operator-=(const perfectGas& pg)
template<class Specie>
inline void Foam::perfectGas<Specie>::operator-=(const perfectGas<Specie>& pg)
{
specie::operator-=(pg);
Specie::operator-=(pg);
}
inline void Foam::perfectGas::operator*=(const scalar s)
template<class Specie>
inline void Foam::perfectGas<Specie>::operator*=(const scalar s)
{
specie::operator*=(s);
Specie::operator*=(s);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline Foam::perfectGas Foam::operator+
template<class Specie>
inline Foam::perfectGas<Specie> Foam::operator+
(
const perfectGas& pg1,
const perfectGas& pg2
const perfectGas<Specie>& pg1,
const perfectGas<Specie>& pg2
)
{
return perfectGas
return perfectGas<Specie>
(
static_cast<const specie&>(pg1)
+ static_cast<const specie&>(pg2)
static_cast<const Specie&>(pg1)
+ static_cast<const Specie&>(pg2)
);
}
inline Foam::perfectGas Foam::operator-
template<class Specie>
inline Foam::perfectGas<Specie> Foam::operator-
(
const perfectGas& pg1,
const perfectGas& pg2
const perfectGas<Specie>& pg1,
const perfectGas<Specie>& pg2
)
{
return perfectGas
return perfectGas<Specie>
(
static_cast<const specie&>(pg1)
- static_cast<const specie&>(pg2)
static_cast<const Specie&>(pg1)
- static_cast<const Specie&>(pg2)
);
}
inline Foam::perfectGas Foam::operator*
template<class Specie>
inline Foam::perfectGas<Specie> Foam::operator*
(
const scalar s,
const perfectGas& pg
const perfectGas<Specie>& pg
)
{
return perfectGas(s*static_cast<const specie&>(pg));
return perfectGas<Specie>(s*static_cast<const Specie&>(pg));
}
inline Foam::perfectGas Foam::operator==
template<class Specie>
inline Foam::perfectGas<Specie> Foam::operator==
(
const perfectGas& pg1,
const perfectGas& pg2
const perfectGas<Specie>& pg1,
const perfectGas<Specie>& pg2
)
{
return pg2 - pg1;

View File

@ -28,27 +28,30 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::rhoConst::rhoConst(Istream& is)
template<class Specie>
Foam::rhoConst<Specie>::rhoConst(Istream& is)
:
specie(is),
Specie(is),
rho_(readScalar(is))
{
is.check("rhoConst::rhoConst(Istream& is)");
is.check("rhoConst<Specie>::rhoConst(Istream& is)");
}
Foam::rhoConst::rhoConst(const dictionary& dict)
template<class Specie>
Foam::rhoConst<Specie>::rhoConst(const dictionary& dict)
:
specie(dict),
Specie(dict),
rho_(readScalar(dict.subDict("equationOfState").lookup("rho")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::rhoConst::write(Ostream& os) const
template<class Specie>
void Foam::rhoConst<Specie>::write(Ostream& os) const
{
specie::write(os);
Specie::write(os);
dictionary dict("equationOfState");
dict.add("rho", rho_);
@ -59,12 +62,13 @@ void Foam::rhoConst::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const rhoConst& ico)
template<class Specie>
Foam::Ostream& Foam::operator<<(Ostream& os, const rhoConst<Specie>& ico)
{
os << static_cast<const specie&>(ico)
os << static_cast<const Specie&>(ico)
<< token::SPACE << ico.rho_;
os.check("Ostream& operator<<(Ostream& os, const rhoConst& ico)");
os.check("Ostream& operator<<(Ostream& os, const rhoConst<Specie>& ico)");
return os;
}

View File

@ -36,7 +36,6 @@ SourceFiles
#ifndef rhoConst_H
#define rhoConst_H
#include "specie.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,13 +43,54 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Specie> class rhoConst;
template<class Specie>
inline rhoConst<Specie> operator+
(
const rhoConst<Specie>&,
const rhoConst<Specie>&
);
template<class Specie>
inline rhoConst<Specie> operator-
(
const rhoConst<Specie>&,
const rhoConst<Specie>&
);
template<class Specie>
inline rhoConst<Specie> operator*
(
const scalar,
const rhoConst<Specie>&
);
template<class Specie>
inline rhoConst<Specie> operator==
(
const rhoConst<Specie>&,
const rhoConst<Specie>&
);
template<class Specie>
Ostream& operator<<
(
Ostream&,
const rhoConst<Specie>&
);
/*---------------------------------------------------------------------------*\
Class rhoConst Declaration
\*---------------------------------------------------------------------------*/
template<class Specie>
class rhoConst
:
public specie
public Specie
{
// Private data
@ -63,7 +103,7 @@ public:
// Constructors
//- Construct from components
inline rhoConst(const specie& sp, const scalar rho);
inline rhoConst(const Specie& sp, const scalar rho);
//- Construct from Istream
rhoConst(Istream&);
@ -120,25 +160,25 @@ public:
// Friend operators
inline friend rhoConst operator+
friend rhoConst operator+ <Specie>
(
const rhoConst&,
const rhoConst&
);
inline friend rhoConst operator-
friend rhoConst operator- <Specie>
(
const rhoConst&,
const rhoConst&
);
inline friend rhoConst operator*
friend rhoConst operator* <Specie>
(
const scalar s,
const rhoConst&
);
inline friend rhoConst operator==
friend rhoConst operator== <Specie>
(
const rhoConst&,
const rhoConst&
@ -147,7 +187,11 @@ public:
// Ostream Operator
friend Ostream& operator<<(Ostream&, const rhoConst&);
friend Ostream& operator<< <Specie>
(
Ostream&,
const rhoConst&
);
};
@ -159,6 +203,10 @@ public:
#include "rhoConstI.H"
#ifdef NoRepository
# include "rhoConst.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -27,65 +27,73 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline Foam::rhoConst::rhoConst
template<class Specie>
inline Foam::rhoConst<Specie>::rhoConst
(
const specie& sp,
const Specie& sp,
const scalar rho
)
:
specie(sp),
Specie(sp),
rho_(rho)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::rhoConst::rhoConst
template<class Specie>
inline Foam::rhoConst<Specie>::rhoConst
(
const word& name,
const rhoConst& ico
const rhoConst<Specie>& ico
)
:
specie(name, ico),
Specie(name, ico),
rho_(ico.rho_)
{}
inline Foam::autoPtr<Foam::rhoConst>
Foam::rhoConst::clone() const
template<class Specie>
inline Foam::autoPtr<Foam::rhoConst<Specie> >
Foam::rhoConst<Specie>::clone() const
{
return autoPtr<rhoConst>(new rhoConst(*this));
return autoPtr<rhoConst<Specie> >(new rhoConst<Specie>(*this));
}
inline Foam::autoPtr<Foam::rhoConst>
Foam::rhoConst::New(Istream& is)
template<class Specie>
inline Foam::autoPtr<Foam::rhoConst<Specie> >
Foam::rhoConst<Specie>::New(Istream& is)
{
return autoPtr<rhoConst>(new rhoConst(is));
return autoPtr<rhoConst<Specie> >(new rhoConst<Specie>(is));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::scalar Foam::rhoConst::rho(scalar p, scalar T) const
template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::rho(scalar p, scalar T) const
{
return rho_;
}
inline Foam::scalar Foam::rhoConst::psi(scalar, scalar T) const
template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::psi(scalar, scalar T) const
{
return 0.0;
}
inline Foam::scalar Foam::rhoConst::Z(scalar, scalar) const
template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::Z(scalar, scalar) const
{
return 0.0;
}
inline Foam::scalar Foam::rhoConst::cpMcv(scalar, scalar) const
template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::cpMcv(scalar, scalar) const
{
return 0.0;
}
@ -93,11 +101,12 @@ inline Foam::scalar Foam::rhoConst::cpMcv(scalar, scalar) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void Foam::rhoConst::operator+=(const rhoConst& ico)
template<class Specie>
inline void Foam::rhoConst<Specie>::operator+=(const rhoConst<Specie>& ico)
{
scalar molr1 = this->nMoles();
specie::operator+=(ico);
Specie::operator+=(ico);
molr1 /= this->nMoles();
scalar molr2 = ico.nMoles()/this->nMoles();
@ -106,11 +115,12 @@ inline void Foam::rhoConst::operator+=(const rhoConst& ico)
}
inline void Foam::rhoConst::operator-=(const rhoConst& ico)
template<class Specie>
inline void Foam::rhoConst<Specie>::operator-=(const rhoConst<Specie>& ico)
{
scalar molr1 = this->nMoles();
specie::operator-=(ico);
Specie::operator-=(ico);
molr1 /= this->nMoles();
scalar molr2 = ico.nMoles()/this->nMoles();
@ -119,66 +129,71 @@ inline void Foam::rhoConst::operator-=(const rhoConst& ico)
}
inline void Foam::rhoConst::operator*=(const scalar s)
template<class Specie>
inline void Foam::rhoConst<Specie>::operator*=(const scalar s)
{
specie::operator*=(s);
Specie::operator*=(s);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline Foam::rhoConst Foam::operator+
template<class Specie>
inline Foam::rhoConst<Specie> Foam::operator+
(
const rhoConst& ico1,
const rhoConst& ico2
const rhoConst<Specie>& ico1,
const rhoConst<Specie>& ico2
)
{
scalar nMoles = ico1.nMoles() + ico2.nMoles();
scalar molr1 = ico1.nMoles()/nMoles;
scalar molr2 = ico2.nMoles()/nMoles;
return rhoConst
return rhoConst<Specie>
(
static_cast<const specie&>(ico1)
+ static_cast<const specie&>(ico2),
static_cast<const Specie&>(ico1)
+ static_cast<const Specie&>(ico2),
molr1*ico1.rho_ + molr2*ico2.rho_
);
}
inline Foam::rhoConst Foam::operator-
template<class Specie>
inline Foam::rhoConst<Specie> Foam::operator-
(
const rhoConst& ico1,
const rhoConst& ico2
const rhoConst<Specie>& ico1,
const rhoConst<Specie>& ico2
)
{
scalar nMoles = ico1.nMoles() + ico2.nMoles();
scalar molr1 = ico1.nMoles()/nMoles;
scalar molr2 = ico2.nMoles()/nMoles;
return rhoConst
return rhoConst<Specie>
(
static_cast<const specie&>(ico1)
- static_cast<const specie&>(ico2),
static_cast<const Specie&>(ico1)
- static_cast<const Specie&>(ico2),
molr1*ico1.rho_ - molr2*ico2.rho_
);
}
inline Foam::rhoConst Foam::operator*
template<class Specie>
inline Foam::rhoConst<Specie> Foam::operator*
(
const scalar s,
const rhoConst& ico
const rhoConst<Specie>& ico
)
{
return rhoConst(s*static_cast<const specie&>(ico), ico.rho_);
return rhoConst<Specie>(s*static_cast<const Specie&>(ico), ico.rho_);
}
inline Foam::rhoConst Foam::operator==
template<class Specie>
inline Foam::rhoConst<Specie> Foam::operator==
(
const rhoConst& ico1,
const rhoConst& ico2
const rhoConst<Specie>& ico1,
const rhoConst<Specie>& ico2
)
{
return ico2 - ico1;

View File

@ -32,12 +32,13 @@ Description
#ifndef thermoPhysicsTypes_H
#define thermoPhysicsTypes_H
#include "specie.H"
#include "perfectGas.H"
#include "incompressiblePerfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
#include "sensibleEnthalpy.H"
#include "specieThermo.H"
#include "thermo.H"
#include "sutherlandTransport.H"
#include "constTransport.H"
@ -52,11 +53,11 @@ namespace Foam
typedef
constTransport
<
specieThermo
species::thermo
<
hConstThermo
<
perfectGas
perfectGas<specie>
>,
sensibleEnthalpy
>
@ -65,11 +66,11 @@ namespace Foam
typedef
sutherlandTransport
<
specieThermo
species::thermo
<
janafThermo
<
perfectGas
perfectGas<specie>
>,
sensibleEnthalpy
>
@ -78,11 +79,11 @@ namespace Foam
typedef
constTransport
<
specieThermo
species::thermo
<
hConstThermo
<
incompressiblePerfectGas
incompressiblePerfectGas<specie>
>,
sensibleEnthalpy
>
@ -91,11 +92,11 @@ namespace Foam
typedef
sutherlandTransport
<
specieThermo
species::thermo
<
janafThermo
<
incompressiblePerfectGas
incompressiblePerfectGas<specie>
>,
sensibleEnthalpy
>
@ -104,11 +105,11 @@ namespace Foam
typedef
polynomialTransport
<
specieThermo
species::thermo
<
hPolynomialThermo
<
icoPolynomial<8>,
icoPolynomial<specie, 8>,
8
>,
sensibleEnthalpy

View File

@ -38,7 +38,7 @@ Description
#include "ReversibleReaction.H"
#include "NonEquilibriumReversibleReaction.H"
#include "specieThermo.H"
#include "thermo.H"
#include "sutherlandTransport.H"
#include "janafThermo.H"

View File

@ -37,7 +37,7 @@ SourceFiles
#ifndef eConstThermo_H
#define eConstThermo_H
#include "specieThermo.H"
#include "thermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -92,7 +92,7 @@ Ostream& operator<<
Class hPolynomialThermo Declaration
\*---------------------------------------------------------------------------*/
template<class EquationOfState, int PolySize>
template<class EquationOfState, int PolySize=8>
class hPolynomialThermo
:
public EquationOfState

View File

@ -23,31 +23,31 @@ License
\*---------------------------------------------------------------------------*/
#include "specieThermo.H"
#include "thermo.H"
#include "IOstreams.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
template<class Thermo, template<class> class Type>
const Foam::scalar Foam::specieThermo<Thermo, Type>::tol_ = 1.0e-4;
const Foam::scalar Foam::species::thermo<Thermo, Type>::tol_ = 1.0e-4;
template<class Thermo, template<class> class Type>
const int Foam::specieThermo<Thermo, Type>::maxIter_ = 100;
const int Foam::species::thermo<Thermo, Type>::maxIter_ = 100;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo, template<class> class Type>
Foam::specieThermo<Thermo, Type>::specieThermo(Istream& is)
Foam::species::thermo<Thermo, Type>::thermo(Istream& is)
:
Thermo(is)
{
is.check("specieThermo<Thermo, Type>::specieThermo(Istream&)");
is.check("thermo<Thermo, Type>::thermo(Istream&)");
}
template<class Thermo, template<class> class Type>
Foam::specieThermo<Thermo, Type>::specieThermo(const dictionary& dict)
Foam::species::thermo<Thermo, Type>::thermo(const dictionary& dict)
:
Thermo(dict)
{}
@ -56,7 +56,7 @@ Foam::specieThermo<Thermo, Type>::specieThermo(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo, template<class> class Type>
void Foam::specieThermo<Thermo, Type>::write(Ostream& os) const
void Foam::species::thermo<Thermo, Type>::write(Ostream& os) const
{
Thermo::write(os);
}
@ -65,14 +65,14 @@ void Foam::specieThermo<Thermo, Type>::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class Thermo, template<class> class Type>
Foam::Ostream& Foam::operator<<
Foam::Ostream& Foam::species::operator<<
(
Ostream& os, const specieThermo<Thermo, Type>& st
Ostream& os, const thermo<Thermo, Type>& st
)
{
os << static_cast<const Thermo&>(st);
os.check("Ostream& operator<<(Ostream&, const specieThermo&)");
os.check("Ostream& operator<<(Ostream&, const thermo&)");
return os;
}

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::specieThermo
Foam::thermo
Description
Basic thermodynamics type based on the use of fitting functions for
@ -30,68 +30,70 @@ Description
properties are derived from these primitive functions.
SourceFiles
specieThermoI.H
specieThermo.C
thermoI.H
thermo.C
\*---------------------------------------------------------------------------*/
#ifndef specieThermo_H
#define specieThermo_H
#ifndef thermo_H
#define thermo_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace species
{
// Forward declaration of friend functions and operators
template<class Thermo, template<class> class Type> class specieThermo;
template<class Thermo, template<class> class Type> class thermo;
template<class Thermo, template<class> class Type>
inline specieThermo<Thermo, Type> operator+
inline thermo<Thermo, Type> operator+
(
const specieThermo<Thermo, Type>&,
const specieThermo<Thermo, Type>&
const thermo<Thermo, Type>&,
const thermo<Thermo, Type>&
);
template<class Thermo, template<class> class Type>
inline specieThermo<Thermo, Type> operator-
inline thermo<Thermo, Type> operator-
(
const specieThermo<Thermo, Type>&,
const specieThermo<Thermo, Type>&
const thermo<Thermo, Type>&,
const thermo<Thermo, Type>&
);
template<class Thermo, template<class> class Type>
inline specieThermo<Thermo, Type> operator*
inline thermo<Thermo, Type> operator*
(
const scalar,
const specieThermo<Thermo, Type>&
const thermo<Thermo, Type>&
);
template<class Thermo, template<class> class Type>
inline specieThermo<Thermo, Type> operator==
inline thermo<Thermo, Type> operator==
(
const specieThermo<Thermo, Type>&,
const specieThermo<Thermo, Type>&
const thermo<Thermo, Type>&,
const thermo<Thermo, Type>&
);
template<class Thermo, template<class> class Type>
Ostream& operator<<
(
Ostream&,
const specieThermo<Thermo, Type>&
const thermo<Thermo, Type>&
);
/*---------------------------------------------------------------------------*\
Class specieThermo Declaration
Class thermo Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, template<class> class Type>
class specieThermo
class thermo
:
public Thermo,
public Type<specieThermo<Thermo, Type> >
public Type<thermo<Thermo, Type> >
{
// Private data
@ -112,9 +114,9 @@ class specieThermo
scalar f,
scalar p,
scalar T0,
scalar (specieThermo::*F)(const scalar, const scalar) const,
scalar (specieThermo::*dFdT)(const scalar, const scalar) const,
scalar (specieThermo::*limit)(const scalar) const
scalar (thermo::*F)(const scalar, const scalar) const,
scalar (thermo::*dFdT)(const scalar, const scalar) const,
scalar (thermo::*limit)(const scalar) const
) const;
@ -123,16 +125,16 @@ public:
// Constructors
//- construct from components
inline specieThermo(const Thermo& sp);
inline thermo(const Thermo& sp);
//- Construct from Istream
specieThermo(Istream&);
thermo(Istream&);
//- Construct from dictionary
specieThermo(const dictionary& dict);
thermo(const dictionary& dict);
//- Construct as named copy
inline specieThermo(const word& name, const specieThermo&);
inline thermo(const word& name, const thermo&);
// Member Functions
@ -330,36 +332,36 @@ public:
// Member operators
inline void operator+=(const specieThermo&);
inline void operator-=(const specieThermo&);
inline void operator+=(const thermo&);
inline void operator-=(const thermo&);
inline void operator*=(const scalar);
// Friend operators
friend specieThermo operator+ <Thermo, Type>
friend thermo operator+ <Thermo, Type>
(
const specieThermo&,
const specieThermo&
const thermo&,
const thermo&
);
friend specieThermo operator- <Thermo, Type>
friend thermo operator- <Thermo, Type>
(
const specieThermo&,
const specieThermo&
const thermo&,
const thermo&
);
friend specieThermo operator* <Thermo, Type>
friend thermo operator* <Thermo, Type>
(
const scalar s,
const specieThermo&
const thermo&
);
friend specieThermo operator== <Thermo, Type>
friend thermo operator== <Thermo, Type>
(
const specieThermo&,
const specieThermo&
const thermo&,
const thermo&
);
@ -368,21 +370,22 @@ public:
friend Ostream& operator<< <Thermo, Type>
(
Ostream&,
const specieThermo&
const thermo&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace species
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "specieThermoI.H"
#include "thermoI.H"
#ifdef NoRepository
# include "specieThermo.C"
# include "thermo.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,12 +23,12 @@ License
\*---------------------------------------------------------------------------*/
#include "specieThermo.H"
#include "thermo.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Thermo, template<class> class Type>
inline Foam::specieThermo<Thermo, Type>::specieThermo
inline Foam::species::thermo<Thermo, Type>::thermo
(
const Thermo& sp
)
@ -38,15 +38,15 @@ inline Foam::specieThermo<Thermo, Type>::specieThermo
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::T
inline Foam::scalar Foam::species::thermo<Thermo, Type>::T
(
scalar f,
scalar p,
scalar T0,
scalar (specieThermo<Thermo, Type>::*F)(const scalar, const scalar) const,
scalar (specieThermo<Thermo, Type>::*dFdT)(const scalar, const scalar)
scalar (thermo<Thermo, Type>::*F)(const scalar, const scalar) const,
scalar (thermo<Thermo, Type>::*dFdT)(const scalar, const scalar)
const,
scalar (specieThermo<Thermo, Type>::*limit)(const scalar) const
scalar (thermo<Thermo, Type>::*limit)(const scalar) const
) const
{
scalar Test = T0;
@ -65,12 +65,12 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::T
{
FatalErrorIn
(
"specieThermo<Thermo, Type>::T(scalar f, scalar T0, "
"scalar (specieThermo<Thermo, Type>::*F)"
"thermo<Thermo, Type>::T(scalar f, scalar T0, "
"scalar (thermo<Thermo, Type>::*F)"
"(const scalar) const, "
"scalar (specieThermo<Thermo, Type>::*dFdT)"
"scalar (thermo<Thermo, Type>::*dFdT)"
"(const scalar) const, "
"scalar (specieThermo<Thermo, Type>::*limit)"
"scalar (thermo<Thermo, Type>::*limit)"
"(const scalar) const"
") const"
) << "Maximum number of iterations exceeded"
@ -86,10 +86,10 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::T
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo, template<class> class Type>
inline Foam::specieThermo<Thermo, Type>::specieThermo
inline Foam::species::thermo<Thermo, Type>::thermo
(
const word& name,
const specieThermo& st
const thermo& st
)
:
Thermo(name, st)
@ -100,23 +100,23 @@ inline Foam::specieThermo<Thermo, Type>::specieThermo
template<class Thermo, template<class> class Type>
inline Foam::word
Foam::specieThermo<Thermo, Type>::heName()
Foam::species::thermo<Thermo, Type>::heName()
{
return Type<specieThermo<Thermo, Type> >::name();
return Type<thermo<Thermo, Type> >::name();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::he(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::he(const scalar p, const scalar T) const
{
return Type<specieThermo<Thermo, Type> >::he(*this, p, T);
return Type<thermo<Thermo, Type> >::he(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::cv(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::cv(const scalar p, const scalar T) const
{
return this->cp(p, T) - this->cpMcv(p, T);
}
@ -124,15 +124,15 @@ Foam::specieThermo<Thermo, Type>::cv(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::cpv(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::cpv(const scalar p, const scalar T) const
{
return Type<specieThermo<Thermo, Type> >::cpv(*this, p, T);
return Type<thermo<Thermo, Type> >::cpv(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::gamma(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::gamma(const scalar p, const scalar T) const
{
scalar cp = this->cp(p, T);
return cp/(cp - this->cpMcv(p, T));
@ -141,15 +141,19 @@ Foam::specieThermo<Thermo, Type>::gamma(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::cpBycpv(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::cpBycpv
(
const scalar p,
const scalar T
) const
{
return Type<specieThermo<Thermo, Type> >::cpBycpv(*this, p, T);
return Type<thermo<Thermo, Type> >::cpBycpv(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::es(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::es(const scalar p, const scalar T) const
{
return this->hs(p, T) - p*this->W()/this->rho(p, T);
}
@ -157,7 +161,7 @@ Foam::specieThermo<Thermo, Type>::es(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::ea(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::ea(const scalar p, const scalar T) const
{
return this->ha(p, T) - p*this->W()/this->rho(p, T);
}
@ -165,7 +169,7 @@ Foam::specieThermo<Thermo, Type>::ea(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::g(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::g(const scalar p, const scalar T) const
{
return this->ha(p, T) - T*this->s(p, T);
}
@ -173,7 +177,7 @@ Foam::specieThermo<Thermo, Type>::g(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::a(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::a(const scalar p, const scalar T) const
{
return this->ea(p, T) - T*this->s(p, T);
}
@ -181,7 +185,7 @@ Foam::specieThermo<Thermo, Type>::a(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Cpv(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Cpv(const scalar p, const scalar T) const
{
return this->cpv(p, T)/this->W();
}
@ -189,7 +193,7 @@ Foam::specieThermo<Thermo, Type>::Cpv(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Cp(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Cp(const scalar p, const scalar T) const
{
return this->cp(p, T)/this->W();
}
@ -197,7 +201,7 @@ Foam::specieThermo<Thermo, Type>::Cp(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Cv(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Cv(const scalar p, const scalar T) const
{
return this->cv(p, T)/this->W();
}
@ -205,15 +209,15 @@ Foam::specieThermo<Thermo, Type>::Cv(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::HE(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::HE(const scalar p, const scalar T) const
{
return Type<specieThermo<Thermo, Type> >::HE(*this, p, T);
return Type<thermo<Thermo, Type> >::HE(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::H(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::H(const scalar p, const scalar T) const
{
return this->h(p, T)/this->W();
}
@ -221,7 +225,7 @@ Foam::specieThermo<Thermo, Type>::H(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Hs(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Hs(const scalar p, const scalar T) const
{
return this->hs(p, T)/this->W();
}
@ -229,7 +233,7 @@ Foam::specieThermo<Thermo, Type>::Hs(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Hc() const
Foam::species::thermo<Thermo, Type>::Hc() const
{
return this->hc()/this->W();
}
@ -237,7 +241,7 @@ Foam::specieThermo<Thermo, Type>::Hc() const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Ha(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Ha(const scalar p, const scalar T) const
{
return this->ha(p, T)/this->W();
}
@ -245,7 +249,7 @@ Foam::specieThermo<Thermo, Type>::Ha(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::S(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::S(const scalar p, const scalar T) const
{
return this->s(p, T)/this->W();
}
@ -253,7 +257,7 @@ Foam::specieThermo<Thermo, Type>::S(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::E(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::E(const scalar p, const scalar T) const
{
return this->e(p, T)/this->W();
}
@ -261,14 +265,14 @@ Foam::specieThermo<Thermo, Type>::E(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Es(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Es(const scalar p, const scalar T) const
{
return this->es(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Ea(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Ea(const scalar p, const scalar T) const
{
return this->ea(p, T)/this->W();
}
@ -276,7 +280,7 @@ Foam::specieThermo<Thermo, Type>::Ea(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::G(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::G(const scalar p, const scalar T) const
{
return this->g(p, T)/this->W();
}
@ -284,7 +288,7 @@ Foam::specieThermo<Thermo, Type>::G(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::A(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::A(const scalar p, const scalar T) const
{
return this->a(p, T)/this->W();
}
@ -292,7 +296,7 @@ Foam::specieThermo<Thermo, Type>::A(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::K(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::K(const scalar p, const scalar T) const
{
scalar arg = -this->nMoles()*this->g(p, T)/(this->RR*T);
@ -309,7 +313,7 @@ Foam::specieThermo<Thermo, Type>::K(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Kp(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Kp(const scalar p, const scalar T) const
{
return K(p, T);
}
@ -317,7 +321,7 @@ Foam::specieThermo<Thermo, Type>::Kp(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Kc(const scalar p, const scalar T) const
Foam::species::thermo<Thermo, Type>::Kc(const scalar p, const scalar T) const
{
if (equal(this->nMoles(), SMALL))
{
@ -331,7 +335,7 @@ Foam::specieThermo<Thermo, Type>::Kc(const scalar p, const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::Kx
inline Foam::scalar Foam::species::thermo<Thermo, Type>::Kx
(
const scalar p,
const scalar T
@ -349,7 +353,7 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::Kx
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::Kn
inline Foam::scalar Foam::species::thermo<Thermo, Type>::Kn
(
const scalar p,
const scalar T,
@ -368,19 +372,19 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::Kn
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::THE
inline Foam::scalar Foam::species::thermo<Thermo, Type>::THE
(
const scalar he,
const scalar p,
const scalar T0
) const
{
return Type<specieThermo<Thermo, Type> >::THE(*this, he, p, T0);
return Type<thermo<Thermo, Type> >::THE(*this, he, p, T0);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::THs
inline Foam::scalar Foam::species::thermo<Thermo, Type>::THs
(
const scalar hs,
const scalar p,
@ -392,15 +396,15 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::THs
hs,
p,
T0,
&specieThermo<Thermo, Type>::Hs,
&specieThermo<Thermo, Type>::Cp,
&specieThermo<Thermo, Type>::limit
&thermo<Thermo, Type>::Hs,
&thermo<Thermo, Type>::Cp,
&thermo<Thermo, Type>::limit
);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::THa
inline Foam::scalar Foam::species::thermo<Thermo, Type>::THa
(
const scalar ht,
const scalar p,
@ -412,15 +416,15 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::THa
ht,
p,
T0,
&specieThermo<Thermo, Type>::Ha,
&specieThermo<Thermo, Type>::Cp,
&specieThermo<Thermo, Type>::limit
&thermo<Thermo, Type>::Ha,
&thermo<Thermo, Type>::Cp,
&thermo<Thermo, Type>::limit
);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::TEs
inline Foam::scalar Foam::species::thermo<Thermo, Type>::TEs
(
const scalar es,
const scalar p,
@ -432,15 +436,15 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::TEs
es,
p,
T0,
&specieThermo<Thermo, Type>::Es,
&specieThermo<Thermo, Type>::Cv,
&specieThermo<Thermo, Type>::limit
&thermo<Thermo, Type>::Es,
&thermo<Thermo, Type>::Cv,
&thermo<Thermo, Type>::limit
);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::TEa
inline Foam::scalar Foam::species::thermo<Thermo, Type>::TEa
(
const scalar e,
const scalar p,
@ -452,9 +456,9 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::TEa
ea,
p,
T0,
&specieThermo<Thermo, Type>::Ea,
&specieThermo<Thermo, Type>::Cv,
&specieThermo<Thermo, Type>::limit
&thermo<Thermo, Type>::Ea,
&thermo<Thermo, Type>::Cv,
&thermo<Thermo, Type>::limit
);
}
@ -462,9 +466,9 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::TEa
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo, template<class> class Type>
inline void Foam::specieThermo<Thermo, Type>::operator+=
inline void Foam::species::thermo<Thermo, Type>::operator+=
(
const specieThermo<Thermo, Type>& st
const thermo<Thermo, Type>& st
)
{
Thermo::operator+=(st);
@ -472,9 +476,9 @@ inline void Foam::specieThermo<Thermo, Type>::operator+=
template<class Thermo, template<class> class Type>
inline void Foam::specieThermo<Thermo, Type>::operator-=
inline void Foam::species::thermo<Thermo, Type>::operator-=
(
const specieThermo<Thermo, Type>& st
const thermo<Thermo, Type>& st
)
{
Thermo::operator-=(st);
@ -482,7 +486,7 @@ inline void Foam::specieThermo<Thermo, Type>::operator-=
template<class Thermo, template<class> class Type>
inline void Foam::specieThermo<Thermo, Type>::operator*=(const scalar s)
inline void Foam::species::thermo<Thermo, Type>::operator*=(const scalar s)
{
Thermo::operator*=(s);
}
@ -491,13 +495,13 @@ inline void Foam::specieThermo<Thermo, Type>::operator*=(const scalar s)
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class Thermo, template<class> class Type>
inline Foam::specieThermo<Thermo, Type> Foam::operator+
inline Foam::species::thermo<Thermo, Type> Foam::species::operator+
(
const specieThermo<Thermo, Type>& st1,
const specieThermo<Thermo, Type>& st2
const thermo<Thermo, Type>& st1,
const thermo<Thermo, Type>& st2
)
{
return specieThermo<Thermo, Type>
return thermo<Thermo, Type>
(
static_cast<const Thermo&>(st1) + static_cast<const Thermo&>(st2)
);
@ -505,13 +509,13 @@ inline Foam::specieThermo<Thermo, Type> Foam::operator+
template<class Thermo, template<class> class Type>
inline Foam::specieThermo<Thermo, Type> Foam::operator-
inline Foam::species::thermo<Thermo, Type> Foam::species::operator-
(
const specieThermo<Thermo, Type>& st1,
const specieThermo<Thermo, Type>& st2
const thermo<Thermo, Type>& st1,
const thermo<Thermo, Type>& st2
)
{
return specieThermo<Thermo, Type>
return thermo<Thermo, Type>
(
static_cast<const Thermo&>(st1) - static_cast<const Thermo&>(st2)
);
@ -519,13 +523,13 @@ inline Foam::specieThermo<Thermo, Type> Foam::operator-
template<class Thermo, template<class> class Type>
inline Foam::specieThermo<Thermo, Type> Foam::operator*
inline Foam::species::thermo<Thermo, Type> Foam::species::operator*
(
const scalar s,
const specieThermo<Thermo, Type>& st
const thermo<Thermo, Type>& st
)
{
return specieThermo<Thermo, Type>
return thermo<Thermo, Type>
(
s*static_cast<const Thermo&>(st)
);
@ -533,10 +537,10 @@ inline Foam::specieThermo<Thermo, Type> Foam::operator*
template<class Thermo, template<class> class Type>
inline Foam::specieThermo<Thermo, Type> Foam::operator==
inline Foam::species::thermo<Thermo, Type> Foam::species::operator==
(
const specieThermo<Thermo, Type>& st1,
const specieThermo<Thermo, Type>& st2
const thermo<Thermo, Type>& st1,
const thermo<Thermo, Type>& st2
)
{
return st2 - st1;

View File

@ -87,7 +87,7 @@ Ostream& operator<<
Class polynomialTransport Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, int PolySize>
template<class Thermo, int PolySize=8>
class polynomialTransport
:
public Thermo

View File

@ -351,7 +351,6 @@ void LRR::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
//- fvm::laplacian(Ceps*rho_*(k_/epsilon_)*R_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
@ -394,7 +393,6 @@ void LRR::correct()
(
fvm::ddt(rho_, R_)
+ fvm::div(phi_, R_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), R_)
//- fvm::laplacian(Cs*rho_*(k_/epsilon_)*R_, R_)
- fvm::laplacian(DREff(), R_)
+ fvm::Sp(Clrr1_*rho_*epsilon_/k_, R_)

View File

@ -389,7 +389,6 @@ void LaunderGibsonRSTM::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
//- fvm::laplacian(Ceps*rho_*(k_/epsilon_)*R_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
@ -433,7 +432,6 @@ void LaunderGibsonRSTM::correct()
(
fvm::ddt(rho_, R_)
+ fvm::div(phi_, R_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), R_)
//- fvm::laplacian(Cs*rho_*(k_/epsilon_)*R_, R_)
- fvm::laplacian(DREff(), R_)
+ fvm::Sp(Clg1_*rho_*epsilon_/k_, R_)

View File

@ -314,7 +314,6 @@ void LaunderSharmaKE::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1_*G*epsilon_/k_
@ -334,7 +333,6 @@ void LaunderSharmaKE::correct()
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G - fvm::SuSp(2.0/3.0*rho_*divU, k_)

View File

@ -321,7 +321,6 @@ void RNGkEpsilon::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
(C1_ - R)*G*epsilon_/k_
@ -343,7 +342,6 @@ void RNGkEpsilon::correct()
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G - fvm::SuSp(2.0/3.0*rho_*divU, k_)

View File

@ -416,7 +416,6 @@ void SpalartAllmaras::correct()
(
fvm::ddt(rho_, nuTilda_)
+ fvm::div(phi_, nuTilda_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), nuTilda_)
- fvm::laplacian(DnuTildaEff(), nuTilda_)
- Cb2_/sigmaNut_*rho_*magSqr(fvc::grad(nuTilda_))
==

View File

@ -292,7 +292,6 @@ void kEpsilon::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
//***HGW - fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1_*G*epsilon_/k_
@ -314,7 +313,6 @@ void kEpsilon::correct()
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
//***HGW - fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G

View File

@ -411,7 +411,6 @@ void kOmegaSST::correct()
(
fvm::ddt(rho_, omega_)
+ fvm::div(phi_, omega_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), omega_)
- fvm::laplacian(DomegaEff(F1), omega_)
==
rhoGammaF1*GbyMu
@ -436,7 +435,6 @@ void kOmegaSST::correct()
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
- fvm::laplacian(DkEff(F1), k_)
==
min(G, (c1_*betaStar_)*rho_*k_*omega_)

View File

@ -331,7 +331,6 @@ void realizableKE::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1*rho_*magS*epsilon_
@ -356,7 +355,6 @@ void realizableKE::correct()
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G - fvm::SuSp(2.0/3.0*rho_*divU, k_)

View File

@ -361,7 +361,6 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
(
fvm::ddt(k_)
+ fvm::div(phi(), k_)
- fvm::Sp(fvc::div(phi()), k_)
- fvm::laplacian(DkEff(F1), k_)
==
min(G, c1_*betaStar_*k_*omega_)
@ -385,7 +384,6 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
(
fvm::ddt(omega_)
+ fvm::div(phi(), omega_)
- fvm::Sp(fvc::div(phi()), omega_)
- fvm::laplacian(DomegaEff(F1), omega_)
==
gamma(F1)*S2

View File

@ -349,7 +349,6 @@ void LRR::correct()
(
fvm::ddt(epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::div(phi_), epsilon_)
//- fvm::laplacian(Ceps*(K/epsilon_)*R, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
@ -392,7 +391,6 @@ void LRR::correct()
(
fvm::ddt(R_)
+ fvm::div(phi_, R_)
- fvm::Sp(fvc::div(phi_), R_)
//- fvm::laplacian(Cs*(k_/epsilon_)*R_, R_)
- fvm::laplacian(DREff(), R_)
+ fvm::Sp(Clrr1_*epsilon_/k_, R_)

View File

@ -396,7 +396,6 @@ void LaunderGibsonRSTM::correct()
(
fvm::ddt(epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::div(phi_), epsilon_)
//- fvm::laplacian(Ceps*(k_/epsilon_)*R_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
@ -440,7 +439,6 @@ void LaunderGibsonRSTM::correct()
(
fvm::ddt(R_)
+ fvm::div(phi_, R_)
- fvm::Sp(fvc::div(phi_), R_)
//- fvm::laplacian(Cs*(k_/epsilon_)*R_, R_)
- fvm::laplacian(DREff(), R_)
+ fvm::Sp(Clg1_*epsilon_/k_, R_)

View File

@ -408,7 +408,6 @@ void SpalartAllmaras::correct()
(
fvm::ddt(nuTilda_)
+ fvm::div(phi_, nuTilda_)
- fvm::Sp(fvc::div(phi_), nuTilda_)
- fvm::laplacian(DnuTildaEff(), nuTilda_)
- Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_))
==

View File

@ -245,7 +245,6 @@ void kEpsilon::correct()
(
fvm::ddt(epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1_*G*epsilon_/k_
@ -265,7 +264,6 @@ void kEpsilon::correct()
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G

View File

@ -254,7 +254,6 @@ void kOmega::correct()
(
fvm::ddt(omega_)
+ fvm::div(phi_, omega_)
- fvm::Sp(fvc::div(phi_), omega_)
- fvm::laplacian(DomegaEff(), omega_)
==
alpha_*G*omega_/k_
@ -274,7 +273,6 @@ void kOmega::correct()
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G

View File

@ -381,7 +381,6 @@ void kOmegaSST::correct()
(
fvm::ddt(omega_)
+ fvm::div(phi_, omega_)
- fvm::Sp(fvc::div(phi_), omega_)
- fvm::laplacian(DomegaEff(F1), omega_)
==
gamma(F1)*S2
@ -405,7 +404,6 @@ void kOmegaSST::correct()
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(F1), k_)
==
min(G, c1_*betaStar_*k_*omega_)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -374,10 +374,8 @@ void kOmegaSST::correct()
(
fvm::ddt(omega_)
+ fvm::div(phi_, omega_)
- fvm::Sp(fvc::div(phi_), omega_)
- fvm::laplacian(DomegaEff(F1), omega_)
+ fvm::div(CDkPhiOmega, omega_)
- fvm::Sp(fvc::div(CDkPhiOmega), omega_)
==
gamma(F1)*2*S2
- fvm::Sp(beta(F1)*omega_, omega_)
@ -395,7 +393,6 @@ void kOmegaSST::correct()
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(F1), k_)
==
min(G, c1_*betaStar_*k_*omega_)

View File

@ -716,7 +716,6 @@ void kkLOmega::correct()
(
fvm::ddt(kt_)
+ fvm::div(phi_, kt_)
- fvm::Sp(fvc::div(phi_), kt_)
- fvm::laplacian(DkEff(alphaTEff), kt_, "laplacian(alphaTEff,kt)")
==
Pkt
@ -739,7 +738,6 @@ void kkLOmega::correct()
(
fvm::ddt(kl_)
+ fvm::div(phi_, kl_)
- fvm::Sp(fvc::div(phi_), kl_)
- fvm::laplacian(nu(), kl_, "laplacian(nu,kl)")
==
Pkl
@ -761,7 +759,6 @@ void kkLOmega::correct()
(
fvm::ddt(omega_)
+ fvm::div(phi_, omega_)
- fvm::Sp(fvc::div(phi_), omega_)
- fvm::laplacian
(
DomegaEff(alphaTEff),

View File

@ -308,7 +308,6 @@ void realizableKE::correct()
(
fvm::ddt(epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1*magS*epsilon_
@ -332,7 +331,6 @@ void realizableKE::correct()
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G - fvm::Sp(epsilon_/k_, k_)