diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index cb18909469..209bd9cd92 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -163,21 +163,19 @@ tmp advectiveFvPatchField::advectionSpeed() const const surfaceScalarField& phi = this->db().objectRegistry::lookupObject(phiName_); - fvsPatchField phip = this->patch().lookupPatchField - ( - phiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + fvsPatchField phip = + this->patch().template lookupPatchField + ( + phiName_ + ); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { - const fvPatchScalarField& rhop = this->patch().lookupPatchField - ( - rhoName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvPatchScalarField& rhop = + this->patch().template lookupPatchField + ( + rhoName_ + ); return phip/(rhop*this->patch().magSf()); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C index 9587c380f5..a1f08fd98a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C @@ -25,15 +25,10 @@ License #include "inletOutletFvPatchField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -49,7 +44,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const inletOutletFvPatchField& ptf, const fvPatch& p, @@ -63,7 +58,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -93,7 +88,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const inletOutletFvPatchField& ptf ) @@ -104,7 +99,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const inletOutletFvPatchField& ptf, const DimensionedField& iF @@ -118,19 +113,18 @@ inletOutletFvPatchField::inletOutletFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void inletOutletFvPatchField::updateCoeffs() +void Foam::inletOutletFvPatchField::updateCoeffs() { if (this->updated()) { return; } - const Field& phip = this->patch().lookupPatchField - ( - phiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const Field& phip = + this->patch().template lookupPatchField + ( + phiName_ + ); this->valueFraction() = 1.0 - pos(phip); @@ -139,7 +133,7 @@ void inletOutletFvPatchField::updateCoeffs() template -void inletOutletFvPatchField::write(Ostream& os) const +void Foam::inletOutletFvPatchField::write(Ostream& os) const { fvPatchField::write(os); if (phiName_ != "phi") @@ -154,7 +148,7 @@ void inletOutletFvPatchField::write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void inletOutletFvPatchField::operator= +void Foam::inletOutletFvPatchField::operator= ( const fvPatchField& ptf ) @@ -167,8 +161,4 @@ void inletOutletFvPatchField::operator= } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H index 86e68a8aa4..fe8cd0017a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H @@ -56,6 +56,7 @@ protected: // Protected data + //- Name of flux field word phiName_; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C index bb9b907c74..858226bfe2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C @@ -25,21 +25,17 @@ License #include "outletInletFvPatchField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const fvPatch& p, const DimensionedField& iF ) : - mixedFvPatchField(p, iF) + mixedFvPatchField(p, iF), + phiName_("phi") { this->refValue() = *this; this->refGrad() = pTraits::zero; @@ -48,7 +44,7 @@ outletInletFvPatchField::outletInletFvPatchField template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const outletInletFvPatchField& ptf, const fvPatch& p, @@ -56,19 +52,21 @@ outletInletFvPatchField::outletInletFvPatchField const fvPatchFieldMapper& mapper ) : - mixedFvPatchField(ptf, p, iF, mapper) + mixedFvPatchField(ptf, p, iF, mapper), + phiName_(ptf.phiName_) {} template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : - mixedFvPatchField(p, iF) + mixedFvPatchField(p, iF), + phiName_(dict.lookupOrDefault("phi", "phi")) { this->refValue() = Field("outletValue", dict, p.size()); @@ -90,42 +88,43 @@ outletInletFvPatchField::outletInletFvPatchField template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const outletInletFvPatchField& ptf ) : - mixedFvPatchField(ptf) + mixedFvPatchField(ptf), + phiName_(ptf.phiName_) {} template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const outletInletFvPatchField& ptf, const DimensionedField& iF ) : - mixedFvPatchField(ptf, iF) + mixedFvPatchField(ptf, iF), + phiName_(ptf.phiName_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void outletInletFvPatchField::updateCoeffs() +void Foam::outletInletFvPatchField::updateCoeffs() { if (this->updated()) { return; } - const fvsPatchField& phip = this->patch().lookupPatchField - ( - "phi", - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvsPatchField& phip = + this->patch().template lookupPatchField + ( + phiName_ + ); this->valueFraction() = pos(phip); @@ -134,16 +133,16 @@ void outletInletFvPatchField::updateCoeffs() template -void outletInletFvPatchField::write(Ostream& os) const +void Foam::outletInletFvPatchField::write(Ostream& os) const { fvPatchField::write(os); + if (phiName_ != "phi") + { + os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + } this->refValue().writeEntry("outletValue", os); this->writeEntry("value", os); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H index a6548229d3..3ba722fceb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H @@ -52,6 +52,14 @@ class outletInletFvPatchField public mixedFvPatchField { +protected: + + // Protected data + + //- Name of flux field + word phiName_; + + public: //- Runtime type information diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C index 477bb6f22c..4dc85d5e9b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C @@ -31,15 +31,10 @@ License #include "CrankNicholsonDdtScheme.H" #include "backwardDdtScheme.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -52,7 +47,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const waveTransmissiveFvPatchField& ptf, const fvPatch& p, @@ -67,7 +62,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -81,7 +76,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const waveTransmissiveFvPatchField& ptpsf ) @@ -93,7 +88,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const waveTransmissiveFvPatchField& ptpsf, const DimensionedField& iF @@ -108,35 +103,32 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -tmp waveTransmissiveFvPatchField::advectionSpeed() const +Foam::tmp +Foam::waveTransmissiveFvPatchField::advectionSpeed() const { // Lookup the velocity and compressibility of the patch - const fvPatchField& psip = this->patch().lookupPatchField - ( - psiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvPatchField& psip = + this->patch().template lookupPatchField + ( + psiName_ + ); const surfaceScalarField& phi = - this->db().objectRegistry::lookupObject - (this->phiName_); + this->db().template lookupObject(this->phiName_); - fvsPatchField phip = this->patch().lookupPatchField - ( - this->phiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + fvsPatchField phip = + this->patch().template lookupPatchField + ( + this->phiName_ + ); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { - const fvPatchScalarField& rhop = this->patch().lookupPatchField - ( - this->rhoName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvPatchScalarField& rhop = + this->patch().template lookupPatchField + ( + this->rhoName_ + ); phip /= rhop; } @@ -149,7 +141,7 @@ tmp waveTransmissiveFvPatchField::advectionSpeed() const template -void waveTransmissiveFvPatchField::write(Ostream& os) const +void Foam::waveTransmissiveFvPatchField::write(Ostream& os) const { fvPatchField::write(os); @@ -165,6 +157,7 @@ void waveTransmissiveFvPatchField::write(Ostream& os) const { os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl; } + os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; if (this->lInf_ > SMALL) @@ -179,8 +172,4 @@ void waveTransmissiveFvPatchField::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/turbulenceModels/LES/LESdeltas/maxhxhyhzDelta/maxhxhyhzDelta.C b/src/turbulenceModels/LES/LESdeltas/maxhxhyhzDelta/maxhxhyhzDelta.C deleted file mode 100644 index 0ba1d63b1a..0000000000 --- a/src/turbulenceModels/LES/LESdeltas/maxhxhyhzDelta/maxhxhyhzDelta.C +++ /dev/null @@ -1,142 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 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 . - -\*---------------------------------------------------------------------------*/ - -#include "maxhxhyhzDelta.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(maxhxhyhzDelta, 0); -addToRunTimeSelectionTable(LESdelta, maxhxhyhzDelta, dictionary); - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void maxhxhyhzDelta::calcDelta() -{ - label nD = mesh().nGeometricD(); - - tmp hmax - ( - new volScalarField - ( - IOobject - ( - "hmax", - mesh().time().timeName(), - mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh(), - dimensionedScalar("zrero", dimLength, 0.0) - ) - ); - - const cellList& cells = mesh().cells(); - - forAll(cells,cellI) - { - scalar deltaMaxTmp = 0.0; - const labelList& cFaces = mesh().cells()[cellI]; - const point& centrevector = mesh().cellCentres()[cellI]; - - forAll(cFaces, cFaceI) - { - label faceI = cFaces[cFaceI]; - const point& facevector = mesh().faceCentres()[faceI]; - scalar tmp = mag(facevector - centrevector); - if (tmp > deltaMaxTmp) - { - deltaMaxTmp = tmp; - } - } - hmax()[cellI] = deltaCoeff_*deltaMaxTmp; - } - - if (nD == 3) - { - delta_.internalField() = hmax(); - } - else if (nD == 2) - { - WarningIn("maxhxhyhzDelta::calcDelta()") - << "Case is 2D, LES is not strictly applicable\n" - << endl; - - delta_.internalField() = hmax(); - } - else - { - FatalErrorIn("maxhxhyhzDelta::calcDelta()") - << "Case is not 3D or 2D, LES is not applicable" - << exit(FatalError); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -maxhxhyhzDelta::maxhxhyhzDelta -( - const word& name, - const fvMesh& mesh, - const dictionary& dd -) -: - LESdelta(name, mesh), - deltaCoeff_(readScalar(dd.subDict(type() + "Coeffs").lookup("deltaCoeff"))) -{ - calcDelta(); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void maxhxhyhzDelta::read(const dictionary& dd) -{ - dd.subDict(type() + "Coeffs").lookup("deltaCoeff") >> deltaCoeff_; - calcDelta(); -} - - -void maxhxhyhzDelta::correct() -{ - if (mesh_.changing()) - { - calcDelta(); - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/turbulenceModels/LES/LESdeltas/maxhxhyhzDelta/maxhxhyhzDelta.H b/src/turbulenceModels/LES/LESdeltas/maxhxhyhzDelta/maxhxhyhzDelta.H deleted file mode 100644 index 30f26e6bd0..0000000000 --- a/src/turbulenceModels/LES/LESdeltas/maxhxhyhzDelta/maxhxhyhzDelta.H +++ /dev/null @@ -1,111 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 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 . - -Class - Foam::maxhxhyhzDelta - -Description - maxhxhyhzDelta takes the maximum of the three dimensions per cell: - max(hx, hy, hz). Valid for structures hexahedral cells only. - - -SourceFiles - maxhxhyhzDelta.C - -\*---------------------------------------------------------------------------*/ - -#ifndef maxhxhyhzDeltaDelta_H -#define maxhxhyhzDeltaDelta_H - -#include "LESdelta.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class maxhxhyhzDelta Declaration -\*---------------------------------------------------------------------------*/ - -class maxhxhyhzDelta -: - public LESdelta -{ - // Private data - - scalar deltaCoeff_; // - - - // Private Member Functions - - //- Disallow default bitwise copy construct and assignment - maxhxhyhzDelta(const maxhxhyhzDelta&); - void operator=(const maxhxhyhzDelta&); - - // Calculate the delta values - void calcDelta(); - - -public: - - //- Runtime type information - TypeName("maxhxhyhzDelta"); - - - // Constructors - - //- Construct from name, mesh and IOdictionary - maxhxhyhzDelta - ( - const word& name, - const fvMesh& mesh, - const dictionary& - ); - - - //- Destructor - virtual ~maxhxhyhzDelta() - {} - - - // Member Functions - - //- Read the LESdelta dictionary - virtual void read(const dictionary&); - - // Correct values - virtual void correct(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -#endif - -// ************************************************************************* //