diff --git a/applications/solvers/heatTransfer/buoyantFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantFoam/pEqn.H index 2a1929eb72a6b282f5b2dbdcb1c6b18219e96978..36378f7f6fe3d08ee3fbe0f60f01ccfda6d229af 100644 --- a/applications/solvers/heatTransfer/buoyantFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantFoam/pEqn.H @@ -55,5 +55,6 @@ if (closedVolume) { p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) /fvc::domainIntegrate(thermo->psi()); + pd == p - (rho*gh + pRef); rho = thermo->rho(); } diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 4c8d0939a8b53526a4ee07d4f91d6a5b3692a821..8c3621205be1325da983f87fc737e2eea31b402e 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -1,6 +1,7 @@ volScalarField rUA = 1.0/UEqn().A(); U = rUA*UEqn().H(); UEqn.clear(); + phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); bool closedVolume = adjustPhi(phi, U, p); phi -= fvc::interpolate(rho*gh*rUA)*fvc::snGrad(rho)*mesh.magSf(); @@ -46,6 +47,7 @@ if (closedVolume) { p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) /fvc::domainIntegrate(thermo->psi()); + pd == p - (rho*gh + pRef); } rho = thermo->rho(); diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H index 4c8d0939a8b53526a4ee07d4f91d6a5b3692a821..2a713bac625755acc2a7ac170984549f237934ec 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H @@ -46,6 +46,7 @@ if (closedVolume) { p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) /fvc::domainIntegrate(thermo->psi()); + pd == p - (rho*gh + pRef); } rho = thermo->rho(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index 3e071ce8baa0e98c521eefa6184666097e4e52ce..fd018d70962f8a8805c967abeda45cbbc92528e7 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -51,7 +51,7 @@ ) - fvc::domainIntegrate(thermof[i].psi()*thermof[i].p()) )/fvc::domainIntegrate(thermof[i].psi()); - + pdf[i] == thermof[i].p() - (rhof[i]*ghf[i] + pRef); rhof[i] = thermof[i].rho(); } diff --git a/bin/tools/buildParaViewFunctions b/bin/tools/buildParaViewFunctions index cf04183f80bdd5ddc849cc897bc14ba186ff3e91..7231ad140e79cab6a0cb4c1c55ee4b0c0bbb34d1 100644 --- a/bin/tools/buildParaViewFunctions +++ b/bin/tools/buildParaViewFunctions @@ -140,6 +140,7 @@ buildParaView () { # set general options addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON" + addCMakeVariable "VTK_USE_RPATH:BOOL=OFF" addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release" # set paraview environment diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index fc3ad8857cca9f384296f6ab8ad3588179b248a1..c74b67438989c0d2e577d725f3aa17755a33914d 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -44,6 +44,7 @@ void Foam::Time::readDict() ); } + scalar oldWriteInterval = writeInterval_; if (controlDict_.readIfPresent("writeInterval", writeInterval_)) { if (writeControl_ == wcTimeStep && label(writeInterval_) < 1) @@ -58,6 +59,22 @@ void Foam::Time::readDict() controlDict_.lookup("writeFrequency") >> writeInterval_; } + if (oldWriteInterval != writeInterval_) + { + switch(writeControl_) + { + case wcRunTime: + case wcAdjustableRunTime: + // Recalculate outputTimeIndex_ to be in units of current + // writeInterval. + outputTimeIndex_ *= oldWriteInterval/writeInterval_; + break; + + default: + break; + } + } + if (controlDict_.readIfPresent("purgeWrite", purgeWrite_)) { if (purgeWrite_ < 0) diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C index 218087f7748435f5638052e36addf1914d20cd8d..7bbe58ff8f9d5575fbb1a341e11e455056d29272 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C @@ -248,7 +248,7 @@ Foam::label Foam::autoRefineDriver::surfaceOnlyRefine refineParams.keepPoints()[0], refineParams.curvature(), - PtrList<featureEdgeMesh>(0), // dummy featureMeshes; + PtrList<featureEdgeMesh>(), // dummy featureMeshes; labelList(0), // dummy featureLevels; false, // featureRefinement @@ -389,7 +389,7 @@ Foam::label Foam::autoRefineDriver::shellRefine refineParams.keepPoints()[0], refineParams.curvature(), - PtrList<featureEdgeMesh>(0), // dummy featureMeshes; + PtrList<featureEdgeMesh>(), // dummy featureMeshes; labelList(0), // dummy featureLevels; false, // featureRefinement diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/duplicatePoints.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/duplicatePoints.C index df9434deec81aaf97b11142f6f0317402091f830..ee915cfa5efbf33e4cb93dbd9de0e997bbfb210b 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/duplicatePoints.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/duplicatePoints.C @@ -155,17 +155,35 @@ void Foam::duplicatePoints::setRefinement zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)]; } - meshMod.modifyFace - ( - newFace, // modified face - faceI, // label of face being modified - mesh_.faceOwner()[faceI], // owner - -1, // neighbour - false, // face flip - patches.whichPatch(faceI), // patch for face - zoneID, // zone for face - zoneFlip // face flip in zone - ); + + if (mesh_.isInternalFace(faceI)) + { + meshMod.modifyFace + ( + newFace, // modified face + faceI, // label of face being modified + mesh_.faceOwner()[faceI], // owner + mesh_.faceNeighbour()[faceI], // neighbour + false, // face flip + -1, // patch for face + zoneID, // zone for face + zoneFlip // face flip in zone + ); + } + else + { + meshMod.modifyFace + ( + newFace, // modified face + faceI, // label of face being modified + mesh_.faceOwner()[faceI], // owner + -1, // neighbour + false, // face flip + patches.whichPatch(faceI), // patch for face + zoneID, // zone for face + zoneFlip // face flip in zone + ); + } } diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C index 9470a8d861174574fc03118e7f3c741f8c9a4b6b..bbfe0cf684445793b31441ce4be322eacae9396d 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C @@ -43,15 +43,22 @@ class minEqOpFace { public: - void operator()( face& x, const face& y ) const + void operator()(face& x, const face& y) const { - forAll(x, i) + if (x.size() > 0) { - x[i] = min(x[i], y[i]); + label j = 0; + forAll(x, i) + { + x[i] = min(x[i], y[j]); + + j = y.rcIndex(j); + } } }; }; + // Dummy transform for faces. Used in synchronisation void transformList ( @@ -103,6 +110,7 @@ bool Foam::localPointRegion::isDuplicate void Foam::localPointRegion::countPointRegions ( const polyMesh& mesh, + const boolList& candidatePoint, const Map<label>& candidateFace, faceList& minRegion ) @@ -120,7 +128,7 @@ void Foam::localPointRegion::countPointRegions forAllConstIter(Map<label>, candidateFace, iter) { - label faceI = iter(); + label faceI = iter.key(); if (!mesh.isInternalFace(faceI)) { @@ -137,43 +145,75 @@ void Foam::localPointRegion::countPointRegions forAll(f, fp) { label pointI = f[fp]; - label region = minRegion[faceI][fp]; - if (minPointRegion[pointI] == -1) - { - minPointRegion[pointI] = region; - } - else if (minPointRegion[pointI] != region) + // Even points which were not candidates for splitting might + // be on multiple baffles that are being split so check. + + if (candidatePoint[pointI]) { - // Multiple regions for this point. Add. - Map<label>::iterator iter = meshPointMap_.find(pointI); - if (iter != meshPointMap_.end()) + label region = minRegion[faceI][fp]; + + if (minPointRegion[pointI] == -1) { - labelList& regions = pointRegions[iter()]; - if (findIndex(regions, region) == -1) - { - label sz = regions.size(); - regions.setSize(sz+1); - regions[sz] = region; - } + minPointRegion[pointI] = region; } - else + else if (minPointRegion[pointI] != region) { - label localPointI = meshPointMap_.size(); - meshPointMap_.insert(pointI, localPointI); - labelList regions(2); - regions[0] = minPointRegion[pointI]; - regions[1] = region; - pointRegions.append(regions); + // Multiple regions for this point. Add. + Map<label>::iterator iter = meshPointMap_.find(pointI); + if (iter != meshPointMap_.end()) + { + labelList& regions = pointRegions[iter()]; + if (findIndex(regions, region) == -1) + { + label sz = regions.size(); + regions.setSize(sz+1); + regions[sz] = region; + } + } + else + { + label localPointI = meshPointMap_.size(); + meshPointMap_.insert(pointI, localPointI); + labelList regions(2); + regions[0] = minPointRegion[pointI]; + regions[1] = region; + pointRegions.append(regions); + } + + label meshFaceMapI = meshFaceMap_.size(); + meshFaceMap_.insert(faceI, meshFaceMapI); } + } + } + } + } + minPointRegion.clear(); + // Add internal faces that use any duplicated point. Can only have one + // region! + forAllConstIter(Map<label>, candidateFace, iter) + { + label faceI = iter.key(); + + if (mesh.isInternalFace(faceI)) + { + const face& f = mesh.faces()[faceI]; + + forAll(f, fp) + { + // Note: candidatePoint test not really necessary but + // speeds up rejection. + if (candidatePoint[f[fp]] && meshPointMap_.found(f[fp])) + { label meshFaceMapI = meshFaceMap_.size(); meshFaceMap_.insert(faceI, meshFaceMapI); } } } } - minPointRegion.clear(); + + // Transfer to member data pointRegions.shrink(); pointRegions_.setSize(pointRegions.size()); @@ -285,7 +325,7 @@ void Foam::localPointRegion::calcPointRegions faceList minRegion(mesh.nFaces()); forAllConstIter(Map<label>, candidateFace, iter) { - label faceI = iter(); + label faceI = iter.key(); const face& f = mesh.faces()[faceI]; if (mesh.isInternalFace(faceI)) @@ -391,7 +431,7 @@ void Foam::localPointRegion::calcPointRegions // Count regions per point - countPointRegions(mesh, candidateFace, minRegion); + countPointRegions(mesh, candidatePoint, candidateFace, minRegion); minRegion.clear(); diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.H index e9c03a37e596fe7330b47f8708428a8a5f48e87f..95d05d3aedf29c775c65c9e68583fe06a86d35ce 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.H @@ -92,6 +92,7 @@ class localPointRegion void countPointRegions ( const polyMesh& mesh, + const boolList& candidatePoint, const Map<label>& candidateFace, faceList& minRegion ); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C index 6549a14614fa99d8c8ea689ed35e93860a176eb8..44cd21b0ea638850e5e44bdfd880dd13825b17a8 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C @@ -30,14 +30,9 @@ License #include "volFields.H" #include "basicThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField +Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -53,7 +48,7 @@ wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField } -wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField +Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField ( const wallHeatTransferFvPatchScalarField& ptf, const fvPatch& p, @@ -67,7 +62,7 @@ wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField {} -wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField +Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -96,7 +91,7 @@ wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField } -wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField +Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField ( const wallHeatTransferFvPatchScalarField& tppsf ) @@ -107,7 +102,7 @@ wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField {} -wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField +Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField ( const wallHeatTransferFvPatchScalarField& tppsf, const DimensionedField<scalar, volMesh>& iF @@ -121,7 +116,7 @@ wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void wallHeatTransferFvPatchScalarField::autoMap +void Foam::wallHeatTransferFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) @@ -132,7 +127,7 @@ void wallHeatTransferFvPatchScalarField::autoMap } -void wallHeatTransferFvPatchScalarField::rmap +void Foam::wallHeatTransferFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr @@ -148,7 +143,7 @@ void wallHeatTransferFvPatchScalarField::rmap } -void wallHeatTransferFvPatchScalarField::updateCoeffs() +void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -159,13 +154,13 @@ void wallHeatTransferFvPatchScalarField::updateCoeffs() ( "thermophysicalProperties" ); - + const label patchi = patch().index(); const scalarField& Tw = thermo.T().boundaryField()[patchi]; scalarField Cpw = thermo.Cp(Tw, patchi); - valueFraction() = + valueFraction() = 1.0/ ( 1.0 @@ -177,7 +172,7 @@ void wallHeatTransferFvPatchScalarField::updateCoeffs() } -void wallHeatTransferFvPatchScalarField::write(Ostream& os) const +void Foam::wallHeatTransferFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); Tinf_.writeEntry("Tinf", os); @@ -188,10 +183,9 @@ void wallHeatTransferFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, wallHeatTransferFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makePatchTypeField(fvPatchScalarField, wallHeatTransferFvPatchScalarField); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H index baceabe201036e504ba707cb9f91e8b05ee5a0f9..fa8e6249460f11cb82527ddaa69f34b4aa53cd07 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H @@ -128,7 +128,7 @@ public: // Member Functions - // fundamaental properties + // Fundamaental properties //- Heat capacity at constant pressure [J/(kmol K)] inline scalar cp(const scalar T) const; @@ -152,10 +152,8 @@ public: // Member operators - inline eConstThermo& operator= - ( - const eConstThermo& - ); + inline void operator+=(const hConstThermo&); + inline void operator-=(const hConstThermo&); // Friend operators diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H index c6ef9e4e97a04eb8edd38060ec937a0bef650d0e..2f7d1faf4c0dba56c96cb53c167000bb1becf983 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H @@ -24,15 +24,9 @@ License \*---------------------------------------------------------------------------*/ -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Construct from components -inline eConstThermo::eConstThermo +inline Foam::eConstThermo::eConstThermo ( const specieThermo& st, const scalar cv, @@ -47,8 +41,11 @@ inline eConstThermo::eConstThermo // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -//- Construct as named copy -inline eConstThermo::eConstThermo(const word& name, const eConstThermo& ct) +inline Foam::eConstThermo::eConstThermo +( + const word& name, + const eConstThermo& ct +) : specieThermo(name, ct), CV(ct.CV), @@ -56,10 +53,9 @@ inline eConstThermo::eConstThermo(const word& name, const eConstThermo& ct) {} -// Construct and return a clone template<class equationOfState> -inline autoPtr<eConstThermo<equationOfState> > eConstThermo<equationOfState>:: -clone() const +inline Foam::autoPtr<eConstThermo<equationOfState> > +Foam::eConstThermo<equationOfState>::clone() const { return autoPtr<eConstThermo<equationOfState> > ( @@ -68,10 +64,9 @@ clone() const } -// Selector from Istream template<class equationOfState> -inline autoPtr<eConstThermo<equationOfState> > eConstThermo<equationOfState>:: -New(Istream& is) +inline autoPtr<eConstThermo<equationOfState> > +Foam::eConstThermo<equationOfState>::New(Istream& is) { return autoPtr<eConstThermo<equationOfState> > ( @@ -82,37 +77,40 @@ New(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -//- Heat capacity at constant pressure [J/(kmol K)] -inline scalar eConstThermo::cp(const scalar) const +inline Foam::scalar Foam::eConstThermo::cp(const scalar) const { return CV*W() + RR; } -//- Enthalpy [J/kmol] -inline scalar eConstThermo::h(const scalar T) const +inline Foam::scalar Foam::eConstThermo::h(const scalar T) const { return cp(T)*T + Hf*W(); } -//- Entropy [J/(kmol K)] -inline scalar eConstThermo::s(const scalar T) const +inline Foam::scalar Foam::eConstThermo::s(const scalar T) const { notImplemented("scalar eConstThermo::s(const scalar T) const"); return T; } -//- Temperature from Enthalpy given an initial temperature T0 -inline scalar eConstThermo::TH(const scalar h, const scalar T0) const +inline Foam::scalar Foam::eConstThermo::TH +( + const scalar h, + const scalar T0 +) const { return (h - Hf)/Cp(T0); } -//- Temperature from internal energy given an initial temperature T0 -inline scalar eConstThermo::TE(const scalar e, const scalar) const +inline Foam::scalar Foam::eConstThermo::TE +( + const scalar e, + const scalar +) const { return (e - Hf)/CV; } @@ -120,7 +118,7 @@ inline scalar eConstThermo::TE(const scalar e, const scalar) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -inline eConstThermo& eConstThermo::operator= +inline Foam::eConstThermo& Foam::eConstThermo::operator= ( const eConstThermo& ct ) @@ -136,7 +134,7 @@ inline eConstThermo& eConstThermo::operator= // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // -inline eConstThermo operator+ +inline Foam::eConstThermo Foam::operator+ ( const eConstThermo& ct1, const eConstThermo& ct2 @@ -153,7 +151,7 @@ inline eConstThermo operator+ } -inline eConstThermo operator- +inline Foam::eConstThermo Foam::operator- ( const eConstThermo& ct1, const eConstThermo& ct2 @@ -170,7 +168,7 @@ inline eConstThermo operator- } -inline eConstThermo operator* +inline Foam::eConstThermo Foam::operator* ( const scalar s, const eConstThermo& ct @@ -185,7 +183,7 @@ inline eConstThermo operator* } -inline eConstThermo operator== +inline Foam::eConstThermo Foam::operator== ( const eConstThermo& ct1, const eConstThermo& ct2 @@ -195,8 +193,4 @@ inline eConstThermo operator== } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H index a615dd3415a315466483aa0131194284edfed06b..1355cb67d3df9882329b60839f15337ec8026941 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H @@ -108,6 +108,7 @@ class hConstThermo const scalar hf ); + public: // Constructors @@ -127,7 +128,7 @@ public: // Member Functions - // fundamaental properties + // Fundamaental properties //- Heat capacity at constant pressure [J/(kmol K)] inline scalar cp(const scalar T) const; @@ -141,10 +142,8 @@ public: // Member operators - inline hConstThermo& operator= - ( - const hConstThermo& - ); + inline void operator+=(const hConstThermo&); + inline void operator-=(const hConstThermo&); // Friend operators diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H index 264bce3653583b53a1bf332ccf1a3b9e37fbea1c..acc976de05716b5730998ed01b5706e32ccbd013 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H @@ -24,16 +24,10 @@ License \*---------------------------------------------------------------------------*/ -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Construct from components template<class equationOfState> -inline hConstThermo<equationOfState>::hConstThermo +inline Foam::hConstThermo<equationOfState>::hConstThermo ( const equationOfState& st, const scalar cp, @@ -48,9 +42,8 @@ inline hConstThermo<equationOfState>::hConstThermo // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct as named copy template<class equationOfState> -inline hConstThermo<equationOfState>::hConstThermo +inline Foam::hConstThermo<equationOfState>::hConstThermo ( const word& name, const hConstThermo& ct @@ -62,10 +55,9 @@ inline hConstThermo<equationOfState>::hConstThermo {} -// Construct and return a clone template<class equationOfState> -inline autoPtr<hConstThermo<equationOfState> > hConstThermo<equationOfState>:: -clone() const +inline Foam::autoPtr<Foam::hConstThermo<equationOfState> > +Foam::hConstThermo<equationOfState>::clone() const { return autoPtr<hConstThermo<equationOfState> > ( @@ -74,10 +66,9 @@ clone() const } -// Selector from Istream template<class equationOfState> -inline autoPtr<hConstThermo<equationOfState> > hConstThermo<equationOfState>:: -New(Istream& is) +inline Foam::autoPtr<Foam::hConstThermo<equationOfState> > +Foam::hConstThermo<equationOfState>::New(Istream& is) { return autoPtr<hConstThermo<equationOfState> > ( @@ -88,68 +79,73 @@ New(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -//- Heat capacity at constant pressure [J/(kmol K)] template<class equationOfState> -inline scalar hConstThermo<equationOfState>::cp(const scalar) const +inline Foam::scalar Foam::hConstThermo<equationOfState>::cp(const scalar) const { return CP*this->W(); } -//- Enthalpy [J/kmol] template<class equationOfState> -inline scalar hConstThermo<equationOfState>::h(const scalar T) const +inline Foam::scalar Foam::hConstThermo<equationOfState>::h(const scalar T) const { return (CP*T + Hf)*this->W(); } -//- Entropy [J/(kmol K)] template<class equationOfState> -inline scalar hConstThermo<equationOfState>::s(const scalar T) const +inline Foam::scalar Foam::hConstThermo<equationOfState>::s(const scalar T) const { - notImplemented("scalar hConstThermo<equationOfState>::s(const scalar T) const"); + notImplemented + ( + "scalar hConstThermo<equationOfState>::s(const scalar T) const" + ); return T; } -/* -//- Temperature from Enthalpy given an initial temperature T0 -template<class equationOfState> -inline scalar hConstThermo<equationOfState>::TH(const scalar h, const scalar T0) const -{ - return (h - Hf)/Cp(T0); -} +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -//- Temperature from internal energy given an initial temperature T0 template<class equationOfState> -inline scalar hConstThermo<equationOfState>::TE(const scalar e, const scalar T0) const +inline void Foam::hConstThermo<equationOfState>::operator+= +( + const hConstThermo<equationOfState>& ct +) { - return (e - Hf)/Cv(T0); + scalar molr1 = this->nMoles(); + + equationOfState::operator+=(ct); + + molr1 /= this->nMoles(); + scalar molr2 = ct.nMoles()/this->nMoles(); + + CP = molr1*CP + molr2*ct.CP; + Hf = molr1*Hf + molr2*ct.Hf; } -*/ -// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class equationOfState> -inline hConstThermo<equationOfState>& hConstThermo<equationOfState>::operator= +inline void Foam::hConstThermo<equationOfState>::operator-= ( - const hConstThermo& ct + const hConstThermo<equationOfState>& ct ) { - equationOfState::operator=(ct); + scalar molr1 = this->nMoles(); + + equationOfState::operator-=(ct); - CP = ct.CP; - Hf = ct.Hf; + molr1 /= this->nMoles(); + scalar molr2 = ct.nMoles()/this->nMoles(); - return *this; + CP = molr1*CP - molr2*ct.CP; + Hf = molr1*Hf - molr2*ct.Hf; } // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // template<class equationOfState> -inline hConstThermo<equationOfState> operator+ +inline Foam::hConstThermo<equationOfState> Foam::operator+ ( const hConstThermo<equationOfState>& ct1, const hConstThermo<equationOfState>& ct2 @@ -158,7 +154,7 @@ inline hConstThermo<equationOfState> operator+ equationOfState eofs ( static_cast<const equationOfState&>(ct1) - + static_cast<const equationOfState&>(ct2) + + static_cast<const equationOfState&>(ct2) ); return hConstThermo<equationOfState> @@ -171,7 +167,7 @@ inline hConstThermo<equationOfState> operator+ template<class equationOfState> -inline hConstThermo<equationOfState> operator- +inline Foam::hConstThermo<equationOfState> Foam::operator- ( const hConstThermo<equationOfState>& ct1, const hConstThermo<equationOfState>& ct2 @@ -193,7 +189,7 @@ inline hConstThermo<equationOfState> operator- template<class equationOfState> -inline hConstThermo<equationOfState> operator* +inline Foam::hConstThermo<equationOfState> Foam::operator* ( const scalar s, const hConstThermo<equationOfState>& ct @@ -209,7 +205,7 @@ inline hConstThermo<equationOfState> operator* template<class equationOfState> -inline hConstThermo<equationOfState> operator== +inline Foam::hConstThermo<equationOfState> Foam::operator== ( const hConstThermo<equationOfState>& ct1, const hConstThermo<equationOfState>& ct2 @@ -219,8 +215,4 @@ inline hConstThermo<equationOfState> operator== } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H index 8a1a205ec427b02a13968d451ae9b715085bde49..db7807a6420247cc3748bfbf0c02a1cd90e99238 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H @@ -35,8 +35,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef janafThermo2_H -#define janafThermo2_H +#ifndef janafThermo_H +#define janafThermo_H #include "scalar.H" @@ -85,11 +85,6 @@ Ostream& operator<< ); -#ifdef __GNUC__ -typedef scalar coeffArray2[7]; -#endif - - /*---------------------------------------------------------------------------*\ Class janafThermo Declaration \*---------------------------------------------------------------------------*/ @@ -122,13 +117,7 @@ private: inline void checkT(const scalar T) const; //- Return the coefficients corresponding to the given temperature - inline const -# ifdef __GNUC__ - coeffArray2& -# else - coeffArray& -# endif - coeffs(const scalar T) const; + inline const coeffArray& coeffs(const scalar T) const; public: @@ -170,8 +159,6 @@ public: inline void operator+=(const janafThermo&); inline void operator-=(const janafThermo&); - inline void operator*=(const scalar); - // Friend operators diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H index c859f76f8b138cfdee3f74a84d5bb066f719c3b5..f9dc5e7a0e0dda1e946b8b8036b534a0b6dd379b 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H @@ -26,16 +26,10 @@ License #include "janafThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Construct from components template<class equationOfState> -inline janafThermo<equationOfState>::janafThermo +inline Foam::janafThermo<equationOfState>::janafThermo ( const equationOfState& st, const scalar Tlow, @@ -58,9 +52,8 @@ inline janafThermo<equationOfState>::janafThermo } -// Check given temperature is within the range of the fitted coeffs. template<class equationOfState> -inline void janafThermo<equationOfState>::checkT(const scalar T) const +inline void Foam::janafThermo<equationOfState>::checkT(const scalar T) const { if (T < Tlow_ || T > Thigh_) { @@ -75,15 +68,9 @@ inline void janafThermo<equationOfState>::checkT(const scalar T) const } -// Return the coefficients corresponding to the given temperature template<class equationOfState> -inline const -#ifdef __GNUC__ -coeffArray2& -#else -typename janafThermo<equationOfState>::coeffArray& -#endif -janafThermo<equationOfState>::coeffs +inline const typename Foam::janafThermo<equationOfState>::coeffArray& +Foam::janafThermo<equationOfState>::coeffs ( const scalar T ) const @@ -103,9 +90,8 @@ janafThermo<equationOfState>::coeffs // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct as a named copy template<class equationOfState> -inline janafThermo<equationOfState>::janafThermo +inline Foam::janafThermo<equationOfState>::janafThermo ( const word& name, const janafThermo& jt @@ -126,9 +112,8 @@ inline janafThermo<equationOfState>::janafThermo // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Heat capacity at constant pressure [J/(kmol K)] template<class equationOfState> -inline scalar janafThermo<equationOfState>::cp +inline Foam::scalar Foam::janafThermo<equationOfState>::cp ( const scalar T ) const @@ -138,9 +123,8 @@ inline scalar janafThermo<equationOfState>::cp } -// Enthalpy [J/kmol] template<class equationOfState> -inline scalar janafThermo<equationOfState>::h +inline Foam::scalar Foam::janafThermo<equationOfState>::h ( const scalar T ) const @@ -155,9 +139,8 @@ inline scalar janafThermo<equationOfState>::h } -// Entropy [J/(kmol K)] template<class equationOfState> -inline scalar janafThermo<equationOfState>::s +inline Foam::scalar Foam::janafThermo<equationOfState>::s ( const scalar T ) const @@ -175,7 +158,7 @@ inline scalar janafThermo<equationOfState>::s // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class equationOfState> -inline void janafThermo<equationOfState>::operator+= +inline void Foam::janafThermo<equationOfState>::operator+= ( const janafThermo<equationOfState>& jt ) @@ -210,7 +193,7 @@ inline void janafThermo<equationOfState>::operator+= template<class equationOfState> -inline void janafThermo<equationOfState>::operator-= +inline void Foam::janafThermo<equationOfState>::operator-= ( const janafThermo<equationOfState>& jt ) @@ -244,20 +227,10 @@ inline void janafThermo<equationOfState>::operator-= } -template<class equationOfState> -inline void janafThermo<equationOfState>::operator*= -( - const scalar s -) -{ - equationOfState::operator*=(s); -} - - // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // template<class equationOfState> -inline janafThermo<equationOfState> operator+ +inline Foam::janafThermo<equationOfState> Foam::operator+ ( const janafThermo<equationOfState>& jt1, const janafThermo<equationOfState>& jt2 @@ -301,7 +274,7 @@ inline janafThermo<equationOfState> operator+ template<class equationOfState> -inline janafThermo<equationOfState> operator- +inline Foam::janafThermo<equationOfState> Foam::operator- ( const janafThermo<equationOfState>& jt1, const janafThermo<equationOfState>& jt2 @@ -345,7 +318,7 @@ inline janafThermo<equationOfState> operator- template<class equationOfState> -inline janafThermo<equationOfState> operator* +inline Foam::janafThermo<equationOfState> Foam::operator* ( const scalar s, const janafThermo<equationOfState>& jt @@ -364,7 +337,7 @@ inline janafThermo<equationOfState> operator* template<class equationOfState> -inline janafThermo<equationOfState> operator== +inline Foam::janafThermo<equationOfState> Foam::operator== ( const janafThermo<equationOfState>& jt1, const janafThermo<equationOfState>& jt2 @@ -374,8 +347,4 @@ inline janafThermo<equationOfState> operator== } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/tutorials/buoyantSimpleFoam/hotRoom/0/p b/tutorials/buoyantSimpleFoam/hotRoom/0/p index 1c3d0d9e4407629522df71334b57df435a719762..10cf8ccf8e1db93392b06f55e43b51c5006cde71 100644 --- a/tutorials/buoyantSimpleFoam/hotRoom/0/p +++ b/tutorials/buoyantSimpleFoam/hotRoom/0/p @@ -16,7 +16,7 @@ FoamFile dimensions [1 -1 -2 0 0 0 0]; -internalField uniform 0; +internalField uniform 100000; boundaryField { diff --git a/wmake/rules/General/CGAL b/wmake/rules/General/CGAL index 061db72a36862c857819dda71aecc2dfed6fda4b..4e7e3b4ef953606865d993ad45cd1db7eeb7e71f 100644 --- a/wmake/rules/General/CGAL +++ b/wmake/rules/General/CGAL @@ -1,4 +1,4 @@ -CGAL_PATH = ${WM_PROJECT_INST_DIR}/${WM_ARCH}/CGAL-${CGAL_VERSION} +CGAL_PATH = ${WM_THIRD_PARTY_DIR}/CGAL-${CGAL_VERSION} CGAL_INC = \ -Wno-old-style-cast \