INT: Updates for radiation modelling for integration into the develop branch

This commit is contained in:
Andrew Heather
2019-05-02 10:40:16 +01:00
parent 659526101a
commit af9334631f
35 changed files with 22389 additions and 22540 deletions

View File

@ -246,6 +246,7 @@ void Foam::faceReflecting::initialise(const dictionary& coeffs)
}
}
void Foam::faceReflecting::calculate()
{
const radiation::boundaryRadiationProperties& boundaryRadiation =
@ -355,11 +356,11 @@ void Foam::faceReflecting::calculate()
const label myFaceId = shootFacesIds_()[i];
forAll (refDisDirsIndex, dirIndex)
forAll(refDisDirsIndex, dirIndex)
{
if (refDisDirsIndex[dirIndex] > -1)
{
if ( (nf & refDiscAngles_[dirIndex]) > 0)
if ((nf & refDiscAngles_[dirIndex]) > 0)
{
const vector direction = -refDiscAngles_[dirIndex];
@ -392,9 +393,9 @@ void Foam::faceReflecting::calculate()
);
const mapDistribute& map = mapPtr();
PtrList<List<scalarField> > patchr(patches.size());
PtrList<List<scalarField> > patcha(patches.size());
forAll (patchr, patchi)
PtrList<List<scalarField>> patchr(patches.size());
PtrList<List<scalarField>> patcha(patches.size());
forAll(patchr, patchi)
{
patchr.set
(
@ -410,7 +411,7 @@ void Foam::faceReflecting::calculate()
}
// Fill patchr
forAll (patchr, patchi)
forAll(patchr, patchi)
{
for (label bandI = 0; bandI < nBands; bandI++)
{
@ -433,7 +434,7 @@ void Foam::faceReflecting::calculate()
}
List<scalarField> r(nBands);
for (label bandI = 0; bandI < nBands; bandI++)
for (label bandI = 0; bandI < nBands; bandI++)
{
r[bandI].setSize(triangleIndex.size());
}
@ -483,7 +484,7 @@ void Foam::faceReflecting::calculate()
{
if
(
dirStartIndex[rayI]==refDirIndex[rayI]
dirStartIndex[rayI] == refDirIndex[rayI]
&& refFacesDirIndex.found(refIndex[rayI])
)
{
@ -509,8 +510,11 @@ void Foam::faceReflecting::calculate()
qrefBf[startPatchI][localStartFaceI] +=
(
(
mag(qPrim)*r[bandI][rayI]*spectralDistribution_[bandI]
*a*rayIn
mag(qPrim)
*r[bandI][rayI]
*spectralDistribution_[bandI]
*a
*rayIn
)
& nStart[localStartFaceI]
);
@ -523,7 +527,6 @@ void Foam::faceReflecting::calculate()
startIndex.clear();
end.clear();
dirStartIndex.clear();
}
@ -557,11 +560,6 @@ Foam::faceReflecting::faceReflecting
initialise(dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::faceReflecting::~faceReflecting()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -104,6 +104,7 @@ class faceReflecting
//- Map from triSurface Index to global
labelList mapTriToGlobal_;
// Private members
//- Calculate ray start faces
@ -141,7 +142,7 @@ public:
//- Destructor
~faceReflecting();
~faceReflecting() = default;
// Member Functions

View File

@ -40,7 +40,6 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::faceShading::writeRays
(
const fileName& fName,
@ -91,10 +90,8 @@ Foam::triSurface Foam::faceShading::triangulate
f.triangles(points, nTri, triFaces);
forAll(triFaces, triFaceI)
for (const face& f : triFaces)
{
const face& f = triFaces[triFaceI];
triangles.append
(
labelledTri(f[0], f[1], f[2], newPatchI)
@ -235,10 +232,7 @@ void Foam::faceShading::calculate()
{
if (tau[faceI] == 0.0)
{
includeAllFacesPerPatch[patchI].insert
(
faceI
);
includeAllFacesPerPatch[patchI].insert(faceI);
}
}
}
@ -361,9 +355,8 @@ void Foam::faceShading::calculate()
volScalarField::Boundary& hitFacesBf = hitFaces.boundaryFieldRef();
hitFacesBf = 0.0;
forAll(rayStartFaces_, i)
for (const label faceI : rayStartFaces_)
{
const label faceI = rayStartFaces_[i];
label patchID = patches.whichPatch(faceI);
const polyPatch& pp = patches[patchID];
hitFacesBf[patchID][faceI - pp.start()] = 1.0;
@ -394,7 +387,6 @@ Foam::faceShading::faceShading
{}
Foam::faceShading::faceShading
(
const fvMesh& mesh,
@ -409,12 +401,6 @@ Foam::faceShading::faceShading
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::faceShading::~faceShading()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::faceShading::correct()

View File

@ -125,7 +125,7 @@ public:
//- Destructor
~faceShading();
~faceShading() = default;
// Member Functions

View File

@ -78,7 +78,7 @@ void Foam::radiation::solarLoad::updateReflectedRays
const scalarField& V = mesh_.V();
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll (qrBf, patchID)
forAll(qrBf, patchID)
{
if (includePatches[patchID])
{
@ -91,17 +91,19 @@ void Foam::radiation::solarLoad::updateReflectedRays
else
{
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
const labelList cellIs = patches[patchID].faceCells();
const labelUList& cellIs = patches[patchID].faceCells();
for (label bandI = 0; bandI < nBands_; bandI++)
{
forAll (cellIs, i)
forAll(cellIs, i)
{
const label cellI = cellIs[i];
Ru_[cellI] +=
(reflectedFaces_->qreflective(bandI).
boundaryField()[patchID][i] * sf[i])/V[cellI];
(
reflectedFaces_->qreflective(bandI).
boundaryField()[patchID][i] * sf[i]
)/V[cellI];
}
}
}
@ -143,8 +145,8 @@ bool Foam::radiation::solarLoad::updateHitFaces()
hitFaces_->direction() = solarCalc_.direction();
hitFaces_->correct();
return true;
break;
}
break;
}
}
}
@ -220,13 +222,11 @@ void Foam::radiation::solarLoad::updateDirectHitRadiation
const vectorField& sf = mesh_.Sf().boundaryField()[patchID];
const label cellI = pp.faceCells()[localFaceI];
{
Ru_[cellI] +=
(qPrim & sf[localFaceI])
* spectralDistribution_[bandI]
* absorptivity_[patchID][bandI]()[localFaceI]
/ V[cellI];
}
Ru_[cellI] +=
(qPrim & sf[localFaceI])
* spectralDistribution_[bandI]
* absorptivity_[patchID][bandI]()[localFaceI]
/ V[cellI];
}
}
}
@ -817,11 +817,6 @@ Foam::radiation::solarLoad::solarLoad
initialise(dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::solarLoad::~solarLoad()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -30,7 +30,6 @@ Group
grpRadiationModels
Description
The solar load radiation model includes Sun primary hits, their
reflective fluxes and diffusive sky radiative fluxes.
@ -38,7 +37,8 @@ Description
The first reflected fluxes can be optionally included. A view factors
method is needed in order to include diffusive surface to surface fluxes.
The energy is included on "visible" walls by default. The sky diffusive radiation for horizontal and vertical walls is calculated following the
The energy is included on "visible" walls by default. The sky diffusive
radiation for horizontal and vertical walls is calculated following the
Fair Weather Conditions Method from the ASHRAE Handbook.
By default the energy is included in cells adjacent to the patches into
@ -98,7 +98,7 @@ private:
autoPtr<faceReflecting> reflectedFaces_;
//- Source term for cells next to patches with flags solidCoupled
// and wallCoupled false
//- and wallCoupled false
DimensionedField<scalar, volMesh> Ru_;
//- Solar calculator
@ -116,7 +116,7 @@ private:
//-Number of bands
label nBands_;
//- Primary solar radiative heat flux per band [W/m2]
//- Primary solar radiative heat flux per band [W/m2]
PtrList<volScalarField> qprimaryRad_;
//- Couple solids through mapped boundary patch using qr (default:true)
@ -140,7 +140,6 @@ private:
// Private Member Functions
//- Initialise
void initialise(const dictionary&);
@ -189,7 +188,7 @@ public:
//- Destructor
virtual ~solarLoad();
virtual ~solarLoad() = default;
// Member functions

View File

@ -335,12 +335,6 @@ Foam::radiation::viewFactor::viewFactor
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::viewFactor::~viewFactor()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::radiation::viewFactor::read()
@ -625,10 +619,10 @@ void Foam::radiation::viewFactor::calculate()
Pstream::listCombineGather(q, maxEqOp<scalar>());
label globCoarseId = 0;
forAll(selectedPatches_, i)
for (const label patchID : selectedPatches_)
{
const label patchID = selectedPatches_[i];
const polyPatch& pp = mesh_.boundaryMesh()[patchID];
if (pp.size() > 0)
{
scalarField& qrp = qrBf[patchID];

View File

@ -74,12 +74,23 @@ class viewFactor
:
public radiationModel
{
private:
// Private Member Functions
//- No copy construct
viewFactor(const viewFactor&) = delete;
//- No copy assignment
void operator=(const viewFactor&) = delete;
protected:
// Static data
// Static data
//- Static name for view factor walls
static const word viewFactorWalls;
//- Static name for view factor walls
static const word viewFactorWalls;
// Private data
@ -145,12 +156,6 @@ protected:
scalarSquareMatrix& matrix
);
//- No copy construct
viewFactor(const viewFactor&) = delete;
//- No copy assignment
void operator=(const viewFactor&) = delete;
public:
@ -168,7 +173,7 @@ public:
//- Destructor
virtual ~viewFactor();
virtual ~viewFactor() = default;
// Member functions

View File

@ -30,11 +30,13 @@ inline const Foam::volScalarField& Foam::radiation::viewFactor::qr() const
return qr_;
}
inline bool Foam::radiation::viewFactor::useSolarLoad() const
{
return useSolarLoad_;
}
inline label Foam::radiation::viewFactor::nBands() const
{
return nBands_;

View File

@ -97,8 +97,6 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
<< abort(FatalError);
}
}
}
}
}
@ -399,10 +397,6 @@ Foam::scalar Foam::radiation::boundaryRadiationProperties::faceSpecReflectivity
return Zero;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::boundaryRadiationProperties::~boundaryRadiationProperties()
{}
// ************************************************************************* //

View File

@ -101,7 +101,6 @@ public:
scalar T = 0
) const;
//- Access boundary absorptivity on patch
tmp<scalarField> absorptivity
(
@ -111,7 +110,6 @@ public:
scalarField* T = nullptr
) const;
//- Access boundary absorptivity on face
scalar faceAbsorptivity
(
@ -122,7 +120,6 @@ public:
scalar T = 0
) const;
//- Access boundary transmissivity on patch
tmp<scalarField> transmissivity
(
@ -132,7 +129,6 @@ public:
scalarField* T = nullptr
) const;
//- Access boundary transmissivity on face
scalar faceTransmissivity
(
@ -152,7 +148,6 @@ public:
scalarField* T = nullptr
) const;
//- Access boundary diffuse reflectivity on face
scalar faceDiffReflectivity
(
@ -163,8 +158,7 @@ public:
scalar T = 0
) const;
//- Access boundary specular reflectivity on patch
//- Access boundary specular reflectivity on patch
tmp<scalarField> specReflectivity
(
const label patchI,
@ -173,7 +167,6 @@ public:
scalarField* T = nullptr
) const;
//- Access boundary specular reflectivity on face
scalar faceSpecReflectivity
(
@ -186,7 +179,7 @@ public:
//- Destructor
~boundaryRadiationProperties();
~boundaryRadiationProperties() = default;
};

View File

@ -51,23 +51,19 @@ Foam::radiation::boundaryRadiationPropertiesPatch::New
const polyPatch& pp
)
{
word modelType
(
dict.lookupCompat("type", {{"mode", 1812}})
);
word modelType(dict.lookupCompat("type", {{"mode", 1812}}));
Info<< "Selecting boundary radiation Model: "
<< modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown modelType type "
<< modelType << endl << endl
<< "Valid radiation types are : " << endl
<< modelType << nl << nl
<< "Valid radiation types are : " << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -75,6 +71,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::New
return cstrIter()(dict, pp);
}
// * * * * * * * * * * * * * * * * Private functions * * * * * * * * * * * * //
Foam::label
@ -113,12 +110,6 @@ boundaryRadiationPropertiesPatch
transmissivity_(nullptr)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::boundaryRadiationPropertiesPatch::
~boundaryRadiationPropertiesPatch()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -135,4 +126,11 @@ Foam::radiation::boundaryRadiationPropertiesPatch::transmissiveModel() const
return *transmissivity_;
}
void Foam::radiation::boundaryRadiationPropertiesPatch::write(Ostream& os) const
{
NotImplemented;
}
// ************************************************************************* //

View File

@ -49,7 +49,7 @@ namespace Foam
namespace radiation
{
/*---------------------------------------------------------------------------*\
Class boundaryRadiationPropertiesPatch Declaration
Class boundaryRadiationPropertiesPatch Declaration
\*---------------------------------------------------------------------------*/
class boundaryRadiationPropertiesPatch
@ -76,12 +76,13 @@ private:
protected:
// Protected Member Functions
//- Absorption/emission model
autoPtr<wallAbsorptionEmissionModel> absorptionEmission_;
//- Absorption/emission model
autoPtr<wallAbsorptionEmissionModel> absorptionEmission_;
//- Transmissivity model
autoPtr<wallTransmissivityModel> transmissivity_;
//- Transmissivity model
autoPtr<wallTransmissivityModel> transmissivity_;
public:
@ -106,7 +107,6 @@ public:
// Constructors
//- Construct from patch, internal field and dictionary
boundaryRadiationPropertiesPatch
(
@ -122,13 +122,12 @@ public:
const polyPatch& pp
);
//- Destructor
virtual ~boundaryRadiationPropertiesPatch();
//- Destructor
virtual ~boundaryRadiationPropertiesPatch() = default;
// Member functions
//- Return absorptionEmissionModel
const wallAbsorptionEmissionModel& absorptionEmission() const;
@ -143,17 +142,15 @@ public:
scalarField* T = nullptr
) const = 0;
//- Return emissivity on face
virtual scalar e
(
const label faceI,
const label bandI = 0,
const vector dir = Zero,
const vector& dir = Zero,
const scalar T = 0
) const = 0;
//- Return absorptivity on patch
virtual tmp<scalarField> a
(
@ -162,17 +159,15 @@ public:
scalarField* T = nullptr
) const = 0;
//- Return absorptivity on face
virtual scalar a
(
const label faceI,
const label bandI = 0,
const vector dir = Zero,
const vector& dir = Zero,
const scalar T = 0
) const = 0;
//- Return transmissivity on patch
virtual tmp<scalarField> t
(
@ -181,17 +176,15 @@ public:
scalarField* T = nullptr
) const = 0;
//- Return transmissivity on face
virtual scalar t
(
const label faceI,
const label bandI = 0,
const vector dir = Zero,
const vector& dir = Zero,
const scalar T = 0
) const = 0;
//- Return specular reflectivity on patch
virtual tmp<scalarField> rSpec
(
@ -200,17 +193,15 @@ public:
scalarField* T = nullptr
) const = 0;
//- Return specular reflectivity on face
virtual scalar rSpec
(
const label faceI,
const label bandI = 0,
const vector dir = Zero,
const vector& dir = Zero,
const scalar T = 0
) const = 0;
//- Return diffusive reflectivity on patch
virtual tmp<scalarField> rDiff
(
@ -219,13 +210,12 @@ public:
scalarField* T = nullptr
) const = 0;
//- Return diffusive reflectivity on face
virtual scalar rDiff
(
const label faceI,
const label bandI = 0,
const vector dir = Zero,
const vector& dir = Zero,
const scalar T = 0
) const = 0;
@ -235,10 +225,8 @@ public:
//- Number of bands
virtual label nBands() const = 0;
//- Write
void write(Ostream&) const;
virtual void write(Ostream&) const;
};

View File

@ -57,11 +57,6 @@ Foam::radiation::lookup::lookup
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::radiation::lookup::~lookup()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::radiation::lookup::e
@ -83,7 +78,7 @@ Foam::scalar Foam::radiation::lookup::e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -111,7 +106,7 @@ Foam::scalar Foam::radiation::lookup::a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -138,7 +133,7 @@ Foam::scalar Foam::radiation::lookup::t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -154,7 +149,7 @@ Foam::radiation::lookup::rSpec
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), Zero));
return tmp<scalarField>::New(pp_.size(), Zero);
}
@ -162,7 +157,7 @@ Foam::scalar Foam::radiation::lookup::rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -178,7 +173,7 @@ Foam::radiation::lookup::rDiff
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), Zero));
return tmp<scalarField>::New(pp_.size(), Zero);
}
@ -186,7 +181,7 @@ Foam::scalar Foam::radiation::lookup::rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -205,4 +200,5 @@ Foam::label Foam::radiation::lookup::nBands() const
return 1;
}
// ************************************************************************* //

View File

@ -25,7 +25,6 @@ Class
Foam::radiation::lookup
Description
Look up type of boundary radiation properties.
Usage
@ -87,113 +86,100 @@ public:
//- Destructor
virtual ~lookup();
virtual ~lookup() = default;
// Member Functions
//- Return emissivity
tmp<scalarField> e
//- Return emissivity
virtual tmp<scalarField> e
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return emissivity on face
scalar e
virtual scalar e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return absorptivity on patch
tmp<scalarField> a
virtual tmp<scalarField> a
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return absorptivity on face
scalar a
virtual scalar a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return transmissivity on patch
tmp<scalarField> t
virtual tmp<scalarField> t
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return transmissivity on face
scalar t
virtual scalar t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return specular reflectivity on patch
tmp<scalarField> rSpec
virtual tmp<scalarField> rSpec
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return specular reflectivity on face
scalar rSpec
virtual scalar rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return diffusive reflectivity on patch
tmp<scalarField> rDiff
virtual tmp<scalarField> rDiff
(
const label bandI,
vectorField* incomingDirection ,
scalarField* T
) const;
//- Return diffusive reflectivity on face
scalar rDiff
virtual scalar rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Is Grey
virtual bool isGrey() const;
//- Number of bands
virtual label nBands() const;
};

View File

@ -61,15 +61,9 @@ Foam::radiation::opaqueDiffusive::opaqueDiffusive
(
wallAbsorptionEmissionModel::New(absorptionDict, pp).ptr()
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::radiation::opaqueDiffusive::~opaqueDiffusive()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::radiation::opaqueDiffusive::e
@ -87,7 +81,7 @@ Foam::scalar Foam::radiation::opaqueDiffusive::e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -111,7 +105,7 @@ Foam::scalar Foam::radiation::opaqueDiffusive::a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -126,7 +120,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::opaqueDiffusive::t
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), 0.0));
return tmp<scalarField>::New(pp_.size(), 0.0);
}
@ -134,7 +128,7 @@ Foam::scalar Foam::radiation::opaqueDiffusive::t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -150,7 +144,7 @@ Foam::radiation::opaqueDiffusive::rSpec
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), Zero));
return tmp<scalarField>::New(pp_.size(), Zero);
}
@ -158,7 +152,7 @@ Foam::scalar Foam::radiation::opaqueDiffusive::rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -173,7 +167,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::opaqueDiffusive::rDiff
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), Zero));
return tmp<scalarField>::New(pp_.size(), Zero);
}
@ -181,7 +175,7 @@ Foam::scalar Foam::radiation::opaqueDiffusive::rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -200,4 +194,5 @@ Foam::label Foam::radiation::opaqueDiffusive::nBands() const
return absorptionEmission_->nBands();
}
// ************************************************************************* //

View File

@ -57,7 +57,7 @@ namespace radiation
{
/*---------------------------------------------------------------------------*\
Class opaqueDiffusive Declaration
Class opaqueDiffusive Declaration
\*---------------------------------------------------------------------------*/
class opaqueDiffusive
@ -72,6 +72,7 @@ protected:
//- Reference to the polyPatch
const polyPatch& pp_;
public:
//- Runtime type information
@ -84,113 +85,101 @@ public:
//- Destructor
virtual ~opaqueDiffusive();
virtual ~opaqueDiffusive() = default;
// Member Functions
//- Return emissivity
tmp<scalarField> e
//- Return emissivity
virtual tmp<scalarField> e
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return emissivity on face
scalar e
virtual scalar e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return absorptivity on patch
tmp<scalarField> a
virtual tmp<scalarField> a
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return absorptivity on face
scalar a
virtual scalar a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return transmissivity on patch
tmp<scalarField> t
virtual tmp<scalarField> t
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return transmissivity on face
scalar t
virtual scalar t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return specular reflectivity on patch
tmp<scalarField> rSpec
virtual tmp<scalarField> rSpec
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return specular reflectivity on face
scalar rSpec
virtual scalar rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return diffusive reflectivity on patch
tmp<scalarField> rDiff
virtual tmp<scalarField> rDiff
(
const label bandI,
vectorField* incomingDirection ,
scalarField* T
) const;
//- Return diffusive reflectivity on face
scalar rDiff
virtual scalar rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Is Grey
virtual bool isGrey() const;
//- Number of bands
virtual label nBands() const;
};

View File

@ -62,15 +62,9 @@ Foam::radiation::opaqueReflective::opaqueReflective
(
wallAbsorptionEmissionModel::New(absorptionDict, pp).ptr()
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::radiation::opaqueReflective::~opaqueReflective()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::radiation::opaqueReflective::e
@ -88,7 +82,7 @@ Foam::scalar Foam::radiation::opaqueReflective::e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -112,7 +106,7 @@ Foam::scalar Foam::radiation::opaqueReflective::a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -127,7 +121,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::opaqueReflective::t
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), Zero));
return tmp<scalarField>::New(pp_.size(), Zero);
}
@ -135,7 +129,7 @@ Foam::scalar Foam::radiation::opaqueReflective::t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -159,7 +153,7 @@ Foam::scalar Foam::radiation::opaqueReflective::rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -183,7 +177,7 @@ Foam::scalar Foam::radiation::opaqueReflective::rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -202,4 +196,5 @@ Foam::label Foam::radiation::opaqueReflective::nBands() const
return absorptionEmission_->nBands();
}
// ************************************************************************* //

View File

@ -28,8 +28,8 @@ Description
Radiation boundary model for opaque reflective walls. It requires to
specify a wallAbsorptionEmissionModel and the reflected fraction
in boundaryRadiationProperties file
fd is the diffussive reflected fraction. 0 all the incoming flux is
specularly reflected and 1 all is diffussive reflected. fd is used
fd is the diffusive reflected fraction. 0 all the incoming flux is
specularly reflected and 1 all is diffusive reflected. fd is used
in the calculation of the specular reflection (rSpec) and the
diffusive reflection (rDiff). Absorptivity and emissivity are
independent of fd.
@ -65,7 +65,7 @@ namespace radiation
{
/*---------------------------------------------------------------------------*\
Class opaqueReflective Declaration
Class opaqueReflective Declaration
\*---------------------------------------------------------------------------*/
class opaqueReflective
@ -95,113 +95,101 @@ public:
//- Destructor
virtual ~opaqueReflective();
virtual ~opaqueReflective() = default;
// Member Functions
//- Return emissivity
tmp<scalarField> e
//- Return emissivity
virtual tmp<scalarField> e
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return emissivity on face
scalar e
virtual scalar e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return absorptivity on patch
tmp<scalarField> a
virtual tmp<scalarField> a
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return absorptivity on face
scalar a
virtual scalar a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return transmissivity on patch
tmp<scalarField> t
virtual tmp<scalarField> t
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return transmissivity on face
scalar t
virtual scalar t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return specular reflectivity on patch
tmp<scalarField> rSpec
virtual tmp<scalarField> rSpec
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return specular reflectivity on face
scalar rSpec
virtual scalar rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return diffusive reflectivity on patch
tmp<scalarField> rDiff
virtual tmp<scalarField> rDiff
(
const label bandI,
vectorField* incomingDirection ,
scalarField* T
) const;
//- Return diffusive reflectivity on face
scalar rDiff
virtual scalar rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Is Grey
virtual bool isGrey() const;
//- Number of bands
virtual label nBands() const;
};

View File

@ -65,11 +65,6 @@ Foam::radiation::transparent::transparent
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::radiation::transparent::~transparent()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::radiation::transparent::e
@ -87,7 +82,7 @@ Foam::scalar Foam::radiation::transparent::e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -111,7 +106,7 @@ Foam::scalar Foam::radiation::transparent::a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -126,7 +121,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::transparent::t
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), 1.0));
return tmp<scalarField>::New(pp_.size(), 1.0);
}
@ -134,7 +129,7 @@ Foam::scalar Foam::radiation::transparent::t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -150,7 +145,7 @@ Foam::radiation::transparent::rSpec
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), Zero));
return tmp<scalarField>::New(pp_.size(), Zero);
}
@ -158,7 +153,7 @@ Foam::scalar Foam::radiation::transparent::rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -174,7 +169,7 @@ Foam::radiation::transparent::rDiff
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), Zero));
return tmp<scalarField>::New(pp_.size(), Zero);
}
@ -182,7 +177,7 @@ Foam::scalar Foam::radiation::transparent::rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const
{
@ -201,4 +196,5 @@ Foam::label Foam::radiation::transparent::nBands() const
return absorptionEmission_->nBands();
}
// ************************************************************************* //

View File

@ -72,6 +72,7 @@ protected:
//- Reference to the polyPatch
const polyPatch& pp_;
public:
//- Runtime type information
@ -84,113 +85,101 @@ public:
//- Destructor
virtual ~transparent();
virtual ~transparent() = default;
// Member Functions
//- Return emissivity
tmp<scalarField> e
//- Return emissivity
virtual tmp<scalarField> e
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return emissivity on face
scalar e
virtual scalar e
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return absorptivity on patch
tmp<scalarField> a
virtual tmp<scalarField> a
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return absorptivity on face
scalar a
virtual scalar a
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return transmissivity on patch
tmp<scalarField> t
virtual tmp<scalarField> t
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return transmissivity on face
scalar t
virtual scalar t
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return specular reflectivity on patch
tmp<scalarField> rSpec
virtual tmp<scalarField> rSpec
(
const label bandI,
vectorField* incomingDirection,
scalarField* T
) const;
//- Return specular reflectivity on face
scalar rSpec
virtual scalar rSpec
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Return diffusive reflectivity on patch
tmp<scalarField> rDiff
virtual tmp<scalarField> rDiff
(
const label bandI,
vectorField* incomingDirection ,
scalarField* T
) const;
//- Return diffusive reflectivity on face
scalar rDiff
virtual scalar rDiff
(
const label faceI,
const label bandI,
const vector dir,
const vector& dir,
const scalar T
) const;
//- Is Grey
virtual bool isGrey() const;
//- Number of bands
virtual label nBands() const;
};

View File

@ -66,7 +66,7 @@ Foam::solarCalculator::sunLoadModelTypeNames_
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::solarCalculator::calculateBetaTetha()
void Foam::solarCalculator::calculateBetaTheta()
{
scalar runTime = 0.0;
switch (sunDirectionModel_)
@ -104,20 +104,20 @@ void Foam::solarCalculator::calculateBetaTetha()
scalar deltaRad = degToRad(delta);
beta_ = max(asin(cos(L)*cos(deltaRad)*cos(H) + sin(L)*sin(deltaRad)), 1e-3);
tetha_ = acos((sin(beta_)*sin(L) - sin(deltaRad))/(cos(beta_)*cos(L)));
theta_ = acos((sin(beta_)*sin(L) - sin(deltaRad))/(cos(beta_)*cos(L)));
// theta is the angle between the SOUTH axis and the Sun
// If the hour angle is lower than zero (morning) the Sun is positioned
// on the East side.
if (H < 0)
{
tetha_ += 2*(constant::mathematical::pi - tetha_);
theta_ += 2*(constant::mathematical::pi - theta_);
}
if (debug)
{
Info << tab << "altitude : " << radToDeg(beta_) << endl;
Info << tab << "azimuth : " << radToDeg(tetha_) << endl;
Info << tab << "azimuth : " << radToDeg(theta_) << endl;
}
}
@ -134,8 +134,8 @@ void Foam::solarCalculator::calculateSunDirection()
// Assuming 'z' vertical, 'y' North and 'x' East
direction_.z() = -sin(beta_);
direction_.y() = cos(beta_)*cos(tetha_); // South axis
direction_.x() = cos(beta_)*sin(tetha_); // West axis
direction_.y() = cos(beta_)*cos(theta_); // South axis
direction_.x() = cos(beta_)*sin(theta_); // West axis
direction_.normalise();
@ -166,7 +166,7 @@ void Foam::solarCalculator::init()
}
else
{
calculateBetaTetha();
calculateBetaTheta();
calculateSunDirection();
}
@ -187,7 +187,7 @@ void Foam::solarCalculator::init()
sunTrackingUpdateInterval_
);
calculateBetaTetha();
calculateBetaTheta();
calculateSunDirection();
break;
}
@ -214,7 +214,7 @@ void Foam::solarCalculator::init()
if (!dict_.readIfPresent("beta", beta_))
{
calculateBetaTetha();
calculateBetaTheta();
}
directSolarRad_ =
@ -254,7 +254,7 @@ Foam::solarCalculator::solarCalculator
A_(0.0),
B_(0.0),
beta_(0.0),
tetha_(0.0),
theta_(0.0),
skyCloudCoverFraction_(0.0),
Setrn_(0.0),
SunPrime_(0.0),
@ -270,12 +270,6 @@ Foam::solarCalculator::solarCalculator
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::solarCalculator::~solarCalculator()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::solarCalculator::correctSunDirection()
@ -288,7 +282,7 @@ void Foam::solarCalculator::correctSunDirection()
}
case mSunDirTracking:
{
calculateBetaTetha();
calculateBetaTheta();
calculateSunDirection();
directSolarRad_ = A_/exp(B_/sin(max(beta_, ROOTVSMALL)));
break;

View File

@ -98,7 +98,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class solarCalculator Declaration
Class solarCalculator Declaration
\*---------------------------------------------------------------------------*/
class solarCalculator
@ -131,6 +131,7 @@ protected:
//- Sun load models
static const Enum<sunLModel> sunLoadModelTypeNames_;
private:
// Private data
@ -158,7 +159,7 @@ private:
scalar A_;
scalar B_;
scalar beta_;
scalar tetha_;
scalar theta_;
//- Sky cloud cover fraction [0-1]
scalar skyCloudCoverFraction_;
@ -206,8 +207,8 @@ private:
//- Init
void init();
//- Calculate beta and tetha angles
void calculateBetaTetha();
//- Calculate beta and theta angles
void calculateBetaTheta();
//- Calculate Sun direction
void calculateSunDirection();
@ -226,14 +227,14 @@ public:
//- Destructor
~solarCalculator();
~solarCalculator() = default;
// Member Functions
// Access
//- const acess to direction
//- const access to direction
const vector& direction() const
{
return direction_;
@ -275,10 +276,10 @@ public:
return beta_;
}
//- Return tetha
scalar tetha()
//- Return theta
scalar theta()
{
return tetha_;
return theta_;
}
//- Return Sun direction model

View File

@ -59,12 +59,6 @@ Foam::radiation::constantAbsorption::constantAbsorption
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::constantAbsorption::~constantAbsorption()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::a
@ -89,6 +83,7 @@ Foam::scalar Foam::radiation::constantAbsorption::a
return a_;
}
Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::e
(
const label bandI,

View File

@ -81,7 +81,7 @@ public:
//- Destructor
virtual ~constantAbsorption();
virtual ~constantAbsorption() = default;
// Member Functions
@ -120,14 +120,12 @@ public:
const scalar T = 0
) const;
//- Is Grey
inline bool isGrey() const
{
return true;
}
//- Number of bands
inline label nBands() const
{

View File

@ -58,12 +58,6 @@ Foam::radiation::constantTransmissivity::constantTransmissivity
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::constantTransmissivity::~constantTransmissivity()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField>
@ -74,7 +68,7 @@ Foam::radiation::constantTransmissivity::t
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), tau_));
return tmp<scalarField>::New(pp_.size(), tau_);
}
@ -89,4 +83,5 @@ Foam::scalar Foam::radiation::constantTransmissivity::t
return tau_;
}
// ************************************************************************* //

View File

@ -78,7 +78,7 @@ public:
//- Destructor
virtual ~constantTransmissivity();
virtual ~constantTransmissivity() = default;
// Member Functions
@ -91,8 +91,7 @@ public:
scalarField* T = nullptr
) const;
//- Return tranmissivity on facw
//- Return transmissivity on facw
scalar t
(
const label faceI,
@ -101,14 +100,12 @@ public:
const scalar T = 0
) const;
//- Is Grey
inline bool isGrey() const
{
return true;
}
//- Number of bands
inline label nBands() const
{

View File

@ -62,12 +62,6 @@ Foam::radiation::multiBandTransmissivity::multiBandTransmissivity
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::multiBandTransmissivity::~multiBandTransmissivity()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField>
@ -78,7 +72,7 @@ Foam::radiation::multiBandTransmissivity::t
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), tauCoeffs_[bandI]));
return tmp<scalarField>::New(pp_.size(), tauCoeffs_[bandI]);
}
@ -94,5 +88,4 @@ Foam::scalar Foam::radiation::multiBandTransmissivity::t
}
// ************************************************************************* //

View File

@ -105,14 +105,14 @@ public:
//- Destructor
virtual ~multiBandTransmissivity();
virtual ~multiBandTransmissivity() = default;
// Member Functions
// Access
//- Return tranmissivity
//- Return transmissivity
tmp<scalarField> t
(
const label bandI = 0,
@ -120,8 +120,7 @@ public:
scalarField* T = nullptr
) const;
//- Return tranmissivity on face
//- Return transmissivity on face
scalar t
(
const label faceI,
@ -130,7 +129,6 @@ public:
const scalar T = 0
) const;
//- Is Grey
inline bool isGrey() const
{
@ -142,7 +140,6 @@ public:
{
return nBands_;
}
};

View File

@ -50,10 +50,4 @@ Foam::radiation::wallTransmissivityModel::wallTransmissivityModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::radiation::wallTransmissivityModel::~wallTransmissivityModel()
{}
// ************************************************************************* //

View File

@ -45,7 +45,7 @@ namespace radiation
{
/*---------------------------------------------------------------------------*\
Class wallTransmissivityModel Declaration
Class wallTransmissivityModel Declaration
\*---------------------------------------------------------------------------*/
class wallTransmissivityModel
@ -58,6 +58,7 @@ protected:
//- Reference to the polyPatch
const polyPatch& pp_;
public:
//- Runtime type information
@ -94,12 +95,12 @@ public:
//- Destructor
virtual ~wallTransmissivityModel();
virtual ~wallTransmissivityModel() = default;
// Member Functions
//- Return tranmissivity
//- Return transmissivity
virtual tmp<scalarField> t
(
const label bandI = 0,
@ -107,8 +108,7 @@ public:
scalarField* T = nullptr
) const = 0;
//- Return tranmissivity on face
//- Return transmissivity on face
virtual scalar t
(
const label faceI,
@ -117,13 +117,11 @@ public:
const scalar T = 0
) const = 0;
//- Is Grey
virtual bool isGrey() const = 0;
//- Number of bands
virtual label nBands() const = 0;
};

View File

@ -37,7 +37,7 @@ wallTransmissivityModel::New
{
const word modelType(dict.get<word>("wallTransmissivityModel"));
auto cstrIter = dictionaryConstructorTablePtr_->find(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{