Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-2.1.x

  • Loading branch information...
commit 86956a797bb7d8187d107c3e837af13565ad8c37 2 parents d1be9eb + 03c0f35
Henry authored
Showing with 561 additions and 76 deletions.
  1. +1 −1  src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C
  2. +1 −1  ...teVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
  3. +14 −6 src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
  4. +1 −1  src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C
  5. +28 −28 src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
  6. +9 −9 src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H
  7. +4 −4 src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H
  8. +8 −8 src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseTemplates.C
  9. +2 −2 src/meshTools/sets/topoSets/topoSet.C
  10. +5 −5 src/regionModels/regionModel/regionModel/regionModel.H
  11. +8 −8 src/regionModels/regionModel/regionModel/regionModelTemplates.C
  12. +26 −0 src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C
  13. +28 −0 src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C
  14. +28 −0 src/thermophysicalModels/basic/rhoThermo/hsRhoThermo/hsRhoThermos.C
  15. +1 −0  src/thermophysicalModels/specie/Make/files
  16. +71 −0 src/thermophysicalModels/specie/equationOfState/pressurePerfectGas/pressurePerfectGas.C
  17. +160 −0 src/thermophysicalModels/specie/equationOfState/pressurePerfectGas/pressurePerfectGas.H
  18. +163 −0 src/thermophysicalModels/specie/equationOfState/pressurePerfectGas/pressurePerfectGasI.H
  19. +3 −3 src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
View
2  src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C
@@ -48,7 +48,7 @@ void wedgeFvPatchField<scalar>::evaluate(const Pstream::commsTypes)
updateCoeffs();
}
- operator==(patchInternalField());
+ this->operator==(patchInternalField());
}
View
2  ...PatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
@@ -137,7 +137,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs()
tmp<vectorField> tangVel =
(rpm_*constant::mathematical::pi/30.0)*(hatAxis) ^ d;
- operator==(tangVel + axis_*axialVelocity_ + radialVelocity_*d);
+ operator==(tangVel + hatAxis*axialVelocity_ + radialVelocity_*d/mag(d));
fixedValueFvPatchField<vector>::updateCoeffs();
}
View
20 ...lds/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
@@ -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
@@ -129,11 +129,19 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
}
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
- const fvPatchField<scalar>& rhop =
- patch().lookupPatchField<volScalarField, scalar>(rhoName_);
-
- // mass flow-rate
- operator==(n*avgU/rhop);
+ if (rhoName_ == "none")
+ {
+ // volumetric flow-rate
+ operator==(n*avgU);
+ }
+ else
+ {
+ // mass flow-rate
+ const fvPatchField<scalar>& rhop =
+ patch().lookupPatchField<volScalarField, scalar>(rhoName_);
+
+ operator==(n*avgU/rhop);
+ }
}
else
{
View
2  ...ian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C
@@ -239,7 +239,7 @@ void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields
diameterParcelPatch_ =
filmModel.cloudDiameterTrans().boundaryField()[filmPatchI];
- filmModel.toPrimary(filmPatchI, diameterParcelPatch_, maxOp<scalar>());
+ filmModel.toPrimary(filmPatchI, diameterParcelPatch_, maxEqOp<scalar>());
UFilmPatch_ = filmModel.Us().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, UFilmPatch_);
View
56 src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
@@ -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,16 +33,16 @@ License
namespace Foam
{
//- Combine operator for interpolateToSource/Target
- template<class Type, class BinaryOp>
+ template<class Type, class CombineOp>
class combineBinaryOp
{
- const BinaryOp& bop_;
+ const CombineOp& cop_;
public:
- combineBinaryOp(const BinaryOp& bop)
+ combineBinaryOp(const CombineOp& cop)
:
- bop_(bop)
+ cop_(cop)
{}
void operator()
@@ -53,7 +53,7 @@ namespace Foam
const scalar weight
) const
{
- x = bop_(x, weight*y);
+ cop_(x, weight*y);
}
};
}
@@ -1862,7 +1862,7 @@ template<class Type, class CombineOp>
void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
(
const UList<Type>& fld,
- const CombineOp& bop,
+ const CombineOp& cop,
List<Type>& result
) const
{
@@ -1894,7 +1894,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
forAll(faces, i)
{
- bop(result[faceI], faceI, work[faces[i]], weights[i]);
+ cop(result[faceI], faceI, work[faces[i]], weights[i]);
}
}
}
@@ -1907,7 +1907,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
forAll(faces, i)
{
- bop(result[faceI], faceI, fld[faces[i]], weights[i]);
+ cop(result[faceI], faceI, fld[faces[i]], weights[i]);
}
}
}
@@ -1919,7 +1919,7 @@ template<class Type, class CombineOp>
void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
(
const UList<Type>& fld,
- const CombineOp& bop,
+ const CombineOp& cop,
List<Type>& result
) const
{
@@ -1951,7 +1951,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
forAll(faces, i)
{
- bop(result[faceI], faceI, work[faces[i]], weights[i]);
+ cop(result[faceI], faceI, work[faces[i]], weights[i]);
}
}
}
@@ -1964,7 +1964,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
forAll(faces, i)
{
- bop(result[faceI], faceI, fld[faces[i]], weights[i]);
+ cop(result[faceI], faceI, fld[faces[i]], weights[i]);
}
}
}
@@ -1972,12 +1972,12 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
template<class SourcePatch, class TargetPatch>
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
(
const Field<Type>& fld,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
tmp<Field<Type> > tresult
@@ -1989,32 +1989,32 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
)
);
- interpolateToSource(fld, combineBinaryOp<Type, BinaryOp>(bop), tresult());
+ interpolateToSource(fld, combineBinaryOp<Type, CombineOp>(cop), tresult());
return tresult;
}
template<class SourcePatch, class TargetPatch>
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
(
const tmp<Field<Type> >& tFld,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
- return interpolateToSource(tFld(), bop);
+ return interpolateToSource(tFld(), cop);
}
template<class SourcePatch, class TargetPatch>
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
(
const Field<Type>& fld,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
tmp<Field<Type> > tresult
@@ -2026,22 +2026,22 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
)
);
- interpolateToTarget(fld, combineBinaryOp<Type, BinaryOp>(bop), tresult());
+ interpolateToTarget(fld, combineBinaryOp<Type, CombineOp>(cop), tresult());
return tresult;
}
template<class SourcePatch, class TargetPatch>
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
(
const tmp<Field<Type> >& tFld,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
- return interpolateToTarget(tFld(), bop);
+ return interpolateToTarget(tFld(), cop);
}
@@ -2053,7 +2053,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
const Field<Type>& fld
) const
{
- return interpolateToSource(fld, sumOp<Type>());
+ return interpolateToSource(fld, plusEqOp<Type>());
}
@@ -2065,7 +2065,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
const tmp<Field<Type> >& tFld
) const
{
- return interpolateToSource(tFld(), sumOp<Type>());
+ return interpolateToSource(tFld(), plusEqOp<Type>());
}
@@ -2077,7 +2077,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
const Field<Type>& fld
) const
{
- return interpolateToTarget(fld, sumOp<Type>());
+ return interpolateToTarget(fld, plusEqOp<Type>());
}
@@ -2089,7 +2089,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
const tmp<Field<Type> >& tFld
) const
{
- return interpolateToTarget(tFld(), sumOp<Type>());
+ return interpolateToTarget(tFld(), plusEqOp<Type>());
}
View
18 src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H
@@ -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
@@ -448,36 +448,36 @@ public:
//- Interpolate from target to source with supplied binary op
- template<class Type, class BinaryOp>
+ template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToSource
(
const Field<Type>& fld,
- const BinaryOp& bop
+ const CombineOp& cop
) const;
//- Interpolate from target tmp field to source with supplied
// binary op
- template<class Type, class BinaryOp>
+ template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToSource
(
const tmp<Field<Type> >& tFld,
- const BinaryOp& bop
+ const CombineOp& cop
) const;
//- Interpolate from source to target with supplied op
- template<class Type, class BinaryOp>
+ template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToTarget
(
const Field<Type>& fld,
- const BinaryOp& bop
+ const CombineOp& cop
) const;
//- Interpolate from source tmp field to target with supplied op
- template<class Type, class BinaryOp>
+ template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToTarget
(
const tmp<Field<Type> >& tFld,
- const BinaryOp& bop
+ const CombineOp& cop
) const;
//- Interpolate from target to source
View
8 src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H
@@ -353,16 +353,16 @@ public:
void distribute(List<Type>& lst) const;
//- Wrapper around map/interpolate data distribution with operation
- template<class Type, class BinaryOp>
- void distribute(List<Type>& lst, const BinaryOp& bop) const;
+ template<class Type, class CombineOp>
+ void distribute(List<Type>& lst, const CombineOp& cop) const;
//- Wrapper around map/interpolate data distribution
template<class Type>
void reverseDistribute(List<Type>& lst) const;
//- Wrapper around map/interpolate data distribution with operation
- template<class Type, class BinaryOp>
- void reverseDistribute(List<Type>& lst, const BinaryOp& bop) const;
+ template<class Type, class CombineOp>
+ void reverseDistribute(List<Type>& lst, const CombineOp& cop) const;
// I/O
View
16 src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseTemplates.C
@@ -41,11 +41,11 @@ void Foam::mappedPatchBase::distribute(List<Type>& lst) const
}
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
void Foam::mappedPatchBase::distribute
(
List<Type>& lst,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
switch (mode_)
@@ -55,7 +55,7 @@ void Foam::mappedPatchBase::distribute
lst = AMI().interpolateToSource
(
Field<Type>(lst.xfer()),
- bop
+ cop
);
break;
}
@@ -69,7 +69,7 @@ void Foam::mappedPatchBase::distribute
map().subMap(),
map().constructMap(),
lst,
- bop,
+ cop,
pTraits<Type>::zero
);
}
@@ -96,11 +96,11 @@ void Foam::mappedPatchBase::reverseDistribute(List<Type>& lst) const
}
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
void Foam::mappedPatchBase::reverseDistribute
(
List<Type>& lst,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
switch (mode_)
@@ -110,7 +110,7 @@ void Foam::mappedPatchBase::reverseDistribute
lst = AMI().interpolateToTarget
(
Field<Type>(lst.xfer()),
- bop
+ cop
);
break;
}
@@ -125,7 +125,7 @@ void Foam::mappedPatchBase::reverseDistribute
map().constructMap(),
map().subMap(),
lst,
- bop,
+ cop,
pTraits<Type>::zero
);
break;
View
4 src/meshTools/sets/topoSets/topoSet.C
@@ -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
@@ -135,7 +135,7 @@ Foam::fileName Foam::topoSet::topoSet::localPath
const word& name
)
{
- return mesh.facesInstance()/polyMesh::meshSubDir/"sets"/name;
+ return mesh.facesInstance()/mesh.dbDir()/polyMesh::meshSubDir/"sets"/name;
}
View
10 src/regionModels/regionModel/regionModel/regionModel.H
@@ -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
@@ -236,21 +236,21 @@ public:
) const;
//- Convert a local region field to the primary region with op
- template<class Type, class BinaryOp>
+ template<class Type, class CombineOp>
void toPrimary
(
const label regionPatchI,
List<Type>& regionField,
- const BinaryOp& bop
+ const CombineOp& cop
) const;
//- Convert a primary region field to the local region with op
- template<class Type, class BinaryOp>
+ template<class Type, class CombineOp>
void toRegion
(
const label regionPatchI,
List<Type>& primaryFieldField,
- const BinaryOp& bop
+ const CombineOp& cop
) const;
View
16 src/regionModels/regionModel/regionModel/regionModelTemplates.C
@@ -77,12 +77,12 @@ void Foam::regionModels::regionModel::toRegion
}
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
void Foam::regionModels::regionModel::toPrimary
(
const label regionPatchI,
List<Type>& regionField,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
forAll(intCoupledPatchIDs_, i)
@@ -94,7 +94,7 @@ void Foam::regionModels::regionModel::toPrimary
(
regionMesh().boundaryMesh()[regionPatchI]
);
- mpb.reverseDistribute(regionField, bop);
+ mpb.reverseDistribute(regionField, cop);
return;
}
}
@@ -105,19 +105,19 @@ void Foam::regionModels::regionModel::toPrimary
"("
"const label, "
"List<Type>&, "
- "const BinaryOp&"
+ "const CombineOp&"
") const"
) << "Region patch ID " << regionPatchI << " not found in region mesh"
<< abort(FatalError);
}
-template<class Type, class BinaryOp>
+template<class Type, class CombineOp>
void Foam::regionModels::regionModel::toRegion
(
const label regionPatchI,
List<Type>& primaryField,
- const BinaryOp& bop
+ const CombineOp& cop
) const
{
forAll(intCoupledPatchIDs_, i)
@@ -129,14 +129,14 @@ void Foam::regionModels::regionModel::toRegion
(
regionMesh().boundaryMesh()[regionPatchI]
);
- mpb.distribute(primaryField, bop);
+ mpb.distribute(primaryField, cop);
return;
}
}
FatalErrorIn
(
- "const void toRegion(const label, List<Type>&, const BinaryOp&) const"
+ "const void toRegion(const label, List<Type>&, const CombineOp&) const"
) << "Region patch ID " << regionPatchI << " not found in region mesh"
<< abort(FatalError);
}
View
26 src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C
@@ -33,6 +33,7 @@ Description
#include "perfectGas.H"
#include "incompressible.H"
+#include "pressurePerfectGas.H"
#include "eConstThermo.H"
@@ -119,6 +120,31 @@ makeBasicPolyMixture
8
);
+
+makeBasicMixture
+(
+ pureMixture,
+ constTransport,
+ hConstThermo,
+ pressurePerfectGas
+);
+
+makeBasicMixture
+(
+ pureMixture,
+ sutherlandTransport,
+ hConstThermo,
+ pressurePerfectGas
+);
+
+makeBasicMixture
+(
+ pureMixture,
+ sutherlandTransport,
+ janafThermo,
+ pressurePerfectGas
+);
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
View
28 src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C
@@ -26,6 +26,7 @@ License
#include "makeBasicRhoThermo.H"
#include "perfectGas.H"
+#include "pressurePerfectGas.H"
#include "incompressible.H"
#include "hConstThermo.H"
@@ -99,6 +100,33 @@ makeBasicRhoPolyThermo
8
);
+makeBasicRhoThermo
+(
+ hRhoThermo,
+ pureMixture,
+ constTransport,
+ hConstThermo,
+ pressurePerfectGas
+);
+
+makeBasicRhoThermo
+(
+ hRhoThermo,
+ pureMixture,
+ sutherlandTransport,
+ hConstThermo,
+ pressurePerfectGas
+);
+
+makeBasicRhoThermo
+(
+ hRhoThermo,
+ pureMixture,
+ sutherlandTransport,
+ janafThermo,
+ pressurePerfectGas
+);
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
View
28 src/thermophysicalModels/basic/rhoThermo/hsRhoThermo/hsRhoThermos.C
@@ -26,6 +26,7 @@ License
#include "makeBasicRhoThermo.H"
#include "perfectGas.H"
+#include "pressurePerfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
@@ -71,6 +72,33 @@ makeBasicRhoThermo
perfectGas
);
+makeBasicRhoThermo
+(
+ hsRhoThermo,
+ pureMixture,
+ constTransport,
+ hConstThermo,
+ pressurePerfectGas
+);
+
+makeBasicRhoThermo
+(
+ hsRhoThermo,
+ pureMixture,
+ sutherlandTransport,
+ hConstThermo,
+ pressurePerfectGas
+);
+
+makeBasicRhoThermo
+(
+ hsRhoThermo,
+ pureMixture,
+ sutherlandTransport,
+ janafThermo,
+ pressurePerfectGas
+);
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
View
1  src/thermophysicalModels/specie/Make/files
@@ -7,6 +7,7 @@ $(atomicWeights)/atomicWeights.C
$(specie)/specie.C
$(equationOfState)/perfectGas/perfectGas.C
$(equationOfState)/incompressible/incompressible.C
+$(equationOfState)/pressurePerfectGas/pressurePerfectGas.C
$(reactions)/makeChemkinReactions.C
$(reactions)/makeReactionThermoReactions.C
$(reactions)/makeLangmuirHinshelwoodReactions.C
View
71 src/thermophysicalModels/specie/equationOfState/pressurePerfectGas/pressurePerfectGas.C
@@ -0,0 +1,71 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "pressurePerfectGas.H"
+#include "IOstreams.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::pressurePerfectGas::pressurePerfectGas(Istream& is)
+:
+ specie(is),
+ pRef_(readScalar(is))
+{
+ is.check("pressurePerfectGas::pressurePerfectGas(Istream& is)");
+}
+
+
+Foam::pressurePerfectGas::pressurePerfectGas(const dictionary& dict)
+:
+ specie(dict),
+ pRef_(readScalar(dict.subDict("equationOfState").lookup("pRef")))
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void Foam::pressurePerfectGas::write(Ostream& os) const
+{
+ specie::write(os);
+ dictionary dict("equationOfState");
+ dict.add("pRef", pRef_);
+
+ os << indent << dict.dictName() << dict;
+}
+
+
+// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
+
+Foam::Ostream& Foam::operator<<(Ostream& os, const pressurePerfectGas& pg)
+{
+ os << static_cast<const specie&>(pg)
+ << token::SPACE << pg.pRef_;
+
+ os.check("Ostream& operator<<(Ostream& os, const pressurePerfectGas& st)");
+ return os;
+}
+
+
+// ************************************************************************* //
View
160 src/thermophysicalModels/specie/equationOfState/pressurePerfectGas/pressurePerfectGas.H
@@ -0,0 +1,160 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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::pressurePerfectGas
+
+Description
+ Perfect gas equation of state usign a reference pressure
+
+SourceFiles
+ pressurePerfectGasI.H
+ pressurePerfectGas.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef pressurePerfectGas_H
+#define pressurePerfectGas_H
+
+#include "specie.H"
+#include "autoPtr.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class pressurePerfectGas Declaration
+\*---------------------------------------------------------------------------*/
+
+class pressurePerfectGas
+:
+ public specie
+{
+ // Private data
+
+ //- Reference pressure
+ scalar pRef_;
+
+
+public:
+
+ // Constructors
+
+ //- Construct from components
+ inline pressurePerfectGas(const specie& sp);
+
+ //- Construct from Istream
+ pressurePerfectGas(Istream&);
+
+ //- Construct from dictionary
+ pressurePerfectGas(const dictionary& dict);
+
+ //- Construct as named copy
+ inline pressurePerfectGas(const word& name, const pressurePerfectGas&);
+
+ //- Construct and return a clone
+ inline autoPtr<pressurePerfectGas> clone() const;
+
+ // Selector from Istream
+ inline static autoPtr<pressurePerfectGas> New(Istream& is);
+
+ // Selector from dictionary
+ inline static autoPtr<pressurePerfectGas> New(const dictionary& dict);
+
+
+ // Member functions
+
+ // Fundamental properties
+
+ //- Return density [kg/m^3]
+ inline scalar rho(scalar p, scalar T) const;
+
+ //- Return compressibility rho/p [s^2/m^2]
+ inline scalar psi(scalar p, scalar T) const;
+
+ //- Return compression factor []
+ inline scalar Z(scalar p, scalar T) const;
+
+
+ // I-O
+
+ //- Write to Ostream
+ void write(Ostream& os) const;
+
+
+ // Member operators
+
+ inline void operator+=(const pressurePerfectGas&);
+ inline void operator-=(const pressurePerfectGas&);
+
+ inline void operator*=(const scalar);
+
+
+ // Friend operators
+
+ inline friend pressurePerfectGas operator+
+ (
+ const pressurePerfectGas&,
+ const pressurePerfectGas&
+ );
+
+ inline friend pressurePerfectGas operator-
+ (
+ const pressurePerfectGas&,
+ const pressurePerfectGas&
+ );
+
+ inline friend pressurePerfectGas operator*
+ (
+ const scalar s,
+ const pressurePerfectGas&
+ );
+
+ inline friend pressurePerfectGas operator==
+ (
+ const pressurePerfectGas&,
+ const pressurePerfectGas&
+ );
+
+
+ // Ostream Operator
+
+ friend Ostream& operator<<(Ostream&, const pressurePerfectGas&);
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#include "pressurePerfectGasI.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
View
163 src/thermophysicalModels/specie/equationOfState/pressurePerfectGas/pressurePerfectGasI.H
@@ -0,0 +1,163 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "pressurePerfectGas.H"
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+inline Foam::pressurePerfectGas::pressurePerfectGas(const specie& sp)
+:
+ specie(sp)
+{}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+inline Foam::pressurePerfectGas::pressurePerfectGas
+(
+ const word& name,
+ const pressurePerfectGas& pg
+)
+:
+ specie(name, pg)
+{}
+
+
+inline Foam::autoPtr<Foam::pressurePerfectGas> Foam::pressurePerfectGas::
+clone() const
+{
+ return autoPtr<pressurePerfectGas>(new pressurePerfectGas(*this));
+}
+
+
+inline Foam::autoPtr<Foam::pressurePerfectGas> Foam::pressurePerfectGas::New
+(
+ Istream& is
+)
+{
+ return autoPtr<pressurePerfectGas>(new pressurePerfectGas(is));
+}
+
+
+inline Foam::autoPtr<Foam::pressurePerfectGas> Foam::pressurePerfectGas::New
+(
+ const dictionary& dict
+)
+{
+ return autoPtr<pressurePerfectGas>(new pressurePerfectGas(dict));
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+inline Foam::scalar Foam::pressurePerfectGas::rho(scalar p, scalar T) const
+{
+ return pRef_/(R()*T);
+}
+
+
+inline Foam::scalar Foam::pressurePerfectGas::psi(scalar, scalar T) const
+{
+ return 0.0;
+}
+
+
+inline Foam::scalar Foam::pressurePerfectGas::Z(scalar, scalar) const
+{
+ return 0.0;
+}
+
+
+// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
+
+inline void Foam::pressurePerfectGas::operator+=(const pressurePerfectGas& pg)
+{
+ specie::operator+=(pg);
+}
+
+
+inline void Foam::pressurePerfectGas::operator-=(const pressurePerfectGas& pg)
+{
+ specie::operator-=(pg);
+}
+
+
+inline void Foam::pressurePerfectGas::operator*=(const scalar s)
+{
+ specie::operator*=(s);
+}
+
+
+// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
+
+inline Foam::pressurePerfectGas Foam::operator+
+(
+ const pressurePerfectGas& pg1,
+ const pressurePerfectGas& pg2
+)
+{
+ return pressurePerfectGas
+ (
+ static_cast<const specie&>(pg1)
+ + static_cast<const specie&>(pg2)
+ );
+}
+
+
+inline Foam::pressurePerfectGas Foam::operator-
+(
+ const pressurePerfectGas& pg1,
+ const pressurePerfectGas& pg2
+)
+{
+ return pressurePerfectGas
+ (
+ static_cast<const specie&>(pg1)
+ - static_cast<const specie&>(pg2)
+ );
+}
+
+
+inline Foam::pressurePerfectGas Foam::operator*
+(
+ const scalar s,
+ const pressurePerfectGas& pg
+)
+{
+ return pressurePerfectGas(s*static_cast<const specie&>(pg));
+}
+
+
+inline Foam::pressurePerfectGas Foam::operator==
+(
+ const pressurePerfectGas& pg1,
+ const pressurePerfectGas& pg2
+)
+{
+ return pg2 - pg1;
+}
+
+
+// ************************************************************************* //
View
6 src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
@@ -82,20 +82,20 @@ void Foam::porousMedia::fixedTemperature::addEnthalpySource
scalarField& hDiag = hEqn.diag();
scalarField& hSource = hEqn.source();
- tmp<volScalarField> Cp = thermo.Cp();
+ const scalarField T(hDiag.size(), T_);
- // TODO: generalize for non-fixedTemperature methods
const scalar rate = 1e6;
forAll(zones, zoneI)
{
const labelList& cells = mesh.cellZones()[zones[zoneI]];
+ tmp<scalarField> h = thermo.h(T, cells);
forAll(cells, i)
{
hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
hSource[cells[i]] +=
- rate*V[cells[i]]*rho[cells[i]]*Cp()[cells[i]]*T_;
+ rate*V[cells[i]]*rho[cells[i]]*h()[cells[i]];
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.