mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'feature-reflectiveSolarLoad' into 'develop'
Feature reflective solar load See merge request Development/OpenFOAM-plus!243
This commit is contained in:
@ -533,6 +533,11 @@ bool Foam::radiation::laserDTRM::read()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::laserDTRM::nBands() const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::radiation::laserDTRM::calculate()
|
void Foam::radiation::laserDTRM::calculate()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -250,6 +250,9 @@ public:
|
|||||||
//- Read radiation properties dictionary
|
//- Read radiation properties dictionary
|
||||||
bool read();
|
bool read();
|
||||||
|
|
||||||
|
//- Number of bands for this radiation model
|
||||||
|
virtual label nBands() const;
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
|
|||||||
@ -2191,16 +2191,36 @@ Foam::triSurface Foam::triSurfaceTools::triangulate
|
|||||||
(
|
(
|
||||||
const polyBoundaryMesh& bMesh,
|
const polyBoundaryMesh& bMesh,
|
||||||
const labelHashSet& includePatches,
|
const labelHashSet& includePatches,
|
||||||
|
labelList& faceMap,
|
||||||
const bool verbose
|
const bool verbose
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const polyMesh& mesh = bMesh.mesh();
|
const polyMesh& mesh = bMesh.mesh();
|
||||||
|
|
||||||
// Storage for surfaceMesh. Size estimate.
|
// Storage for surfaceMesh. Size estimate.
|
||||||
DynamicList<labelledTri> triangles(mesh.nBoundaryFaces());
|
List<labelledTri> triangles;
|
||||||
|
|
||||||
|
// Calculate number of faces and triangles
|
||||||
|
label nFaces = 0;
|
||||||
|
label nTris = 0;
|
||||||
|
|
||||||
|
for (const label patchi : includePatches)
|
||||||
|
{
|
||||||
|
const polyPatch& patch = bMesh[patchi];
|
||||||
|
const pointField& points = patch.points();
|
||||||
|
nFaces += patch.size();
|
||||||
|
for (const face& f : patch)
|
||||||
|
{
|
||||||
|
faceList triFaces(f.nTriangles(points));
|
||||||
|
nTris += triFaces.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
triangles.setSize(nTris);
|
||||||
|
faceMap.setSize(nTris);
|
||||||
label newPatchi = 0;
|
label newPatchi = 0;
|
||||||
|
|
||||||
|
nTris = 0;
|
||||||
for (const label patchi : includePatches)
|
for (const label patchi : includePatches)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = bMesh[patchi];
|
const polyPatch& patch = bMesh[patchi];
|
||||||
@ -2208,6 +2228,7 @@ Foam::triSurface Foam::triSurfaceTools::triangulate
|
|||||||
|
|
||||||
label nTriTotal = 0;
|
label nTriTotal = 0;
|
||||||
|
|
||||||
|
label faceI = 0;
|
||||||
for (const face& f : patch)
|
for (const face& f : patch)
|
||||||
{
|
{
|
||||||
faceList triFaces(f.nTriangles(points));
|
faceList triFaces(f.nTriangles(points));
|
||||||
@ -2218,10 +2239,13 @@ Foam::triSurface Foam::triSurfaceTools::triangulate
|
|||||||
|
|
||||||
for (const face& f : triFaces)
|
for (const face& f : triFaces)
|
||||||
{
|
{
|
||||||
triangles.append(labelledTri(f[0], f[1], f[2], newPatchi));
|
faceMap[nTris] = patch.start() + faceI;
|
||||||
|
triangles[nTris++] = labelledTri(f[0], f[1], f[2], newPatchi);
|
||||||
|
|
||||||
++nTriTotal;
|
++nTriTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
faceI++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
@ -2233,7 +2257,7 @@ Foam::triSurface Foam::triSurfaceTools::triangulate
|
|||||||
|
|
||||||
newPatchi++;
|
newPatchi++;
|
||||||
}
|
}
|
||||||
triangles.shrink();
|
//triangles.shrink();
|
||||||
|
|
||||||
// Create globally numbered tri surface
|
// Create globally numbered tri surface
|
||||||
triSurface rawSurface(triangles, mesh.points());
|
triSurface rawSurface(triangles, mesh.points());
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2018 OpenFOAM Foundation
|
| Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
@ -479,10 +479,12 @@ public:
|
|||||||
//- Simple triangulation of (selected patches of) boundaryMesh. Needs
|
//- Simple triangulation of (selected patches of) boundaryMesh. Needs
|
||||||
// polyMesh (or polyBoundaryMesh) since only at this level are the
|
// polyMesh (or polyBoundaryMesh) since only at this level are the
|
||||||
// triangles on neighbouring patches connected.
|
// triangles on neighbouring patches connected.
|
||||||
|
// Return faceMap from triI to faceI
|
||||||
static triSurface triangulate
|
static triSurface triangulate
|
||||||
(
|
(
|
||||||
const polyBoundaryMesh& mBesh,
|
const polyBoundaryMesh& mBesh,
|
||||||
const labelHashSet& includePatches,
|
const labelHashSet& includePatches,
|
||||||
|
labelList& faceMap,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -3794,7 +3794,7 @@ void Foam::distributedTriSurfaceMesh::getRegion
|
|||||||
labelList triangleIndex(info.size());
|
labelList triangleIndex(info.size());
|
||||||
autoPtr<mapDistribute> mapPtr
|
autoPtr<mapDistribute> mapPtr
|
||||||
(
|
(
|
||||||
calcLocalQueries
|
localQueries
|
||||||
(
|
(
|
||||||
info,
|
info,
|
||||||
triangleIndex
|
triangleIndex
|
||||||
@ -3859,7 +3859,7 @@ void Foam::distributedTriSurfaceMesh::getNormal
|
|||||||
labelList triangleIndex(info.size());
|
labelList triangleIndex(info.size());
|
||||||
autoPtr<mapDistribute> mapPtr
|
autoPtr<mapDistribute> mapPtr
|
||||||
(
|
(
|
||||||
calcLocalQueries
|
localQueries
|
||||||
(
|
(
|
||||||
info,
|
info,
|
||||||
triangleIndex
|
triangleIndex
|
||||||
@ -4261,7 +4261,7 @@ void Foam::distributedTriSurfaceMesh::getField
|
|||||||
labelList triangleIndex(info.size());
|
labelList triangleIndex(info.size());
|
||||||
autoPtr<mapDistribute> mapPtr
|
autoPtr<mapDistribute> mapPtr
|
||||||
(
|
(
|
||||||
calcLocalQueries
|
localQueries
|
||||||
(
|
(
|
||||||
info,
|
info,
|
||||||
triangleIndex
|
triangleIndex
|
||||||
@ -4352,6 +4352,128 @@ Foam::triSurface Foam::distributedTriSurfaceMesh::overlappingSurface
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Exchanges indices to the processor they come from.
|
||||||
|
// - calculates exchange map
|
||||||
|
// - uses map to calculate local triangle index
|
||||||
|
Foam::autoPtr<Foam::mapDistribute>
|
||||||
|
Foam::distributedTriSurfaceMesh::localQueries
|
||||||
|
(
|
||||||
|
const List<pointIndexHit>& info,
|
||||||
|
labelList& triangleIndex
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
triangleIndex.setSize(info.size());
|
||||||
|
|
||||||
|
const globalIndex& triIndexer = globalTris();
|
||||||
|
|
||||||
|
|
||||||
|
// Determine send map
|
||||||
|
// ~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Since determining which processor the query should go to is
|
||||||
|
// cheap we do a multi-pass algorithm to save some memory temporarily.
|
||||||
|
|
||||||
|
// 1. Count
|
||||||
|
labelList nSend(Pstream::nProcs(), 0);
|
||||||
|
|
||||||
|
forAll(info, i)
|
||||||
|
{
|
||||||
|
if (info[i].hit())
|
||||||
|
{
|
||||||
|
label proci = triIndexer.whichProcID(info[i].index());
|
||||||
|
nSend[proci]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Size sendMap
|
||||||
|
labelListList sendMap(Pstream::nProcs());
|
||||||
|
forAll(nSend, proci)
|
||||||
|
{
|
||||||
|
sendMap[proci].setSize(nSend[proci]);
|
||||||
|
nSend[proci] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Fill sendMap
|
||||||
|
forAll(info, i)
|
||||||
|
{
|
||||||
|
if (info[i].hit())
|
||||||
|
{
|
||||||
|
label proci = triIndexer.whichProcID(info[i].index());
|
||||||
|
triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
|
||||||
|
sendMap[proci][nSend[proci]++] = i;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
triangleIndex[i] = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Send over how many i need to receive
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
labelListList sendSizes(Pstream::nProcs());
|
||||||
|
sendSizes[Pstream::myProcNo()].setSize(Pstream::nProcs());
|
||||||
|
forAll(sendMap, proci)
|
||||||
|
{
|
||||||
|
sendSizes[Pstream::myProcNo()][proci] = sendMap[proci].size();
|
||||||
|
}
|
||||||
|
Pstream::gatherList(sendSizes);
|
||||||
|
Pstream::scatterList(sendSizes);
|
||||||
|
|
||||||
|
|
||||||
|
// Determine receive map
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
labelListList constructMap(Pstream::nProcs());
|
||||||
|
|
||||||
|
// My local segments first
|
||||||
|
constructMap[Pstream::myProcNo()] = identity
|
||||||
|
(
|
||||||
|
sendMap[Pstream::myProcNo()].size()
|
||||||
|
);
|
||||||
|
|
||||||
|
label segmenti = constructMap[Pstream::myProcNo()].size();
|
||||||
|
forAll(constructMap, proci)
|
||||||
|
{
|
||||||
|
if (proci != Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
// What i need to receive is what other processor is sending to me.
|
||||||
|
label nRecv = sendSizes[proci][Pstream::myProcNo()];
|
||||||
|
constructMap[proci].setSize(nRecv);
|
||||||
|
|
||||||
|
for (label i = 0; i < nRecv; i++)
|
||||||
|
{
|
||||||
|
constructMap[proci][i] = segmenti++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Pack into distribution map
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
autoPtr<mapDistribute> mapPtr
|
||||||
|
(
|
||||||
|
new mapDistribute
|
||||||
|
(
|
||||||
|
segmenti, // size after construction
|
||||||
|
std::move(sendMap),
|
||||||
|
std::move(constructMap)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const mapDistribute& map = mapPtr();
|
||||||
|
|
||||||
|
|
||||||
|
// Send over queries
|
||||||
|
// ~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
map.distribute(triangleIndex);
|
||||||
|
|
||||||
|
return mapPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::distributedTriSurfaceMesh::distribute
|
void Foam::distributedTriSurfaceMesh::distribute
|
||||||
(
|
(
|
||||||
const List<treeBoundBox>& bbs,
|
const List<treeBoundBox>& bbs,
|
||||||
|
|||||||
@ -202,6 +202,7 @@ private:
|
|||||||
|
|
||||||
// Triangle index
|
// Triangle index
|
||||||
|
|
||||||
|
|
||||||
//- Helper: convert local triangle indices to global ones
|
//- Helper: convert local triangle indices to global ones
|
||||||
void convertTriIndices(List<pointIndexHit>& info) const;
|
void convertTriIndices(List<pointIndexHit>& info) const;
|
||||||
|
|
||||||
@ -559,6 +560,17 @@ public:
|
|||||||
labelList& subFaceMap
|
labelList& subFaceMap
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Obtains global indices from pointIndexHit and swaps them back
|
||||||
|
// to their original processor. Used to calculate local region
|
||||||
|
// and normal.
|
||||||
|
virtual autoPtr<mapDistribute> localQueries
|
||||||
|
(
|
||||||
|
const List<pointIndexHit>&,
|
||||||
|
labelList& triangleIndex
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
//- Print some stats. Parallel aware version of
|
//- Print some stats. Parallel aware version of
|
||||||
// triSurface::writeStats.
|
// triSurface::writeStats.
|
||||||
void writeStats(Ostream& os) const;
|
void writeStats(Ostream& os) const;
|
||||||
|
|||||||
@ -77,6 +77,8 @@ Foam::patchDistMethods::exact::patchSurface() const
|
|||||||
|
|
||||||
Info<< "Triangulating local patch faces" << nl << endl;
|
Info<< "Triangulating local patch faces" << nl << endl;
|
||||||
|
|
||||||
|
labelList mapTriToGlobal;
|
||||||
|
|
||||||
patchSurfPtr_.reset
|
patchSurfPtr_.reset
|
||||||
(
|
(
|
||||||
new distributedTriSurfaceMesh
|
new distributedTriSurfaceMesh
|
||||||
@ -93,7 +95,8 @@ Foam::patchDistMethods::exact::patchSurface() const
|
|||||||
triSurfaceTools::triangulate
|
triSurfaceTools::triangulate
|
||||||
(
|
(
|
||||||
pbm,
|
pbm,
|
||||||
patchIDs_
|
patchIDs_,
|
||||||
|
mapTriToGlobal
|
||||||
),
|
),
|
||||||
dict
|
dict
|
||||||
)
|
)
|
||||||
|
|||||||
@ -11,6 +11,7 @@ radiationModels/viewFactor/viewFactor.C
|
|||||||
radiationModels/opaqueSolid/opaqueSolid.C
|
radiationModels/opaqueSolid/opaqueSolid.C
|
||||||
radiationModels/solarLoad/solarLoad.C
|
radiationModels/solarLoad/solarLoad.C
|
||||||
radiationModels/solarLoad/faceShading/faceShading.C
|
radiationModels/solarLoad/faceShading/faceShading.C
|
||||||
|
radiationModels/solarLoad/faceReflecting/faceReflecting.C
|
||||||
|
|
||||||
/* Scatter model */
|
/* Scatter model */
|
||||||
submodels/scatterModel/scatterModel/scatterModel.C
|
submodels/scatterModel/scatterModel/scatterModel.C
|
||||||
@ -18,6 +19,18 @@ submodels/scatterModel/scatterModel/scatterModelNew.C
|
|||||||
submodels/scatterModel/noScatter/noScatter.C
|
submodels/scatterModel/noScatter/noScatter.C
|
||||||
submodels/scatterModel/constantScatter/constantScatter.C
|
submodels/scatterModel/constantScatter/constantScatter.C
|
||||||
|
|
||||||
|
/* Wall sub-models */
|
||||||
|
submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModel.C
|
||||||
|
submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C
|
||||||
|
submodels/wallTransmissivityModel/constantTransmissivity/constantTransmissivity.C
|
||||||
|
submodels/wallTransmissivityModel/multiBandTransmissivity/multiBandTransmissivity.C
|
||||||
|
|
||||||
|
submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel.C
|
||||||
|
submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C
|
||||||
|
submodels/wallAbsorptionEmissionModel/multiBandAbsorption/multiBandAbsorption.C
|
||||||
|
submodels/wallAbsorptionEmissionModel/constantAbsorption/constantAbsorption.C
|
||||||
|
submodels/wallAbsorptionEmissionModel/solidAbsorption/solidAbsorption.C
|
||||||
|
|
||||||
/* Absorption/Emission model */
|
/* Absorption/Emission model */
|
||||||
submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C
|
submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C
|
||||||
submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C
|
submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C
|
||||||
@ -31,18 +44,19 @@ submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSoli
|
|||||||
submodels/boundaryRadiationProperties/boundaryRadiationProperties.C
|
submodels/boundaryRadiationProperties/boundaryRadiationProperties.C
|
||||||
submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
|
submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
|
||||||
|
|
||||||
|
/* Types of radiative walls */
|
||||||
|
submodels/boundaryRadiationProperties/transparent/transparent.C
|
||||||
|
submodels/boundaryRadiationProperties/lookup/lookup.C
|
||||||
|
submodels/boundaryRadiationProperties/opaqueDiffusive/opaqueDiffusive.C
|
||||||
|
submodels/boundaryRadiationProperties/opaqueReflective/opaqueReflective.C
|
||||||
|
|
||||||
/* Soot model */
|
/* Soot model */
|
||||||
submodels/sootModel/sootModel/sootModel.C
|
submodels/sootModel/sootModel/sootModel.C
|
||||||
submodels/sootModel/sootModel/sootModelNew.C
|
submodels/sootModel/sootModel/sootModelNew.C
|
||||||
submodels/sootModel/mixtureFractionSoot/mixtureFractionSoots.C
|
submodels/sootModel/mixtureFractionSoot/mixtureFractionSoots.C
|
||||||
submodels/sootModel/noSoot/noSoot.C
|
submodels/sootModel/noSoot/noSoot.C
|
||||||
|
|
||||||
/* Transmissivity model */
|
|
||||||
submodels/transmissivityModel/transmissivityModel/transmissivityModel.C
|
|
||||||
submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C
|
|
||||||
submodels/transmissivityModel/noTransmissivity/noTransmissivity.C
|
|
||||||
submodels/transmissivityModel/constantTransmissivity/constantTransmissivity.C
|
|
||||||
submodels/transmissivityModel/multiBandSolidTransmissivity/multiBandSolidTransmissivity.C
|
|
||||||
|
|
||||||
/* Solar calculator model */
|
/* Solar calculator model */
|
||||||
submodels/solarCalculator/solarCalculator.C
|
submodels/solarCalculator/solarCalculator.C
|
||||||
|
|||||||
@ -47,8 +47,7 @@ greyDiffusiveRadiationMixedFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
TName_("T"),
|
TName_("T")
|
||||||
solarLoad_(false)
|
|
||||||
{
|
{
|
||||||
refValue() = 0.0;
|
refValue() = 0.0;
|
||||||
refGrad() = 0.0;
|
refGrad() = 0.0;
|
||||||
@ -66,8 +65,7 @@ greyDiffusiveRadiationMixedFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
TName_(ptf.TName_),
|
TName_(ptf.TName_)
|
||||||
solarLoad_(ptf.solarLoad_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -80,8 +78,7 @@ greyDiffusiveRadiationMixedFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
TName_(dict.lookupOrDefault<word>("T", "T")),
|
TName_(dict.lookupOrDefault<word>("T", "T"))
|
||||||
solarLoad_(dict.lookupOrDefault("solarLoad", false))
|
|
||||||
{
|
{
|
||||||
if (dict.found("refValue"))
|
if (dict.found("refValue"))
|
||||||
{
|
{
|
||||||
@ -111,8 +108,7 @@ greyDiffusiveRadiationMixedFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(ptf),
|
mixedFvPatchScalarField(ptf),
|
||||||
TName_(ptf.TName_),
|
TName_(ptf.TName_)
|
||||||
solarLoad_(ptf.solarLoad_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -124,8 +120,7 @@ greyDiffusiveRadiationMixedFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(ptf, iF),
|
mixedFvPatchScalarField(ptf, iF),
|
||||||
TName_(ptf.TName_),
|
TName_(ptf.TName_)
|
||||||
solarLoad_(ptf.solarLoad_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -197,12 +192,23 @@ updateCoeffs()
|
|||||||
Ir += dom.IRay(rayI).qin().boundaryField()[patchi];
|
Ir += dom.IRay(rayI).qin().boundaryField()[patchi];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (solarLoad_)
|
if (dom.useSolarLoad())
|
||||||
{
|
{
|
||||||
|
// Looking for primary heat flux single band
|
||||||
Ir += patch().lookupPatchField<volScalarField,scalar>
|
Ir += patch().lookupPatchField<volScalarField,scalar>
|
||||||
(
|
(
|
||||||
dom.externalRadHeatFieldName_
|
dom.primaryFluxName_ + "_0"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
word qSecName = dom.relfectedFluxName_ + "_0";
|
||||||
|
|
||||||
|
if (this->db().foundObject<volScalarField>(qSecName))
|
||||||
|
{
|
||||||
|
const volScalarField& qSec =
|
||||||
|
this->db().lookupObject<volScalarField>(qSecName);
|
||||||
|
|
||||||
|
Ir += qSec.boundaryField()[patch().index()];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(Iw, faceI)
|
forAll(Iw, faceI)
|
||||||
@ -248,7 +254,6 @@ void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::write
|
|||||||
{
|
{
|
||||||
mixedFvPatchScalarField::write(os);
|
mixedFvPatchScalarField::write(os);
|
||||||
os.writeEntryIfDifferent<word>("T", "T", TName_);
|
os.writeEntryIfDifferent<word>("T", "T", TName_);
|
||||||
os.writeEntry("solarLoad", solarLoad_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -86,10 +86,6 @@ class greyDiffusiveRadiationMixedFvPatchScalarField
|
|||||||
//- Name of temperature field
|
//- Name of temperature field
|
||||||
word TName_;
|
word TName_;
|
||||||
|
|
||||||
//- Activate solar load
|
|
||||||
bool solarLoad_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
|||||||
@ -30,6 +30,7 @@ License
|
|||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
#include "viewFactor.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -41,8 +42,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
qro_(),
|
qro_()
|
||||||
solarLoad_(false)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -56,8 +56,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
qro_(ptf.qro_, mapper),
|
qro_(ptf.qro_, mapper)
|
||||||
solarLoad_(ptf.solarLoad_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -70,8 +69,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF, dict, false),
|
fixedValueFvPatchScalarField(p, iF, dict, false),
|
||||||
qro_("qro", dict, p.size()),
|
qro_("qro", dict, p.size())
|
||||||
solarLoad_(dict.lookupOrDefault("solarLoad", false))
|
|
||||||
{
|
{
|
||||||
if (dict.found("value"))
|
if (dict.found("value"))
|
||||||
{
|
{
|
||||||
@ -95,8 +93,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf),
|
fixedValueFvPatchScalarField(ptf),
|
||||||
qro_(ptf.qro_),
|
qro_(ptf.qro_)
|
||||||
solarLoad_(ptf.solarLoad_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -108,8 +105,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, iF),
|
fixedValueFvPatchScalarField(ptf, iF),
|
||||||
qro_(ptf.qro_),
|
qro_(ptf.qro_)
|
||||||
solarLoad_(ptf.solarLoad_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -167,19 +163,29 @@ updateCoeffs()
|
|||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::radiation::
|
Foam::tmp<Foam::scalarField> Foam::radiation::
|
||||||
greyDiffusiveViewFactorFixedValueFvPatchScalarField::qro() const
|
greyDiffusiveViewFactorFixedValueFvPatchScalarField::qro(label bandI) const
|
||||||
{
|
{
|
||||||
tmp<scalarField> tqrt(new scalarField(qro_));
|
tmp<scalarField> tqrt(new scalarField(qro_));
|
||||||
|
|
||||||
if (solarLoad_)
|
const viewFactor& radiation =
|
||||||
{
|
db().lookupObject<viewFactor>("radiationProperties");
|
||||||
const radiationModel& radiation =
|
|
||||||
db().lookupObject<radiationModel>("radiationProperties");
|
|
||||||
|
|
||||||
|
if (radiation.useSolarLoad())
|
||||||
|
{
|
||||||
tqrt.ref() += patch().lookupPatchField<volScalarField, scalar>
|
tqrt.ref() += patch().lookupPatchField<volScalarField, scalar>
|
||||||
(
|
(
|
||||||
radiation.externalRadHeatFieldName_
|
radiation.primaryFluxName_ + "_" + name(bandI)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
word qSecName = radiation.relfectedFluxName_ + "_" + name(bandI);
|
||||||
|
|
||||||
|
if (this->db().foundObject<volScalarField>(qSecName))
|
||||||
|
{
|
||||||
|
const volScalarField& qSec =
|
||||||
|
this->db().lookupObject<volScalarField>(qSecName);
|
||||||
|
|
||||||
|
tqrt.ref() += qSec.boundaryField()[patch().index()];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tqrt;
|
return tqrt;
|
||||||
@ -194,7 +200,6 @@ write
|
|||||||
{
|
{
|
||||||
fixedValueFvPatchScalarField::write(os);
|
fixedValueFvPatchScalarField::write(os);
|
||||||
qro_.writeEntry("qro", os);
|
qro_.writeEntry("qro", os);
|
||||||
os.writeEntry("solarLoad", solarLoad_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,6 @@ Usage
|
|||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
qro | external radiative heat flux | yes |
|
qro | external radiative heat flux | yes |
|
||||||
emissivityMode | emissivity mode: solidRadiation or lookup | yes |
|
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -46,8 +45,6 @@ Usage
|
|||||||
{
|
{
|
||||||
type greyDiffusiveRadiationViewFactor;
|
type greyDiffusiveRadiationViewFactor;
|
||||||
qro uniform 0;
|
qro uniform 0;
|
||||||
emissivityMode solidRadiation;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
@ -87,9 +84,6 @@ class greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
|||||||
//- External radiative heat flux
|
//- External radiative heat flux
|
||||||
scalarField qro_;
|
scalarField qro_;
|
||||||
|
|
||||||
//- Activate solar load
|
|
||||||
bool solarLoad_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -168,7 +162,7 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return external + solar load radiative heat flux
|
//- Return external + solar load radiative heat flux
|
||||||
tmp<scalarField> qro() const;
|
tmp<scalarField> qro(label bandI = 0) const;
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|||||||
@ -213,6 +213,25 @@ updateCoeffs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dom.useSolarLoad())
|
||||||
|
{
|
||||||
|
// Looking for primary heat flux single band
|
||||||
|
Ir += patch().lookupPatchField<volScalarField,scalar>
|
||||||
|
(
|
||||||
|
dom.primaryFluxName_ + "_" + name(lambdaId - 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
word qSecName = dom.relfectedFluxName_ + "_" + name(lambdaId - 1);
|
||||||
|
|
||||||
|
if (this->db().foundObject<volScalarField>(qSecName))
|
||||||
|
{
|
||||||
|
const volScalarField& qSec =
|
||||||
|
this->db().lookupObject<volScalarField>(qSecName);
|
||||||
|
|
||||||
|
Ir += qSec.boundaryField()[patch().index()];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
forAll(Iw, facei)
|
forAll(Iw, facei)
|
||||||
{
|
{
|
||||||
const vector& d = dom.IRay(rayId).d();
|
const vector& d = dom.IRay(rayId).d();
|
||||||
|
|||||||
@ -292,4 +292,9 @@ Foam::radiation::P1::Ru() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::P1::nBands() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->nBands();
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -128,6 +128,9 @@ public:
|
|||||||
|
|
||||||
//- Source term component (constant)
|
//- Source term component (constant)
|
||||||
virtual tmp<volScalarField::Internal> Ru() const;
|
virtual tmp<volScalarField::Internal> Ru() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
label nBands() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -193,10 +193,7 @@ void Foam::radiation::fvDOM::initialise()
|
|||||||
if (useSolarLoad_)
|
if (useSolarLoad_)
|
||||||
{
|
{
|
||||||
const dictionary& solarDict = this->subDict("solarLoarCoeffs");
|
const dictionary& solarDict = this->subDict("solarLoarCoeffs");
|
||||||
solarLoad_.reset
|
solarLoad_.reset(new solarLoad(solarDict, T_));
|
||||||
(
|
|
||||||
new solarLoad(solarDict, T_, externalRadHeatFieldName_)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (solarLoad_->nBands() > 1)
|
if (solarLoad_->nBands() > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -244,6 +244,9 @@ public:
|
|||||||
//- Number of wavelengths
|
//- Number of wavelengths
|
||||||
inline label nLambda() const;
|
inline label nLambda() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
inline label nBands() const;
|
||||||
|
|
||||||
//- Const access to total absorption coefficient
|
//- Const access to total absorption coefficient
|
||||||
inline const volScalarField& a() const;
|
inline const volScalarField& a() const;
|
||||||
|
|
||||||
@ -270,6 +273,9 @@ public:
|
|||||||
|
|
||||||
//- Return meshOrientation
|
//- Return meshOrientation
|
||||||
inline vector meshOrientation() const;
|
inline vector meshOrientation() const;
|
||||||
|
|
||||||
|
//- Use solar load
|
||||||
|
inline bool useSolarLoad() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -67,6 +67,11 @@ inline Foam::label Foam::radiation::fvDOM::nLambda() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::label Foam::radiation::fvDOM::nBands() const
|
||||||
|
{
|
||||||
|
return nLambda_;
|
||||||
|
}
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::radiation::fvDOM::a() const
|
inline const Foam::volScalarField& Foam::radiation::fvDOM::a() const
|
||||||
{
|
{
|
||||||
return a_;
|
return a_;
|
||||||
@ -124,4 +129,9 @@ inline Foam::vector Foam::radiation::fvDOM::meshOrientation() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::radiation::fvDOM::useSolarLoad() const
|
||||||
|
{
|
||||||
|
return useSolarLoad_;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -101,6 +101,12 @@ public:
|
|||||||
|
|
||||||
//- Source term component (constant)
|
//- Source term component (constant)
|
||||||
tmp<volScalarField::Internal> Ru() const;
|
tmp<volScalarField::Internal> Ru() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
label nBands() const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -121,4 +121,9 @@ Foam::radiation::opaqueSolid::Ru() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::opaqueSolid::nBands() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->nBands();
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -102,6 +102,9 @@ public:
|
|||||||
|
|
||||||
//- Source term component (constant)
|
//- Source term component (constant)
|
||||||
tmp<volScalarField::Internal> Ru() const;
|
tmp<volScalarField::Internal> Ru() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
label nBands() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,12 @@ namespace Foam
|
|||||||
const Foam::word Foam::radiation::radiationModel::externalRadHeatFieldName_ =
|
const Foam::word Foam::radiation::radiationModel::externalRadHeatFieldName_ =
|
||||||
"qrExt";
|
"qrExt";
|
||||||
|
|
||||||
|
const Foam::word Foam::radiation::radiationModel::primaryFluxName_ =
|
||||||
|
"qprimaryRad";
|
||||||
|
|
||||||
|
const Foam::word Foam::radiation::radiationModel::relfectedFluxName_ =
|
||||||
|
"qreflective";
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::IOobject Foam::radiation::radiationModel::createIOobject
|
Foam::IOobject Foam::radiation::radiationModel::createIOobject
|
||||||
@ -90,8 +96,6 @@ void Foam::radiation::radiationModel::initialise()
|
|||||||
scatter_.reset(scatterModel::New(*this, mesh_).ptr());
|
scatter_.reset(scatterModel::New(*this, mesh_).ptr());
|
||||||
|
|
||||||
soot_.reset(sootModel::New(*this, mesh_).ptr());
|
soot_.reset(sootModel::New(*this, mesh_).ptr());
|
||||||
|
|
||||||
transmissivity_.reset(transmissivityModel::New(*this, mesh_).ptr());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,8 +124,7 @@ Foam::radiation::radiationModel::radiationModel(const volScalarField& T)
|
|||||||
firstIter_(true),
|
firstIter_(true),
|
||||||
absorptionEmission_(nullptr),
|
absorptionEmission_(nullptr),
|
||||||
scatter_(nullptr),
|
scatter_(nullptr),
|
||||||
soot_(nullptr),
|
soot_(nullptr)
|
||||||
transmissivity_(nullptr)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -141,8 +144,7 @@ Foam::radiation::radiationModel::radiationModel
|
|||||||
firstIter_(true),
|
firstIter_(true),
|
||||||
absorptionEmission_(nullptr),
|
absorptionEmission_(nullptr),
|
||||||
scatter_(nullptr),
|
scatter_(nullptr),
|
||||||
soot_(nullptr),
|
soot_(nullptr)
|
||||||
transmissivity_(nullptr)
|
|
||||||
{
|
{
|
||||||
if (readOpt() == IOobject::NO_READ)
|
if (readOpt() == IOobject::NO_READ)
|
||||||
{
|
{
|
||||||
@ -181,8 +183,7 @@ Foam::radiation::radiationModel::radiationModel
|
|||||||
firstIter_(true),
|
firstIter_(true),
|
||||||
absorptionEmission_(nullptr),
|
absorptionEmission_(nullptr),
|
||||||
scatter_(nullptr),
|
scatter_(nullptr),
|
||||||
soot_(nullptr),
|
soot_(nullptr)
|
||||||
transmissivity_(nullptr)
|
|
||||||
{
|
{
|
||||||
initialise();
|
initialise();
|
||||||
}
|
}
|
||||||
@ -319,7 +320,7 @@ Foam::radiation::radiationModel::soot() const
|
|||||||
return *soot_;
|
return *soot_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
const Foam::radiation::transmissivityModel&
|
const Foam::radiation::transmissivityModel&
|
||||||
Foam::radiation::radiationModel::transmissivity() const
|
Foam::radiation::radiationModel::transmissivity() const
|
||||||
{
|
{
|
||||||
@ -332,6 +333,6 @@ Foam::radiation::radiationModel::transmissivity() const
|
|||||||
|
|
||||||
return *transmissivity_;
|
return *transmissivity_;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -50,7 +50,7 @@ SourceFiles
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "fvMatricesFwd.H"
|
#include "fvMatricesFwd.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
#include "transmissivityModel.H"
|
#include "absorptionEmissionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ namespace radiation
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward declaration of classes
|
||||||
class absorptionEmissionModel;
|
//class absorptionEmissionModel;
|
||||||
class scatterModel;
|
class scatterModel;
|
||||||
class sootModel;
|
class sootModel;
|
||||||
|
|
||||||
@ -83,6 +83,13 @@ public:
|
|||||||
//- Static name external radiative fluxes
|
//- Static name external radiative fluxes
|
||||||
static const word externalRadHeatFieldName_;
|
static const word externalRadHeatFieldName_;
|
||||||
|
|
||||||
|
//- Static name for primary solar fluxes
|
||||||
|
static const word primaryFluxName_;
|
||||||
|
|
||||||
|
//- Static name for reflected solar fluxes
|
||||||
|
static const word relfectedFluxName_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
@ -124,7 +131,7 @@ protected:
|
|||||||
autoPtr<sootModel> soot_;
|
autoPtr<sootModel> soot_;
|
||||||
|
|
||||||
//- Transmissivity model
|
//- Transmissivity model
|
||||||
autoPtr<transmissivityModel> transmissivity_;
|
//autoPtr<transmissivityModel> transmissivity_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -265,12 +272,11 @@ public:
|
|||||||
volScalarField& T
|
volScalarField& T
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
virtual label nBands() const = 0;
|
||||||
|
|
||||||
//- Access to absorptionEmission model
|
//- Access to absorptionEmission model
|
||||||
const absorptionEmissionModel& absorptionEmission() const;
|
const absorptionEmissionModel& absorptionEmission() const;
|
||||||
|
|
||||||
//- Access to transmissivity Model
|
|
||||||
const transmissivityModel& transmissivity() const;
|
|
||||||
|
|
||||||
//- Access to soot Model
|
//- Access to soot Model
|
||||||
const sootModel& soot() const;
|
const sootModel& soot() const;
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,572 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "faceReflecting.H"
|
||||||
|
#include "boundaryRadiationProperties.H"
|
||||||
|
#include "cyclicAMIPolyPatch.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace Foam::constant::mathematical;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(faceReflecting, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::faceReflecting::initialise(const dictionary& coeffs)
|
||||||
|
{
|
||||||
|
|
||||||
|
forAll(qreflective_, bandI)
|
||||||
|
{
|
||||||
|
qreflective_.set
|
||||||
|
(
|
||||||
|
bandI,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"qreflective_" + Foam::name(bandI) ,
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
label rayI = 0;
|
||||||
|
if (mesh_.nSolutionD() == 3)
|
||||||
|
{
|
||||||
|
nRay_ = 4*nPhi_*nTheta_;
|
||||||
|
refDiscAngles_.resize(nRay_);
|
||||||
|
const scalar deltaPhi = pi/(2.0*nPhi_);
|
||||||
|
const scalar deltaTheta = pi/nTheta_;
|
||||||
|
|
||||||
|
for (label n = 1; n <= nTheta_; n++)
|
||||||
|
{
|
||||||
|
for (label m = 1; m <= 4*nPhi_; m++)
|
||||||
|
{
|
||||||
|
const scalar thetai = (2*n - 1)*deltaTheta/2.0;
|
||||||
|
const scalar phii = (2*m - 1)*deltaPhi/2.0;
|
||||||
|
|
||||||
|
scalar sinTheta = Foam::sin(thetai);
|
||||||
|
scalar cosTheta = Foam::cos(thetai);
|
||||||
|
scalar sinPhi = Foam::sin(phii);
|
||||||
|
scalar cosPhi = Foam::cos(phii);
|
||||||
|
refDiscAngles_[rayI++] =
|
||||||
|
vector(sinTheta*sinPhi, sinTheta*cosPhi, cosTheta);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (mesh_.nSolutionD() == 2)
|
||||||
|
{
|
||||||
|
nRay_ = 4*nPhi_;
|
||||||
|
refDiscAngles_.resize(nRay_);
|
||||||
|
const scalar thetai = piByTwo;
|
||||||
|
//const scalar deltaTheta = pi;
|
||||||
|
const scalar deltaPhi = pi/(2.0*nPhi_);
|
||||||
|
for (label m = 1; m <= 4*nPhi_; m++)
|
||||||
|
{
|
||||||
|
const scalar phii = (2*m - 1)*deltaPhi/2.0;
|
||||||
|
|
||||||
|
scalar sinTheta = Foam::sin(thetai);
|
||||||
|
scalar cosTheta = Foam::cos(thetai);
|
||||||
|
scalar sinPhi = Foam::sin(phii);
|
||||||
|
scalar cosPhi = Foam::cos(phii);
|
||||||
|
|
||||||
|
refDiscAngles_[rayI++] =
|
||||||
|
vector(sinTheta*sinPhi, sinTheta*cosPhi, cosTheta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "The reflected rays are available in 2D or 3D "
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
|
const radiation::boundaryRadiationProperties& boundaryRadiation =
|
||||||
|
radiation::boundaryRadiationProperties::New(mesh_);
|
||||||
|
|
||||||
|
// global face index
|
||||||
|
globalIndex globalNumbering(mesh_.nFaces());
|
||||||
|
|
||||||
|
|
||||||
|
// Collect faces with t = 0, r = 0 and a > 0 to shoot rays
|
||||||
|
// and patches to construct the triSurface
|
||||||
|
DynamicList<point> dynCf;
|
||||||
|
DynamicList<vector> dynNf;
|
||||||
|
DynamicList<label> dynFacesI;
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
const pointField& cf = pp.faceCentres();
|
||||||
|
|
||||||
|
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
||||||
|
{
|
||||||
|
const tmp<scalarField> tt =
|
||||||
|
boundaryRadiation.transmissivity(patchI);
|
||||||
|
|
||||||
|
const tmp<scalarField> tr =
|
||||||
|
boundaryRadiation.specReflectivity(patchI);
|
||||||
|
|
||||||
|
const tmp<scalarField> ta =
|
||||||
|
boundaryRadiation.absorptivity(patchI);
|
||||||
|
|
||||||
|
const scalarField& t = tt();
|
||||||
|
const scalarField& r = tr();
|
||||||
|
const scalarField& a = ta();
|
||||||
|
|
||||||
|
const vectorField& n = pp.faceNormals();
|
||||||
|
|
||||||
|
forAll(pp, faceI)
|
||||||
|
{
|
||||||
|
//const vector nf(n[faceI]);
|
||||||
|
// Opaque, non-reflective, absortived faces to shoot
|
||||||
|
if
|
||||||
|
(
|
||||||
|
t[faceI] == 0
|
||||||
|
&& r[faceI] == 0
|
||||||
|
&& a[faceI] > 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
dynFacesI.append(faceI + pp.start());
|
||||||
|
dynCf.append(cf[faceI]);
|
||||||
|
dynNf.append(n[faceI]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// relfective opaque patches to build reflective surface
|
||||||
|
// plus opaque non-reflective
|
||||||
|
if
|
||||||
|
(
|
||||||
|
(r[faceI] > 0 && t[faceI] == 0) ||
|
||||||
|
(t[faceI] == 0 && a[faceI] > 0 && r[faceI] == 0)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
includePatches_.insert(patchI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shootFacesIds_.reset(new labelList(dynFacesI));
|
||||||
|
Cfs_.reset(new pointField(dynCf));
|
||||||
|
Nfs_.reset(new vectorField(dynNf));
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * *
|
||||||
|
// Create distributedTriSurfaceMesh
|
||||||
|
Random rndGen(653213);
|
||||||
|
|
||||||
|
// Determine mesh bounding boxes:
|
||||||
|
List<treeBoundBox> meshBb
|
||||||
|
(
|
||||||
|
1,
|
||||||
|
treeBoundBox
|
||||||
|
(
|
||||||
|
boundBox(mesh_.points(), false)
|
||||||
|
).extend(rndGen, 1e-3)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Dummy bounds dictionary
|
||||||
|
dictionary dict;
|
||||||
|
dict.add("bounds", meshBb);
|
||||||
|
dict.add
|
||||||
|
(
|
||||||
|
"distributionType",
|
||||||
|
distributedTriSurfaceMesh::distributionTypeNames_
|
||||||
|
[
|
||||||
|
distributedTriSurfaceMesh::FROZEN
|
||||||
|
]
|
||||||
|
);
|
||||||
|
dict.add("mergeDistance", SMALL);
|
||||||
|
|
||||||
|
|
||||||
|
triSurface localSurface = triSurfaceTools::triangulate
|
||||||
|
(
|
||||||
|
mesh_.boundaryMesh(),
|
||||||
|
includePatches_,
|
||||||
|
mapTriToGlobal_
|
||||||
|
);
|
||||||
|
|
||||||
|
surfacesMesh_.reset
|
||||||
|
(
|
||||||
|
new distributedTriSurfaceMesh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"reflectiveSurface.stl",
|
||||||
|
mesh_.time().constant(),
|
||||||
|
"triSurface",
|
||||||
|
mesh_.time(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
localSurface,
|
||||||
|
dict
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
surfacesMesh_->searchableSurface::write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::faceReflecting::calculate()
|
||||||
|
{
|
||||||
|
const radiation::boundaryRadiationProperties& boundaryRadiation =
|
||||||
|
radiation::boundaryRadiationProperties::New(mesh_);
|
||||||
|
|
||||||
|
label nFaces = 0;
|
||||||
|
|
||||||
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
|
const fvBoundaryMesh& fvPatches = mesh_.boundary();
|
||||||
|
|
||||||
|
label nBands = spectralDistribution_.size();
|
||||||
|
|
||||||
|
// Collect reflected directions from reflecting surfaces on direct hit
|
||||||
|
// faces
|
||||||
|
const vector sunDir = directHitFaces_.direction();
|
||||||
|
const labelList& directHits = directHitFaces_.rayStartFaces();
|
||||||
|
|
||||||
|
globalIndex globalNumbering(mesh_.nFaces());
|
||||||
|
|
||||||
|
Map<label> refFacesDirIndex;
|
||||||
|
labelList refDisDirsIndex(nRay_, -1);
|
||||||
|
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
|
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
||||||
|
{
|
||||||
|
const tmp<scalarField> tr =
|
||||||
|
boundaryRadiation.specReflectivity(patchI);
|
||||||
|
|
||||||
|
const scalarField& r = tr();
|
||||||
|
const vectorField n(fvPatches[patchI].nf());
|
||||||
|
|
||||||
|
forAll(pp, faceI)
|
||||||
|
{
|
||||||
|
label globalID = faceI + pp.start();
|
||||||
|
|
||||||
|
if (r[faceI] > 0.0 && directHits.found(globalID))
|
||||||
|
{
|
||||||
|
vector refDir =
|
||||||
|
sunDir + 2.0*(-sunDir & n[faceI]) * n[faceI];
|
||||||
|
|
||||||
|
// Look for the discrete direction
|
||||||
|
scalar dev(-GREAT);
|
||||||
|
label rayIndex = -1;
|
||||||
|
forAll(refDiscAngles_, iDisc)
|
||||||
|
{
|
||||||
|
scalar dotProd = refDir & refDiscAngles_[iDisc];
|
||||||
|
if (dev < dotProd)
|
||||||
|
{
|
||||||
|
dev = dotProd;
|
||||||
|
rayIndex = iDisc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rayIndex >= 0)
|
||||||
|
{
|
||||||
|
if (refDisDirsIndex[rayIndex] == -1)
|
||||||
|
{
|
||||||
|
refDisDirsIndex[rayIndex] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
refFacesDirIndex.insert
|
||||||
|
(
|
||||||
|
globalNumbering.toGlobal(globalID),
|
||||||
|
rayIndex
|
||||||
|
);
|
||||||
|
|
||||||
|
nFaces++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Distribute ray indexes to all proc's
|
||||||
|
Pstream::listCombineGather(refDisDirsIndex, maxEqOp<label>());
|
||||||
|
Pstream::listCombineScatter(refDisDirsIndex);
|
||||||
|
|
||||||
|
// Make sure all the processors have the same map
|
||||||
|
Pstream::mapCombineGather(refFacesDirIndex, minEqOp<label>());
|
||||||
|
Pstream::mapCombineScatter(refFacesDirIndex);
|
||||||
|
|
||||||
|
scalar maxBounding = 5.0*mag(mesh_.bounds().max() - mesh_.bounds().min());
|
||||||
|
|
||||||
|
reduce(maxBounding, maxOp<scalar>());
|
||||||
|
|
||||||
|
// Shoot Rays
|
||||||
|
// From faces t = 0, r = 0 and a > 0 to all 'used' discrete reflected
|
||||||
|
// directions
|
||||||
|
|
||||||
|
DynamicField<point> start(nFaces);
|
||||||
|
DynamicField<point> end(start.size());
|
||||||
|
DynamicList<label> startIndex(start.size());
|
||||||
|
DynamicField<label> dirStartIndex(start.size());
|
||||||
|
|
||||||
|
label i = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
for (; i < Cfs_->size(); i++)
|
||||||
|
{
|
||||||
|
const point& fc = Cfs_()[i];
|
||||||
|
|
||||||
|
const vector nf = Nfs_()[i];
|
||||||
|
|
||||||
|
const label myFaceId = shootFacesIds_()[i];
|
||||||
|
|
||||||
|
forAll(refDisDirsIndex, dirIndex)
|
||||||
|
{
|
||||||
|
if (refDisDirsIndex[dirIndex] > -1)
|
||||||
|
{
|
||||||
|
if ((nf & refDiscAngles_[dirIndex]) > 0)
|
||||||
|
{
|
||||||
|
const vector direction = -refDiscAngles_[dirIndex];
|
||||||
|
|
||||||
|
start.append(fc + 0.001*direction);
|
||||||
|
|
||||||
|
startIndex.append(myFaceId);
|
||||||
|
dirStartIndex.append(dirIndex);
|
||||||
|
|
||||||
|
end.append(fc + maxBounding*direction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}while (returnReduce(i < Cfs_->size(), orOp<bool>()));
|
||||||
|
|
||||||
|
List<pointIndexHit> hitInfo(startIndex.size());
|
||||||
|
|
||||||
|
surfacesMesh_->findLine(start, end, hitInfo);
|
||||||
|
|
||||||
|
// Query the local trigId on hit faces
|
||||||
|
labelList triangleIndex;
|
||||||
|
autoPtr<mapDistribute> mapPtr
|
||||||
|
(
|
||||||
|
surfacesMesh_->localQueries
|
||||||
|
(
|
||||||
|
hitInfo,
|
||||||
|
triangleIndex
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const mapDistribute& map = mapPtr();
|
||||||
|
|
||||||
|
PtrList<List<scalarField>> patchr(patches.size());
|
||||||
|
PtrList<List<scalarField>> patcha(patches.size());
|
||||||
|
forAll(patchr, patchi)
|
||||||
|
{
|
||||||
|
patchr.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
new List<scalarField>(nBands)
|
||||||
|
);
|
||||||
|
|
||||||
|
patcha.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
new List<scalarField>(nBands)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fill patchr
|
||||||
|
forAll(patchr, patchi)
|
||||||
|
{
|
||||||
|
for (label bandI = 0; bandI < nBands; bandI++)
|
||||||
|
{
|
||||||
|
patchr[patchi][bandI] =
|
||||||
|
boundaryRadiation.specReflectivity
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
bandI,
|
||||||
|
new vectorField(patches[patchi].size(), sunDir)
|
||||||
|
);
|
||||||
|
|
||||||
|
patcha[patchi][bandI] =
|
||||||
|
boundaryRadiation.absorptivity
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
bandI,
|
||||||
|
new vectorField(patches[patchi].size(), sunDir)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<scalarField> r(nBands);
|
||||||
|
for (label bandI = 0; bandI < nBands; bandI++)
|
||||||
|
{
|
||||||
|
r[bandI].setSize(triangleIndex.size());
|
||||||
|
}
|
||||||
|
labelList refDirIndex(triangleIndex.size());
|
||||||
|
labelList refIndex(triangleIndex.size());
|
||||||
|
// triangleIndex includes hits on non-reflecting and reflecting faces
|
||||||
|
forAll(triangleIndex, i)
|
||||||
|
{
|
||||||
|
label trii = triangleIndex[i];
|
||||||
|
label facei = mapTriToGlobal_[trii];
|
||||||
|
label patchI = patches.whichPatch(facei);
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
label localFaceI = pp.whichFace(facei);
|
||||||
|
|
||||||
|
label globalFace = globalNumbering.toGlobal(Pstream::myProcNo(), facei);
|
||||||
|
if (refFacesDirIndex.found(globalFace))
|
||||||
|
{
|
||||||
|
refDirIndex[i] = refFacesDirIndex.find(globalFace)();
|
||||||
|
refIndex[i] = globalFace;
|
||||||
|
}
|
||||||
|
for (label bandI = 0; bandI < nBands; bandI++)
|
||||||
|
{
|
||||||
|
r[bandI][i] = patchr[patchI][bandI][localFaceI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map.reverseDistribute(hitInfo.size(), refDirIndex);
|
||||||
|
map.reverseDistribute(hitInfo.size(), refIndex);
|
||||||
|
for (label bandI = 0; bandI < nBands; bandI++)
|
||||||
|
{
|
||||||
|
map.reverseDistribute(hitInfo.size(), r[bandI]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (label bandI = 0; bandI < nBands; bandI++)
|
||||||
|
{
|
||||||
|
volScalarField::Boundary& qrefBf =
|
||||||
|
qreflective_[bandI].boundaryFieldRef();
|
||||||
|
qrefBf = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const vector qPrim(solarCalc_.directSolarRad()*solarCalc_.direction());
|
||||||
|
|
||||||
|
// Collect rays with a hit (hitting reflecting surfaces)
|
||||||
|
// and whose reflected direction are equal to the shot ray
|
||||||
|
forAll(hitInfo, rayI)
|
||||||
|
{
|
||||||
|
if (hitInfo[rayI].hit())
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
dirStartIndex[rayI] == refDirIndex[rayI]
|
||||||
|
&& refFacesDirIndex.found(refIndex[rayI])
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (label bandI = 0; bandI < nBands; bandI++)
|
||||||
|
{
|
||||||
|
volScalarField::Boundary& qrefBf =
|
||||||
|
qreflective_[bandI].boundaryFieldRef();
|
||||||
|
|
||||||
|
label startFaceId = startIndex[rayI];
|
||||||
|
label startPatchI = patches.whichPatch(startFaceId);
|
||||||
|
|
||||||
|
const polyPatch& ppStart = patches[startPatchI];
|
||||||
|
label localStartFaceI = ppStart.whichFace(startFaceId);
|
||||||
|
|
||||||
|
scalar a = patcha[startPatchI][bandI][localStartFaceI];
|
||||||
|
|
||||||
|
const vectorField& nStart = ppStart.faceNormals();
|
||||||
|
|
||||||
|
vector rayIn = refDiscAngles_[dirStartIndex[rayI]];
|
||||||
|
|
||||||
|
rayIn /= mag(rayIn);
|
||||||
|
|
||||||
|
qrefBf[startPatchI][localStartFaceI] +=
|
||||||
|
(
|
||||||
|
(
|
||||||
|
mag(qPrim)
|
||||||
|
*r[bandI][rayI]
|
||||||
|
*spectralDistribution_[bandI]
|
||||||
|
*a
|
||||||
|
*rayIn
|
||||||
|
)
|
||||||
|
& nStart[localStartFaceI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
start.clear();
|
||||||
|
startIndex.clear();
|
||||||
|
end.clear();
|
||||||
|
dirStartIndex.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::faceReflecting::faceReflecting
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const faceShading& directHiyFaces,
|
||||||
|
const solarCalculator& solar,
|
||||||
|
const scalarList& spectralDistribution,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mesh_(mesh),
|
||||||
|
nTheta_(dict.subDict("reflecting").lookupOrDefault<label>("nTheta", 10)),
|
||||||
|
nPhi_(dict.subDict("reflecting").lookupOrDefault<label>("nPhi", 10)),
|
||||||
|
nRay_(0),
|
||||||
|
refDiscAngles_(0),
|
||||||
|
spectralDistribution_(spectralDistribution),
|
||||||
|
qreflective_(spectralDistribution_.size()),
|
||||||
|
directHitFaces_(directHiyFaces),
|
||||||
|
surfacesMesh_(),
|
||||||
|
shootFacesIds_(),
|
||||||
|
Cfs_(),
|
||||||
|
Nfs_(),
|
||||||
|
solarCalc_(solar),
|
||||||
|
includePatches_(),
|
||||||
|
mapTriToGlobal_()
|
||||||
|
{
|
||||||
|
initialise(dict);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::faceReflecting::correct()
|
||||||
|
{
|
||||||
|
calculate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,170 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::faceReflecting
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
Calculates the reflecting faces from specular surfaces. It only
|
||||||
|
takes into account the first reflection coming from a surface hit
|
||||||
|
by the primary Sun hit faces.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
faceReflecting.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef faceReflecting_H
|
||||||
|
#define faceReflecting_H
|
||||||
|
|
||||||
|
#include "fvMesh.H"
|
||||||
|
#include "wallPolyPatch.H"
|
||||||
|
#include "triSurfaceTools.H"
|
||||||
|
#include "vectorList.H"
|
||||||
|
#include "distributedTriSurfaceMesh.H"
|
||||||
|
#include "faceShading.H"
|
||||||
|
#include "solarCalculator.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class faceReflecting Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class faceReflecting
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Reference to mesh
|
||||||
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
|
//- Number of solid angles in theta
|
||||||
|
label nTheta_;
|
||||||
|
|
||||||
|
//- Number of solid angles in phi
|
||||||
|
label nPhi_ ;
|
||||||
|
|
||||||
|
//- Total number of rays (1 per direction)
|
||||||
|
label nRay_;
|
||||||
|
|
||||||
|
//- Discretised angles for reflected rays
|
||||||
|
vectorList refDiscAngles_;
|
||||||
|
|
||||||
|
//- Spectral distribution for the integrated solar heat flux
|
||||||
|
const scalarList& spectralDistribution_;
|
||||||
|
|
||||||
|
//- Net reflected radiative heat flux [W/m2]
|
||||||
|
PtrList<volScalarField> qreflective_;
|
||||||
|
|
||||||
|
//- Primary hits faces
|
||||||
|
const faceShading& directHitFaces_;
|
||||||
|
|
||||||
|
//- Distributed surface for ray tracing
|
||||||
|
autoPtr<distributedTriSurfaceMesh> surfacesMesh_;
|
||||||
|
|
||||||
|
//- Faces from which rays are shot
|
||||||
|
autoPtr<labelList> shootFacesIds_;
|
||||||
|
|
||||||
|
//- Face centres from which rays are shot
|
||||||
|
autoPtr<pointField> Cfs_;
|
||||||
|
|
||||||
|
//- Face normal from which rays are shot
|
||||||
|
autoPtr<vectorField> Nfs_;
|
||||||
|
|
||||||
|
//- Solar calculator
|
||||||
|
const solarCalculator& solarCalc_;
|
||||||
|
|
||||||
|
//- Shooting rays pacthes
|
||||||
|
labelHashSet includePatches_;
|
||||||
|
|
||||||
|
//- Map from triSurface Index to global
|
||||||
|
labelList mapTriToGlobal_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private members
|
||||||
|
|
||||||
|
//- Calculate ray start faces
|
||||||
|
void calculate();
|
||||||
|
|
||||||
|
//- Initialise model
|
||||||
|
void initialise(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
|
//- No copy construct
|
||||||
|
faceReflecting(const faceReflecting&) = delete;
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const faceReflecting&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Declare name of the class and its debug switch
|
||||||
|
ClassName("faceReflecting");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
faceReflecting
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const faceShading& directHiyFaces,
|
||||||
|
const solarCalculator& ,
|
||||||
|
const scalarList& spectralDistribution,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
~faceReflecting() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Const access to qreflective
|
||||||
|
const volScalarField& qreflective(const label bandI) const
|
||||||
|
{
|
||||||
|
return qreflective_[bandI];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Correct reflected flux
|
||||||
|
void correct();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -40,7 +40,6 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
void Foam::faceShading::writeRays
|
void Foam::faceShading::writeRays
|
||||||
(
|
(
|
||||||
const fileName& fName,
|
const fileName& fName,
|
||||||
@ -91,10 +90,8 @@ Foam::triSurface Foam::faceShading::triangulate
|
|||||||
|
|
||||||
f.triangles(points, nTri, triFaces);
|
f.triangles(points, nTri, triFaces);
|
||||||
|
|
||||||
forAll(triFaces, triFaceI)
|
for (const face& f : triFaces)
|
||||||
{
|
{
|
||||||
const face& f = triFaces[triFaceI];
|
|
||||||
|
|
||||||
triangles.append
|
triangles.append
|
||||||
(
|
(
|
||||||
labelledTri(f[0], f[1], f[2], newPatchI)
|
labelledTri(f[0], f[1], f[2], newPatchI)
|
||||||
@ -235,10 +232,7 @@ void Foam::faceShading::calculate()
|
|||||||
{
|
{
|
||||||
if (tau[faceI] == 0.0)
|
if (tau[faceI] == 0.0)
|
||||||
{
|
{
|
||||||
includeAllFacesPerPatch[patchI].insert
|
includeAllFacesPerPatch[patchI].insert(faceI);
|
||||||
(
|
|
||||||
faceI
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -361,9 +355,8 @@ void Foam::faceShading::calculate()
|
|||||||
volScalarField::Boundary& hitFacesBf = hitFaces.boundaryFieldRef();
|
volScalarField::Boundary& hitFacesBf = hitFaces.boundaryFieldRef();
|
||||||
|
|
||||||
hitFacesBf = 0.0;
|
hitFacesBf = 0.0;
|
||||||
forAll(rayStartFaces_, i)
|
for (const label faceI : rayStartFaces_)
|
||||||
{
|
{
|
||||||
const label faceI = rayStartFaces_[i];
|
|
||||||
label patchID = patches.whichPatch(faceI);
|
label patchID = patches.whichPatch(faceI);
|
||||||
const polyPatch& pp = patches[patchID];
|
const polyPatch& pp = patches[patchID];
|
||||||
hitFacesBf[patchID][faceI - pp.start()] = 1.0;
|
hitFacesBf[patchID][faceI - pp.start()] = 1.0;
|
||||||
@ -394,7 +387,6 @@ Foam::faceShading::faceShading
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Foam::faceShading::faceShading
|
Foam::faceShading::faceShading
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
@ -409,12 +401,6 @@ Foam::faceShading::faceShading
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::faceShading::~faceShading()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::faceShading::correct()
|
void Foam::faceShading::correct()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2015 OpenFOAM Foundation
|
| Copyright (C) 2015 OpenFOAM Foundation
|
||||||
@ -125,7 +125,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~faceShading();
|
~faceShading() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -34,6 +34,10 @@ License
|
|||||||
#include "cyclicAMIPolyPatch.H"
|
#include "cyclicAMIPolyPatch.H"
|
||||||
#include "mappedPatchBase.H"
|
#include "mappedPatchBase.H"
|
||||||
#include "wallPolyPatch.H"
|
#include "wallPolyPatch.H"
|
||||||
|
#include "constants.H"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -46,11 +50,70 @@ namespace Foam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Foam::word Foam::radiation::solarLoad::viewFactorWalls = "viewFactorWall";
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::radiation::solarLoad::updateReflectedRays
|
||||||
|
(
|
||||||
|
const labelHashSet& includePatches
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (reflectedFaces_.empty() && !hitFaces_.empty())
|
||||||
|
{
|
||||||
|
reflectedFaces_.reset
|
||||||
|
(
|
||||||
|
new faceReflecting
|
||||||
|
(
|
||||||
|
mesh_,
|
||||||
|
hitFaces_(),
|
||||||
|
solarCalc_,
|
||||||
|
spectralDistribution_,
|
||||||
|
dict_
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
reflectedFaces_->correct();
|
||||||
|
|
||||||
|
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
||||||
|
const scalarField& V = mesh_.V();
|
||||||
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
|
forAll(qrBf, patchID)
|
||||||
|
{
|
||||||
|
if (includePatches[patchID])
|
||||||
|
{
|
||||||
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
|
{
|
||||||
|
qrBf[patchID] +=
|
||||||
|
reflectedFaces_->qreflective(bandI).boundaryField()[patchID];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
|
||||||
|
const labelUList& cellIs = patches[patchID].faceCells();
|
||||||
|
|
||||||
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
|
{
|
||||||
|
forAll(cellIs, i)
|
||||||
|
{
|
||||||
|
const label cellI = cellIs[i];
|
||||||
|
|
||||||
|
Ru_[cellI] +=
|
||||||
|
(
|
||||||
|
reflectedFaces_->qreflective(bandI).
|
||||||
|
boundaryField()[patchID][i] * sf[i]
|
||||||
|
)/V[cellI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::radiation::solarLoad::updateHitFaces()
|
bool Foam::radiation::solarLoad::updateHitFaces()
|
||||||
{
|
{
|
||||||
if (hitFaces_.empty())
|
if (hitFaces_.empty())
|
||||||
@ -82,8 +145,8 @@ bool Foam::radiation::solarLoad::updateHitFaces()
|
|||||||
hitFaces_->direction() = solarCalc_.direction();
|
hitFaces_->direction() = solarCalc_.direction();
|
||||||
hitFaces_->correct();
|
hitFaces_->correct();
|
||||||
return true;
|
return true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,33 +185,43 @@ void Foam::radiation::solarLoad::updateDirectHitRadiation
|
|||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
||||||
|
|
||||||
forAll(hitFacesId, i)
|
// Reset qr and qrPrimary
|
||||||
|
qrBf = 0.0;
|
||||||
|
|
||||||
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
{
|
{
|
||||||
const label faceI = hitFacesId[i];
|
volScalarField::Boundary& qprimaryBf =
|
||||||
label patchID = patches.whichPatch(faceI);
|
qprimaryRad_[bandI].boundaryFieldRef();
|
||||||
const polyPatch& pp = patches[patchID];
|
|
||||||
const label localFaceI = faceI - pp.start();
|
|
||||||
const vector qPrim = solarCalc_.directSolarRad()*solarCalc_.direction();
|
|
||||||
|
|
||||||
if (includeMappedPatchBasePatches[patchID])
|
qprimaryBf = 0.0;
|
||||||
|
|
||||||
|
forAll(hitFacesId, i)
|
||||||
{
|
{
|
||||||
const vectorField n = pp.faceNormals();
|
const label faceI = hitFacesId[i];
|
||||||
|
label patchID = patches.whichPatch(faceI);
|
||||||
|
const polyPatch& pp = patches[patchID];
|
||||||
|
const label localFaceI = faceI - pp.start();
|
||||||
|
const vector qPrim =
|
||||||
|
solarCalc_.directSolarRad()*solarCalc_.direction();
|
||||||
|
|
||||||
|
const vectorField& n = pp.faceNormals();
|
||||||
|
|
||||||
for (label bandI = 0; bandI < nBands_; bandI++)
|
|
||||||
{
|
{
|
||||||
qrBf[patchID][localFaceI] +=
|
qprimaryBf[patchID][localFaceI] +=
|
||||||
(qPrim & n[localFaceI])
|
(qPrim & n[localFaceI])
|
||||||
* spectralDistribution_[bandI]
|
* spectralDistribution_[bandI]
|
||||||
* absorptivity_[patchID][bandI]()[localFaceI];
|
* absorptivity_[patchID][bandI]()[localFaceI];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const vectorField& sf = mesh_.Sf().boundaryField()[patchID];
|
|
||||||
const label cellI = pp.faceCells()[localFaceI];
|
|
||||||
|
|
||||||
for (label bandI = 0; bandI < nBands_; bandI++)
|
if (includeMappedPatchBasePatches[patchID])
|
||||||
{
|
{
|
||||||
|
qrBf[patchID][localFaceI] += qprimaryBf[patchID][localFaceI];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const vectorField& sf = mesh_.Sf().boundaryField()[patchID];
|
||||||
|
const label cellI = pp.faceCells()[localFaceI];
|
||||||
|
|
||||||
Ru_[cellI] +=
|
Ru_[cellI] +=
|
||||||
(qPrim & sf[localFaceI])
|
(qPrim & sf[localFaceI])
|
||||||
* spectralDistribution_[bandI]
|
* spectralDistribution_[bandI]
|
||||||
@ -296,6 +369,12 @@ void Foam::radiation::solarLoad::updateSkyDiffusiveRadiation
|
|||||||
|
|
||||||
void Foam::radiation::solarLoad::initialise(const dictionary& coeffs)
|
void Foam::radiation::solarLoad::initialise(const dictionary& coeffs)
|
||||||
{
|
{
|
||||||
|
coeffs.readEntry("spectralDistribution", spectralDistribution_);
|
||||||
|
|
||||||
|
nBands_ = spectralDistribution_.size();
|
||||||
|
|
||||||
|
qprimaryRad_.setSize(nBands_);
|
||||||
|
|
||||||
if (coeffs.readIfPresent("gridUp", verticalDir_))
|
if (coeffs.readIfPresent("gridUp", verticalDir_))
|
||||||
{
|
{
|
||||||
verticalDir_.normalise();
|
verticalDir_.normalise();
|
||||||
@ -307,31 +386,28 @@ void Foam::radiation::solarLoad::initialise(const dictionary& coeffs)
|
|||||||
verticalDir_ = (-g/mag(g)).value();
|
verticalDir_ = (-g/mag(g)).value();
|
||||||
}
|
}
|
||||||
|
|
||||||
includePatches_ = mesh_.boundaryMesh().indices(viewFactorWalls);
|
coeffs.readEntry("useReflectedRays", useReflectedRays_);
|
||||||
|
|
||||||
coeffs.readEntry("useVFbeamToDiffuse", useVFbeamToDiffuse_);
|
|
||||||
|
|
||||||
coeffs.readEntry("spectralDistribution", spectralDistribution_);
|
|
||||||
|
|
||||||
spectralDistribution_ =
|
spectralDistribution_ =
|
||||||
spectralDistribution_/sum(spectralDistribution_);
|
spectralDistribution_/sum(spectralDistribution_);
|
||||||
|
|
||||||
nBands_ = spectralDistribution_.size();
|
forAll(qprimaryRad_, bandI)
|
||||||
|
|
||||||
if (useVFbeamToDiffuse_)
|
|
||||||
{
|
{
|
||||||
map_.reset
|
qprimaryRad_.set
|
||||||
(
|
(
|
||||||
new IOmapDistribute
|
bandI,
|
||||||
|
new volScalarField
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"mapDist",
|
"qprimaryRad_" + Foam::name(bandI) ,
|
||||||
mesh_.facesInstance(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::MUST_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
)
|
),
|
||||||
|
mesh_,
|
||||||
|
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -341,7 +417,7 @@ void Foam::radiation::solarLoad::initialise(const dictionary& coeffs)
|
|||||||
coeffs.readIfPresent("updateAbsorptivity", updateAbsorptivity_);
|
coeffs.readIfPresent("updateAbsorptivity", updateAbsorptivity_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void Foam::radiation::solarLoad::calculateQdiff
|
void Foam::radiation::solarLoad::calculateQdiff
|
||||||
(
|
(
|
||||||
const labelHashSet& includePatches,
|
const labelHashSet& includePatches,
|
||||||
@ -393,12 +469,16 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
reduce(totalFVNCoarseFaces, sumOp<label>());
|
reduce(totalFVNCoarseFaces, sumOp<label>());
|
||||||
|
|
||||||
// Calculate weighted absorptivity on coarse patches
|
// Calculate weighted absorptivity on coarse patches
|
||||||
List<scalar> localCoarseRave(nLocalVFCoarseFaces);
|
List<scalar> localCoarseEave(nLocalVFCoarseFaces);
|
||||||
|
List<scalar> localTave(nLocalVFCoarseFaces);
|
||||||
List<scalar> localCoarsePartialArea(nLocalVFCoarseFaces);
|
List<scalar> localCoarsePartialArea(nLocalVFCoarseFaces);
|
||||||
List<vector> localCoarseNorm(nLocalVFCoarseFaces);
|
List<vector> localCoarseNorm(nLocalVFCoarseFaces);
|
||||||
|
|
||||||
scalarField compactCoarseRave(map_->constructSize(), Zero);
|
scalarField compactCoarseEave(map_->constructSize(), 0.0);
|
||||||
scalarField compactCoarsePartialArea(map_->constructSize(), Zero);
|
scalarField compactCoarseTave(map_->constructSize(), 0.0);
|
||||||
|
|
||||||
|
scalarField compactCoarsePartialArea(map_->constructSize(), 0.0);
|
||||||
|
|
||||||
vectorList compactCoarseNorm(map_->constructSize(), Zero);
|
vectorList compactCoarseNorm(map_->constructSize(), Zero);
|
||||||
|
|
||||||
const boundaryRadiationProperties& boundaryRadiation =
|
const boundaryRadiationProperties& boundaryRadiation =
|
||||||
@ -418,29 +498,31 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
const polyPatch& cpp = coarseMesh_->boundaryMesh()[patchID];
|
const polyPatch& cpp = coarseMesh_->boundaryMesh()[patchID];
|
||||||
|
|
||||||
const labelList& agglom = finalAgglom_[patchID];
|
const labelList& agglom = finalAgglom_[patchID];
|
||||||
//if (pp.size() > 0)
|
|
||||||
if (agglom.size() > 0)
|
if (agglom.size() > 0)
|
||||||
{
|
{
|
||||||
label nAgglom = max(agglom) + 1;
|
label nAgglom = max(agglom) + 1;
|
||||||
coarseToFine_[i] = invertOneToMany(nAgglom, agglom);
|
coarseToFine_[i] = invertOneToMany(nAgglom, agglom);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField r(pp.size(), Zero);
|
// Weight emissivity by spectral distribution
|
||||||
|
scalarField e(pp.size(), 0.0);
|
||||||
|
|
||||||
for (label bandI = 0; bandI < nBands_; bandI++)
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
{
|
{
|
||||||
const tmp<scalarField> tr =
|
const tmp<scalarField> te =
|
||||||
spectralDistribution_[bandI]
|
spectralDistribution_[bandI]
|
||||||
*boundaryRadiation.reflectivity(patchID, bandI);
|
*boundaryRadiation.diffReflectivity(patchID, bandI);
|
||||||
r += tr();
|
e += te();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarList Rave(cpp.size(), Zero);
|
scalarList Eave(cpp.size(), 0.0);
|
||||||
scalarList area(cpp.size(), Zero);
|
scalarList Tave(cpp.size(), 0.0);
|
||||||
|
|
||||||
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
|
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
|
||||||
|
const scalarField& Tf = T_.boundaryField()[patchID];
|
||||||
|
|
||||||
const labelList& coarsePatchFace =
|
const labelList& coarsePatchFace=coarseMesh_->patchFaceMap()[patchID];
|
||||||
coarseMesh_->patchFaceMap()[patchID];
|
|
||||||
|
|
||||||
forAll(cpp, coarseI)
|
forAll(cpp, coarseI)
|
||||||
{
|
{
|
||||||
@ -460,18 +542,25 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
{
|
{
|
||||||
fullArea += sf[faceI];
|
fullArea += sf[faceI];
|
||||||
}
|
}
|
||||||
Rave[coarseI] += (r[faceI]*sf[faceI])/fineArea;
|
Eave[coarseI] += (e[faceI]*sf[faceI])/fineArea;
|
||||||
|
Tave[coarseI] += (pow4(Tf[faceI])*sf[faceI])/fineArea;
|
||||||
}
|
}
|
||||||
localCoarsePartialArea[compactI++] = fullArea/fineArea;
|
localCoarsePartialArea[compactI++] = fullArea/fineArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubList<scalar>
|
SubList<scalar>
|
||||||
(
|
(
|
||||||
localCoarseRave,
|
localCoarseEave,
|
||||||
Rave.size(),
|
Eave.size(),
|
||||||
startI
|
startI
|
||||||
) = Rave;
|
) = Eave;
|
||||||
|
|
||||||
|
SubList<scalar>
|
||||||
|
(
|
||||||
|
localTave,
|
||||||
|
Tave.size(),
|
||||||
|
startI
|
||||||
|
) = Tave;
|
||||||
|
|
||||||
const vectorList coarseNSf = cpp.faceNormals();
|
const vectorList coarseNSf = cpp.faceNormals();
|
||||||
SubList<vector>
|
SubList<vector>
|
||||||
@ -480,6 +569,7 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
cpp.size(),
|
cpp.size(),
|
||||||
startI
|
startI
|
||||||
) = coarseNSf;
|
) = coarseNSf;
|
||||||
|
|
||||||
startI += cpp.size();
|
startI += cpp.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,14 +577,18 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
SubList<scalar>(compactCoarsePartialArea, nLocalVFCoarseFaces) =
|
SubList<scalar>(compactCoarsePartialArea, nLocalVFCoarseFaces) =
|
||||||
localCoarsePartialArea;
|
localCoarsePartialArea;
|
||||||
|
|
||||||
SubList<scalar>(compactCoarseRave, nLocalVFCoarseFaces) =
|
SubList<scalar>(compactCoarseEave, nLocalVFCoarseFaces) =
|
||||||
localCoarseRave;
|
localCoarseEave;
|
||||||
|
|
||||||
|
SubList<scalar>(compactCoarseTave, nLocalVFCoarseFaces) =
|
||||||
|
localTave;
|
||||||
|
|
||||||
SubList<vector>(compactCoarseNorm, nLocalVFCoarseFaces) =
|
SubList<vector>(compactCoarseNorm, nLocalVFCoarseFaces) =
|
||||||
localCoarseNorm;
|
localCoarseNorm;
|
||||||
|
|
||||||
map_->distribute(compactCoarsePartialArea);
|
map_->distribute(compactCoarsePartialArea);
|
||||||
map_->distribute(compactCoarseRave);
|
map_->distribute(compactCoarseEave);
|
||||||
|
map_->distribute(compactCoarseTave);
|
||||||
map_->distribute(compactCoarseNorm);
|
map_->distribute(compactCoarseNorm);
|
||||||
|
|
||||||
|
|
||||||
@ -511,7 +605,9 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
const labelList& coarsePatchFace = coarseMesh_->patchFaceMap()[patchID];
|
const labelList& coarsePatchFace = coarseMesh_->patchFaceMap()[patchID];
|
||||||
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
|
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
|
||||||
|
|
||||||
|
|
||||||
scalarField a(ppf.size(), Zero);
|
scalarField a(ppf.size(), Zero);
|
||||||
|
|
||||||
for (label bandI = 0; bandI < nBands_; bandI++)
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
{
|
{
|
||||||
const tmp<scalarField> ta =
|
const tmp<scalarField> ta =
|
||||||
@ -527,6 +623,7 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
UIndirectList<scalar> fineSf(sf, fineFaces);
|
UIndirectList<scalar> fineSf(sf, fineFaces);
|
||||||
scalar fineArea = sum(fineSf());
|
scalar fineArea = sum(fineSf());
|
||||||
|
|
||||||
|
// // Weighting absorptivity per area on secondary diffussive flux
|
||||||
scalar aAve = 0.0;
|
scalar aAve = 0.0;
|
||||||
forAll(fineFaces, j)
|
forAll(fineFaces, j)
|
||||||
{
|
{
|
||||||
@ -541,14 +638,22 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
{
|
{
|
||||||
label compactI = compactFaces[j];
|
label compactI = compactFaces[j];
|
||||||
|
|
||||||
localqDiffusive[locaFaceI] +=
|
scalar qin =
|
||||||
compactCoarsePartialArea[compactI]
|
(
|
||||||
* aAve
|
solarCalc_.directSolarRad()*solarCalc_.direction()
|
||||||
* (solarCalc_.directSolarRad()*solarCalc_.direction())
|
& compactCoarseNorm[compactI]
|
||||||
& compactCoarseNorm[compactI]
|
)*compactCoarsePartialArea[compactI];
|
||||||
* vf[j]
|
|
||||||
* compactCoarseRave[compactI];
|
|
||||||
|
|
||||||
|
// q emission
|
||||||
|
scalar qem =
|
||||||
|
compactCoarseEave[compactI]
|
||||||
|
*physicoChemical::sigma.value()
|
||||||
|
*compactCoarseTave[compactI];
|
||||||
|
|
||||||
|
// compactCoarseEave is the diffussive reflected coeff
|
||||||
|
scalar qDiff = (compactCoarseEave[compactI])*qin;
|
||||||
|
|
||||||
|
localqDiffusive[locaFaceI] += (qDiff)*aAve*vf[j];
|
||||||
}
|
}
|
||||||
locaFaceI++;
|
locaFaceI++;
|
||||||
}
|
}
|
||||||
@ -608,26 +713,14 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::radiation::solarLoad::solarLoad(const volScalarField& T)
|
Foam::radiation::solarLoad::solarLoad(const volScalarField& T)
|
||||||
:
|
:
|
||||||
radiationModel(typeName, T),
|
radiationModel(typeName, T),
|
||||||
finalAgglom_
|
dict_(coeffs_),
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"finalAgglom",
|
|
||||||
mesh_.facesInstance(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
),
|
|
||||||
coarseMesh_(),
|
|
||||||
qr_
|
qr_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -641,20 +734,8 @@ Foam::radiation::solarLoad::solarLoad(const volScalarField& T)
|
|||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
||||||
),
|
),
|
||||||
qsecondRad_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"qsecondRad",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
|
||||||
),
|
|
||||||
hitFaces_(),
|
hitFaces_(),
|
||||||
|
reflectedFaces_(),
|
||||||
Ru_
|
Ru_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -668,26 +749,12 @@ Foam::radiation::solarLoad::solarLoad(const volScalarField& T)
|
|||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||||
),
|
),
|
||||||
solarCalc_(this->subDict(typeName + "Coeffs"), mesh_),
|
solarCalc_(coeffs_, mesh_),
|
||||||
verticalDir_(Zero),
|
verticalDir_(Zero),
|
||||||
useVFbeamToDiffuse_(false),
|
useReflectedRays_(false),
|
||||||
includePatches_(mesh_.boundary().size(), -1),
|
spectralDistribution_(),
|
||||||
coarseToFine_(),
|
nBands_(0),
|
||||||
nBands_(1),
|
qprimaryRad_(0),
|
||||||
spectralDistribution_(nBands_),
|
|
||||||
map_(),
|
|
||||||
visibleFaceFaces_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"visibleFaceFaces",
|
|
||||||
mesh_.facesInstance(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
),
|
|
||||||
solidCoupled_(true),
|
solidCoupled_(true),
|
||||||
absorptivity_(mesh_.boundaryMesh().size()),
|
absorptivity_(mesh_.boundaryMesh().size()),
|
||||||
updateAbsorptivity_(false),
|
updateAbsorptivity_(false),
|
||||||
@ -705,19 +772,7 @@ Foam::radiation::solarLoad::solarLoad
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
radiationModel(typeName, dict, T),
|
radiationModel(typeName, dict, T),
|
||||||
finalAgglom_
|
dict_(dict),
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"finalAgglom",
|
|
||||||
mesh_.facesInstance(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
),
|
|
||||||
coarseMesh_(),
|
|
||||||
qr_
|
qr_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -731,112 +786,8 @@ Foam::radiation::solarLoad::solarLoad
|
|||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
||||||
),
|
),
|
||||||
qsecondRad_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"qsecondRad",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
|
||||||
),
|
|
||||||
hitFaces_(),
|
|
||||||
Ru_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Ru",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
|
||||||
),
|
|
||||||
solarCalc_(coeffs_, mesh_),
|
|
||||||
verticalDir_(Zero),
|
|
||||||
useVFbeamToDiffuse_(false),
|
|
||||||
includePatches_(mesh_.boundary().size(), -1),
|
|
||||||
coarseToFine_(),
|
|
||||||
nBands_(1),
|
|
||||||
spectralDistribution_(nBands_),
|
|
||||||
map_(),
|
|
||||||
visibleFaceFaces_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"visibleFaceFaces",
|
|
||||||
mesh_.facesInstance(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
),
|
|
||||||
solidCoupled_(true),
|
|
||||||
wallCoupled_(false),
|
|
||||||
absorptivity_(mesh_.boundaryMesh().size()),
|
|
||||||
updateAbsorptivity_(false),
|
|
||||||
firstIter_(true),
|
|
||||||
updateTimeIndex_(0)
|
|
||||||
{
|
|
||||||
initialise(coeffs_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::radiation::solarLoad::solarLoad
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const volScalarField& T,
|
|
||||||
const word radWallFieldName
|
|
||||||
)
|
|
||||||
:
|
|
||||||
radiationModel("none", T),
|
|
||||||
finalAgglom_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"finalAgglom",
|
|
||||||
mesh_.facesInstance(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
),
|
|
||||||
coarseMesh_(),
|
|
||||||
qr_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
radWallFieldName,
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
|
||||||
),
|
|
||||||
qsecondRad_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"qsecondRad",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimMass/pow3(dimTime), Zero)
|
|
||||||
),
|
|
||||||
hitFaces_(),
|
hitFaces_(),
|
||||||
|
reflectedFaces_(),
|
||||||
Ru_
|
Ru_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -852,40 +803,21 @@ Foam::radiation::solarLoad::solarLoad
|
|||||||
),
|
),
|
||||||
solarCalc_(dict, mesh_),
|
solarCalc_(dict, mesh_),
|
||||||
verticalDir_(Zero),
|
verticalDir_(Zero),
|
||||||
useVFbeamToDiffuse_(false),
|
useReflectedRays_(false),
|
||||||
includePatches_(mesh_.boundary().size(), -1),
|
spectralDistribution_(),
|
||||||
coarseToFine_(),
|
nBands_(0),
|
||||||
nBands_(1),
|
qprimaryRad_(0),
|
||||||
spectralDistribution_(nBands_),
|
|
||||||
map_(),
|
|
||||||
visibleFaceFaces_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"visibleFaceFaces",
|
|
||||||
mesh_.facesInstance(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
),
|
|
||||||
solidCoupled_(true),
|
solidCoupled_(true),
|
||||||
wallCoupled_(false),
|
wallCoupled_(false),
|
||||||
absorptivity_(mesh_.boundaryMesh().size()),
|
absorptivity_(mesh_.boundaryMesh().size()),
|
||||||
updateAbsorptivity_(false),
|
updateAbsorptivity_(false),
|
||||||
firstIter_(true)
|
firstIter_(true),
|
||||||
|
updateTimeIndex_(0)
|
||||||
{
|
{
|
||||||
initialise(dict);
|
initialise(dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::radiation::solarLoad::~solarLoad()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::label Foam::radiation::solarLoad::nBands() const
|
Foam::label Foam::radiation::solarLoad::nBands() const
|
||||||
@ -938,13 +870,11 @@ void Foam::radiation::solarLoad::calculate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool facesChanged = updateHitFaces();
|
bool facesChanged = updateHitFaces();
|
||||||
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
|
||||||
|
|
||||||
if (facesChanged)
|
if (facesChanged)
|
||||||
{
|
{
|
||||||
// Reset Ru and qr
|
// Reset Ru
|
||||||
Ru_ = dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), Zero);
|
Ru_ = dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), Zero);
|
||||||
qrBf = 0.0;
|
|
||||||
|
|
||||||
// Add direct hit radiation
|
// Add direct hit radiation
|
||||||
const labelList& hitFacesId = hitFaces_->rayStartFaces();
|
const labelList& hitFacesId = hitFaces_->rayStartFaces();
|
||||||
@ -957,10 +887,10 @@ void Foam::radiation::solarLoad::calculate()
|
|||||||
includeMappedPatchBasePatches
|
includeMappedPatchBasePatches
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add indirect diffusive radiation
|
// Add specular reflected radiation
|
||||||
if (useVFbeamToDiffuse_)
|
if (useReflectedRays_)
|
||||||
{
|
{
|
||||||
calculateQdiff(includePatches, includeMappedPatchBasePatches);
|
updateReflectedRays(includeMappedPatchBasePatches);
|
||||||
}
|
}
|
||||||
|
|
||||||
firstIter_ = false;
|
firstIter_ = false;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2015 OpenFOAM Foundation
|
| Copyright (C) 2015 OpenFOAM Foundation
|
||||||
@ -30,30 +30,25 @@ Group
|
|||||||
grpRadiationModels
|
grpRadiationModels
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
The solar load radiation model includes Sun primary hits, their
|
The solar load radiation model includes Sun primary hits, their
|
||||||
reflective fluxes and diffusive sky radiative fluxes.
|
reflective fluxes and diffusive sky radiative fluxes.
|
||||||
|
|
||||||
The primary hit rays are calculated using a face shading algorithm.
|
The primary hit rays are calculated using a face shading algorithm.
|
||||||
The reflected fluxes are considered diffusive and use a view factors method
|
The first reflected fluxes can be optionally included. A view factors
|
||||||
to deposit the energy on "visible" walls. The sky diffusive radiation for
|
method is needed in order to include diffusive surface to surface fluxes.
|
||||||
horizontal and vertical walls is calculated following the Fair Weather
|
|
||||||
Conditions Method from the ASHRAE Handbook.
|
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
|
By default the energy is included in cells adjacent to the patches into
|
||||||
the energy Equation (wallCoupled = false). On coupled patches the flux is
|
the energy Equation (wallCoupled = false). On coupled patches the flux is
|
||||||
by default added to the wall and considered into the solid
|
by default added to the wall and considered into the solid
|
||||||
(solidCoupled = true).
|
(solidCoupled = true).
|
||||||
|
|
||||||
The reflected fluxes uses a grey absoprtion/emission model wich is weighted
|
|
||||||
by the spectral distribution. The flag useVFbeamToDiffuse should be
|
|
||||||
switched on and the view factors should be calculated using the
|
|
||||||
'viewFactorsGen' application.
|
|
||||||
|
|
||||||
The solarLoad model can be used in conjuntion with fvDOM and viewFactor
|
The solarLoad model can be used in conjuntion with fvDOM and viewFactor
|
||||||
radiation models but only using a single band spectrum. On the
|
radiation models. The flag useSolarLoad must be true on the rediation
|
||||||
corresponding BC's for these models the flag "solarLoad" must be set to
|
dictionary.
|
||||||
true.
|
|
||||||
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
@ -65,12 +60,10 @@ SourceFiles
|
|||||||
#define radiation_solarLoad_H
|
#define radiation_solarLoad_H
|
||||||
|
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "singleCellFvMesh.H"
|
|
||||||
#include "scalarListIOList.H"
|
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "faceShading.H"
|
#include "faceShading.H"
|
||||||
|
#include "faceReflecting.H"
|
||||||
#include "solarCalculator.H"
|
#include "solarCalculator.H"
|
||||||
#include "IOmapDistribute.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -87,35 +80,25 @@ class solarLoad
|
|||||||
:
|
:
|
||||||
public radiationModel
|
public radiationModel
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
|
|
||||||
// Static data
|
|
||||||
|
|
||||||
//- Static name for view factor walls
|
|
||||||
static const word viewFactorWalls;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Dictionary
|
||||||
//- Agglomeration List
|
dictionary dict_;
|
||||||
labelListIOList finalAgglom_;
|
|
||||||
|
|
||||||
//- Coarse mesh
|
|
||||||
autoPtr<singleCellFvMesh> coarseMesh_;
|
|
||||||
|
|
||||||
//- Net radiative heat flux [W/m2]
|
//- Net radiative heat flux [W/m2]
|
||||||
volScalarField qr_;
|
volScalarField qr_;
|
||||||
|
|
||||||
//- Secondary solar radiative heat flux [W/m2]
|
|
||||||
volScalarField qsecondRad_;
|
|
||||||
|
|
||||||
//- Direct hit faces Ids
|
//- Direct hit faces Ids
|
||||||
autoPtr<faceShading> hitFaces_;
|
autoPtr<faceShading> hitFaces_;
|
||||||
|
|
||||||
//- Constant source term
|
//- Reflected faces
|
||||||
|
autoPtr<faceReflecting> reflectedFaces_;
|
||||||
|
|
||||||
|
//- Source term for cells next to patches with flags solidCoupled
|
||||||
|
//- and wallCoupled false
|
||||||
DimensionedField<scalar, volMesh> Ru_;
|
DimensionedField<scalar, volMesh> Ru_;
|
||||||
|
|
||||||
//- Solar calculator
|
//- Solar calculator
|
||||||
@ -124,26 +107,17 @@ private:
|
|||||||
//- Vertical direction (Default is g vector)
|
//- Vertical direction (Default is g vector)
|
||||||
vector verticalDir_;
|
vector verticalDir_;
|
||||||
|
|
||||||
//- Include diffuse reflected heat fluxes from direct heat flux
|
//- Include reflected rays from specular surfaces
|
||||||
bool useVFbeamToDiffuse_;
|
bool useReflectedRays_;
|
||||||
|
|
||||||
//- Selected patches to apply solar load
|
|
||||||
labelList includePatches_;
|
|
||||||
|
|
||||||
//- Cached coarse to fine mapping for coarse mesh
|
|
||||||
List<labelListList> coarseToFine_;
|
|
||||||
|
|
||||||
//-Number of bands
|
|
||||||
label nBands_;
|
|
||||||
|
|
||||||
//- Spectral distribution for the integrated solar heat flux
|
//- Spectral distribution for the integrated solar heat flux
|
||||||
scalarList spectralDistribution_;
|
scalarList spectralDistribution_;
|
||||||
|
|
||||||
//- Map distribute
|
//-Number of bands
|
||||||
autoPtr<IOmapDistribute> map_;
|
label nBands_;
|
||||||
|
|
||||||
//- Face-compact map
|
//- Primary solar radiative heat flux per band [W/m2]
|
||||||
labelListIOList visibleFaceFaces_;
|
PtrList<volScalarField> qprimaryRad_;
|
||||||
|
|
||||||
//- Couple solids through mapped boundary patch using qr (default:true)
|
//- Couple solids through mapped boundary patch using qr (default:true)
|
||||||
bool solidCoupled_;
|
bool solidCoupled_;
|
||||||
@ -166,15 +140,17 @@ private:
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|
||||||
//- Initialise
|
//- Initialise
|
||||||
void initialise(const dictionary&);
|
void initialise(const dictionary&);
|
||||||
|
|
||||||
//- Update direct hit faces radiation
|
//- Update direct hit faces radiation
|
||||||
void updateDirectHitRadiation(const labelList&, const labelHashSet&);
|
void updateDirectHitRadiation(const labelList&, const labelHashSet&);
|
||||||
|
|
||||||
|
//- Update reflected heat flux
|
||||||
|
void updateReflectedRays(const labelHashSet&);
|
||||||
|
|
||||||
//- Calculate diffusive heat flux
|
//- Calculate diffusive heat flux
|
||||||
void calculateQdiff(const labelHashSet&, const labelHashSet&);
|
//void calculateQdiff(const labelHashSet&, const labelHashSet&);
|
||||||
|
|
||||||
//- Update Sky diffusive radiation
|
//- Update Sky diffusive radiation
|
||||||
void updateSkyDiffusiveRadiation
|
void updateSkyDiffusiveRadiation
|
||||||
@ -210,18 +186,9 @@ public:
|
|||||||
//- Construct from dictionary and volScalarField
|
//- Construct from dictionary and volScalarField
|
||||||
solarLoad(const dictionary& dict, const volScalarField& T);
|
solarLoad(const dictionary& dict, const volScalarField& T);
|
||||||
|
|
||||||
//- Constructor from local components. Does not create a radiationModel.
|
|
||||||
// radWallFieldName is the solar heat field name
|
|
||||||
solarLoad
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const volScalarField& T,
|
|
||||||
const word radWallFieldName
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~solarLoad();
|
virtual ~solarLoad() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
@ -245,6 +212,12 @@ public:
|
|||||||
|
|
||||||
//- Number of bands
|
//- Number of bands
|
||||||
label nBands() const;
|
label nBands() const;
|
||||||
|
|
||||||
|
//- Primary solar heat flux
|
||||||
|
const volScalarField& qprimaryRad(const label bandI) const
|
||||||
|
{
|
||||||
|
return qprimaryRad_[bandI];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -193,21 +193,18 @@ void Foam::radiation::viewFactor::initialise()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->readIfPresent("useSolarLoad", useSolarLoad_);
|
coeffs_.readIfPresent("useSolarLoad", useSolarLoad_);
|
||||||
|
|
||||||
if (useSolarLoad_)
|
if (useSolarLoad_)
|
||||||
{
|
{
|
||||||
const dictionary& solarDict = this->subDict("solarLoarCoeffs");
|
const dictionary& solarDict = this->subDict("solarLoadCoeffs");
|
||||||
solarLoad_.reset
|
solarLoad_.reset(new solarLoad(solarDict, T_));
|
||||||
(
|
|
||||||
new solarLoad(solarDict, T_, externalRadHeatFieldName_)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (solarLoad_->nBands() > 1)
|
if (solarLoad_->nBands() != nBands_)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Requested solar radiation with fvDOM. Using "
|
<< "Solar radiation and view factor band numbers "
|
||||||
<< "more thant one band for the solar load is not allowed"
|
<< "are different"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +239,8 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T)
|
|||||||
mesh_.polyMesh::instance(),
|
mesh_.polyMesh::instance(),
|
||||||
mesh_.time(),
|
mesh_.time(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
finalAgglom_
|
finalAgglom_
|
||||||
@ -268,7 +266,8 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T)
|
|||||||
iterCounter_(0),
|
iterCounter_(0),
|
||||||
pivotIndices_(0),
|
pivotIndices_(0),
|
||||||
useSolarLoad_(false),
|
useSolarLoad_(false),
|
||||||
solarLoad_()
|
solarLoad_(),
|
||||||
|
nBands_(coeffs_.lookupOrDefault<label>("nBands", 1))
|
||||||
{
|
{
|
||||||
initialise();
|
initialise();
|
||||||
}
|
}
|
||||||
@ -302,7 +301,8 @@ Foam::radiation::viewFactor::viewFactor
|
|||||||
mesh_.polyMesh::instance(),
|
mesh_.polyMesh::instance(),
|
||||||
mesh_.time(),
|
mesh_.time(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
finalAgglom_
|
finalAgglom_
|
||||||
@ -328,18 +328,13 @@ Foam::radiation::viewFactor::viewFactor
|
|||||||
iterCounter_(0),
|
iterCounter_(0),
|
||||||
pivotIndices_(0),
|
pivotIndices_(0),
|
||||||
useSolarLoad_(false),
|
useSolarLoad_(false),
|
||||||
solarLoad_()
|
solarLoad_(),
|
||||||
|
nBands_(coeffs_.lookupOrDefault<label>("nBands", 1))
|
||||||
{
|
{
|
||||||
initialise();
|
initialise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::radiation::viewFactor::~viewFactor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::radiation::viewFactor::read()
|
bool Foam::radiation::viewFactor::read()
|
||||||
@ -386,231 +381,248 @@ void Foam::radiation::viewFactor::calculate()
|
|||||||
solarLoad_->calculate();
|
solarLoad_->calculate();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField compactCoarseT4(map_->constructSize(), Zero);
|
// Net radiation
|
||||||
scalarField compactCoarseE(map_->constructSize(), Zero);
|
scalarField q(totalNCoarseFaces_, 0.0);
|
||||||
scalarField compactCoarseHo(map_->constructSize(), Zero);
|
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
||||||
|
|
||||||
globalIndex globalNumbering(nLocalCoarseFaces_);
|
globalIndex globalNumbering(nLocalCoarseFaces_);
|
||||||
|
|
||||||
// Fill local averaged(T), emissivity(E) and external heatFlux(Ho)
|
|
||||||
DynamicList<scalar> localCoarseT4ave(nLocalCoarseFaces_);
|
|
||||||
DynamicList<scalar> localCoarseEave(nLocalCoarseFaces_);
|
|
||||||
DynamicList<scalar> localCoarseHoave(nLocalCoarseFaces_);
|
|
||||||
|
|
||||||
const boundaryRadiationProperties& boundaryRadiation =
|
const boundaryRadiationProperties& boundaryRadiation =
|
||||||
boundaryRadiationProperties::New(mesh_);
|
boundaryRadiationProperties::New(mesh_);
|
||||||
|
|
||||||
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
|
|
||||||
forAll(selectedPatches_, i)
|
|
||||||
{
|
{
|
||||||
label patchID = selectedPatches_[i];
|
scalarField compactCoarseT4(map_->constructSize(), 0.0);
|
||||||
|
scalarField compactCoarseE(map_->constructSize(), 0.0);
|
||||||
|
scalarField compactCoarseHo(map_->constructSize(), 0.0);
|
||||||
|
|
||||||
const scalarField& Tp = T_.boundaryField()[patchID];
|
// Fill local averaged(T), emissivity(E) and external heatFlux(Ho)
|
||||||
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
|
DynamicList<scalar> localCoarseT4ave(nLocalCoarseFaces_);
|
||||||
|
DynamicList<scalar> localCoarseEave(nLocalCoarseFaces_);
|
||||||
|
DynamicList<scalar> localCoarseHoave(nLocalCoarseFaces_);
|
||||||
|
|
||||||
fvPatchScalarField& qrPatch = qrBf[patchID];
|
forAll(selectedPatches_, i)
|
||||||
|
|
||||||
greyDiffusiveViewFactorFixedValueFvPatchScalarField& qrp =
|
|
||||||
refCast
|
|
||||||
<
|
|
||||||
greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
|
||||||
>(qrPatch);
|
|
||||||
|
|
||||||
const tmp<scalarField> teb = boundaryRadiation.emissivity(patchID);
|
|
||||||
const scalarField& eb = teb();
|
|
||||||
|
|
||||||
const tmp<scalarField> tHoi = qrp.qro();
|
|
||||||
const scalarField& Hoi = tHoi();
|
|
||||||
|
|
||||||
const polyPatch& pp = coarseMesh_.boundaryMesh()[patchID];
|
|
||||||
const labelList& coarsePatchFace = coarseMesh_.patchFaceMap()[patchID];
|
|
||||||
|
|
||||||
scalarList T4ave(pp.size(), Zero);
|
|
||||||
scalarList Eave(pp.size(), Zero);
|
|
||||||
scalarList Hoiave(pp.size(), Zero);
|
|
||||||
|
|
||||||
if (pp.size() > 0)
|
|
||||||
{
|
{
|
||||||
const labelList& agglom = finalAgglom_[patchID];
|
label patchID = selectedPatches_[i];
|
||||||
label nAgglom = max(agglom) + 1;
|
|
||||||
|
|
||||||
labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
|
const scalarField& Tp = T_.boundaryField()[patchID];
|
||||||
|
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
|
||||||
|
|
||||||
forAll(coarseToFine, coarseI)
|
fvPatchScalarField& qrPatch = qrBf[patchID];
|
||||||
|
|
||||||
|
greyDiffusiveViewFactorFixedValueFvPatchScalarField& qrp =
|
||||||
|
refCast
|
||||||
|
<
|
||||||
|
greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
||||||
|
>(qrPatch);
|
||||||
|
|
||||||
|
const tmp<scalarField> teb =
|
||||||
|
boundaryRadiation.emissivity(patchID, bandI);
|
||||||
|
|
||||||
|
const scalarField& eb = teb();
|
||||||
|
|
||||||
|
const tmp<scalarField> tHoi = qrp.qro(bandI);
|
||||||
|
const scalarField& Hoi = tHoi();
|
||||||
|
|
||||||
|
const polyPatch& pp = coarseMesh_.boundaryMesh()[patchID];
|
||||||
|
|
||||||
|
const labelList& coarsePatchFace =
|
||||||
|
coarseMesh_.patchFaceMap()[patchID];
|
||||||
|
|
||||||
|
scalarList T4ave(pp.size(), 0.0);
|
||||||
|
scalarList Eave(pp.size(), 0.0);
|
||||||
|
scalarList Hoiave(pp.size(), 0.0);
|
||||||
|
|
||||||
|
if (pp.size() > 0)
|
||||||
{
|
{
|
||||||
const label coarseFaceID = coarsePatchFace[coarseI];
|
const labelList& agglom = finalAgglom_[patchID];
|
||||||
const labelList& fineFaces = coarseToFine[coarseFaceID];
|
label nAgglom = max(agglom) + 1;
|
||||||
UIndirectList<scalar> fineSf
|
|
||||||
(
|
|
||||||
sf,
|
|
||||||
fineFaces
|
|
||||||
);
|
|
||||||
|
|
||||||
const scalar area = sum(fineSf());
|
labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
|
||||||
|
|
||||||
// Temperature, emissivity and external flux area weighting
|
forAll(coarseToFine, coarseI)
|
||||||
forAll(fineFaces, j)
|
|
||||||
{
|
{
|
||||||
label facei = fineFaces[j];
|
const label coarseFaceID = coarsePatchFace[coarseI];
|
||||||
T4ave[coarseI] += (pow4(Tp[facei])*sf[facei])/area;
|
const labelList& fineFaces = coarseToFine[coarseFaceID];
|
||||||
Eave[coarseI] += (eb[facei]*sf[facei])/area;
|
UIndirectList<scalar> fineSf
|
||||||
Hoiave[coarseI] += (Hoi[facei]*sf[facei])/area;
|
(
|
||||||
}
|
sf,
|
||||||
}
|
fineFaces
|
||||||
}
|
);
|
||||||
|
|
||||||
localCoarseT4ave.append(T4ave);
|
const scalar area = sum(fineSf());
|
||||||
localCoarseEave.append(Eave);
|
|
||||||
localCoarseHoave.append(Hoiave);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill the local values to distribute
|
// Temperature, emissivity and external flux area weighting
|
||||||
SubList<scalar>(compactCoarseT4, nLocalCoarseFaces_) = localCoarseT4ave;
|
forAll(fineFaces, j)
|
||||||
SubList<scalar>(compactCoarseE, nLocalCoarseFaces_) = localCoarseEave;
|
|
||||||
SubList<scalar>(compactCoarseHo, nLocalCoarseFaces_) = localCoarseHoave;
|
|
||||||
|
|
||||||
// Distribute data
|
|
||||||
map_->distribute(compactCoarseT4);
|
|
||||||
map_->distribute(compactCoarseE);
|
|
||||||
map_->distribute(compactCoarseHo);
|
|
||||||
|
|
||||||
// Distribute local global ID
|
|
||||||
labelList compactGlobalIds(map_->constructSize(), Zero);
|
|
||||||
|
|
||||||
SubList<label>
|
|
||||||
(
|
|
||||||
compactGlobalIds,
|
|
||||||
nLocalCoarseFaces_
|
|
||||||
) = identity(globalNumbering.localSize(), globalNumbering.localStart());
|
|
||||||
|
|
||||||
map_->distribute(compactGlobalIds);
|
|
||||||
|
|
||||||
// Create global size vectors
|
|
||||||
scalarField T4(totalNCoarseFaces_, Zero);
|
|
||||||
scalarField E(totalNCoarseFaces_, Zero);
|
|
||||||
scalarField qrExt(totalNCoarseFaces_, Zero);
|
|
||||||
|
|
||||||
// Fill lists from compact to global indexes.
|
|
||||||
forAll(compactCoarseT4, i)
|
|
||||||
{
|
|
||||||
T4[compactGlobalIds[i]] = compactCoarseT4[i];
|
|
||||||
E[compactGlobalIds[i]] = compactCoarseE[i];
|
|
||||||
qrExt[compactGlobalIds[i]] = compactCoarseHo[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
Pstream::listCombineGather(T4, maxEqOp<scalar>());
|
|
||||||
Pstream::listCombineGather(E, maxEqOp<scalar>());
|
|
||||||
Pstream::listCombineGather(qrExt, maxEqOp<scalar>());
|
|
||||||
|
|
||||||
Pstream::listCombineScatter(T4);
|
|
||||||
Pstream::listCombineScatter(E);
|
|
||||||
Pstream::listCombineScatter(qrExt);
|
|
||||||
|
|
||||||
// Net radiation
|
|
||||||
scalarField q(totalNCoarseFaces_, Zero);
|
|
||||||
|
|
||||||
if (Pstream::master())
|
|
||||||
{
|
|
||||||
// Variable emissivity
|
|
||||||
if (!constEmissivity_)
|
|
||||||
{
|
|
||||||
scalarSquareMatrix C(totalNCoarseFaces_, Zero);
|
|
||||||
|
|
||||||
for (label i=0; i<totalNCoarseFaces_; i++)
|
|
||||||
{
|
|
||||||
for (label j=0; j<totalNCoarseFaces_; j++)
|
|
||||||
{
|
|
||||||
const scalar invEj = 1.0/E[j];
|
|
||||||
const scalar sigmaT4 = physicoChemical::sigma.value()*T4[j];
|
|
||||||
|
|
||||||
if (i==j)
|
|
||||||
{
|
{
|
||||||
C(i, j) = invEj - (invEj - 1.0)*Fmatrix_()(i, j);
|
label facei = fineFaces[j];
|
||||||
q[i] += (Fmatrix_()(i, j) - 1.0)*sigmaT4 - qrExt[j];
|
T4ave[coarseI] += (pow4(Tp[facei])*sf[facei])/area;
|
||||||
|
Eave[coarseI] += (eb[facei]*sf[facei])/area;
|
||||||
|
Hoiave[coarseI] += (Hoi[facei]*sf[facei])/area;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
C(i, j) = (1.0 - invEj)*Fmatrix_()(i, j);
|
|
||||||
q[i] += Fmatrix_()(i, j)*sigmaT4;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "\nSolving view factor equations..." << endl;
|
localCoarseT4ave.append(T4ave);
|
||||||
|
localCoarseEave.append(Eave);
|
||||||
|
localCoarseHoave.append(Hoiave);
|
||||||
|
|
||||||
// Negative coming into the fluid
|
|
||||||
LUsolve(C, q);
|
|
||||||
}
|
}
|
||||||
else //Constant emissivity
|
|
||||||
|
// Fill the local values to distribute
|
||||||
|
SubList<scalar>(compactCoarseT4, nLocalCoarseFaces_) =
|
||||||
|
localCoarseT4ave;
|
||||||
|
SubList<scalar>(compactCoarseE, nLocalCoarseFaces_) = localCoarseEave;
|
||||||
|
SubList<scalar>(compactCoarseHo, nLocalCoarseFaces_) =
|
||||||
|
localCoarseHoave;
|
||||||
|
|
||||||
|
// Distribute data
|
||||||
|
map_->distribute(compactCoarseT4);
|
||||||
|
map_->distribute(compactCoarseE);
|
||||||
|
map_->distribute(compactCoarseHo);
|
||||||
|
|
||||||
|
// Distribute local global ID
|
||||||
|
labelList compactGlobalIds(map_->constructSize(), Zero);
|
||||||
|
|
||||||
|
SubList<label>
|
||||||
|
(
|
||||||
|
compactGlobalIds,
|
||||||
|
nLocalCoarseFaces_
|
||||||
|
) = identity
|
||||||
|
(
|
||||||
|
globalNumbering.localSize(),
|
||||||
|
globalNumbering.localStart()
|
||||||
|
);
|
||||||
|
|
||||||
|
map_->distribute(compactGlobalIds);
|
||||||
|
|
||||||
|
// Create global size vectors
|
||||||
|
scalarField T4(totalNCoarseFaces_, 0.0);
|
||||||
|
scalarField E(totalNCoarseFaces_, 0.0);
|
||||||
|
scalarField qrExt(totalNCoarseFaces_, 0.0);
|
||||||
|
|
||||||
|
// Fill lists from compact to global indexes.
|
||||||
|
forAll(compactCoarseT4, i)
|
||||||
{
|
{
|
||||||
// Initial iter calculates CLU and caches it
|
T4[compactGlobalIds[i]] = compactCoarseT4[i];
|
||||||
if (iterCounter_ == 0)
|
E[compactGlobalIds[i]] = compactCoarseE[i];
|
||||||
|
qrExt[compactGlobalIds[i]] = compactCoarseHo[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
Pstream::listCombineGather(T4, maxEqOp<scalar>());
|
||||||
|
Pstream::listCombineGather(E, maxEqOp<scalar>());
|
||||||
|
Pstream::listCombineGather(qrExt, maxEqOp<scalar>());
|
||||||
|
|
||||||
|
Pstream::listCombineScatter(T4);
|
||||||
|
Pstream::listCombineScatter(E);
|
||||||
|
Pstream::listCombineScatter(qrExt);
|
||||||
|
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
// Variable emissivity
|
||||||
|
if (!constEmissivity_)
|
||||||
{
|
{
|
||||||
|
scalarSquareMatrix C(totalNCoarseFaces_, 0.0);
|
||||||
|
|
||||||
for (label i=0; i<totalNCoarseFaces_; i++)
|
for (label i=0; i<totalNCoarseFaces_; i++)
|
||||||
{
|
{
|
||||||
for (label j=0; j<totalNCoarseFaces_; j++)
|
for (label j=0; j<totalNCoarseFaces_; j++)
|
||||||
{
|
{
|
||||||
const scalar invEj = 1.0/E[j];
|
const scalar invEj = 1.0/E[j];
|
||||||
|
const scalar sigmaT4 =
|
||||||
|
physicoChemical::sigma.value()*T4[j];
|
||||||
|
|
||||||
if (i==j)
|
if (i==j)
|
||||||
{
|
{
|
||||||
CLU_()(i, j) = invEj-(invEj-1.0)*Fmatrix_()(i, j);
|
C(i, j) = invEj - (invEj - 1.0)*Fmatrix_()(i, j);
|
||||||
|
q[i] +=
|
||||||
|
(Fmatrix_()(i, j) - 1.0)*sigmaT4 + qrExt[j];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLU_()(i, j) = (1.0 - invEj)*Fmatrix_()(i, j);
|
C(i, j) = (1.0 - invEj)*Fmatrix_()(i, j);
|
||||||
|
q[i] += Fmatrix_()(i, j)*sigmaT4;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Solving view factor equations for band :"
|
||||||
|
<< bandI << endl;
|
||||||
|
|
||||||
|
// Negative coming into the fluid
|
||||||
|
LUsolve(C, q);
|
||||||
|
}
|
||||||
|
else //Constant emissivity
|
||||||
|
{
|
||||||
|
// Initial iter calculates CLU and caches it
|
||||||
|
if (iterCounter_ == 0)
|
||||||
|
{
|
||||||
|
for (label i=0; i<totalNCoarseFaces_; i++)
|
||||||
|
{
|
||||||
|
for (label j=0; j<totalNCoarseFaces_; j++)
|
||||||
|
{
|
||||||
|
const scalar invEj = 1.0/E[j];
|
||||||
|
if (i==j)
|
||||||
|
{
|
||||||
|
CLU_()(i, j) =
|
||||||
|
invEj-(invEj-1.0)*Fmatrix_()(i, j);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CLU_()(i, j) = (1.0 - invEj)*Fmatrix_()(i, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
InfoInFunction
|
||||||
|
<< "\nDecomposing C matrix..." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
LUDecompose(CLU_(), pivotIndices_);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (label i=0; i<totalNCoarseFaces_; i++)
|
||||||
|
{
|
||||||
|
for (label j=0; j<totalNCoarseFaces_; j++)
|
||||||
|
{
|
||||||
|
const scalar sigmaT4 =
|
||||||
|
constant::physicoChemical::sigma.value()*T4[j];
|
||||||
|
|
||||||
|
if (i==j)
|
||||||
|
{
|
||||||
|
q[i] +=
|
||||||
|
(Fmatrix_()(i, j) - 1.0)*sigmaT4 + qrExt[j];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
q[i] += Fmatrix_()(i, j)*sigmaT4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
InfoInFunction
|
|
||||||
<< "\nDecomposing C matrix..." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
LUDecompose(CLU_(), pivotIndices_);
|
Info<< "Solving view factor equations for band : "
|
||||||
|
<< bandI << endl;
|
||||||
|
|
||||||
|
|
||||||
|
LUBacksubstitute(CLU_(), pivotIndices_, q);
|
||||||
|
iterCounter_ ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label i=0; i<totalNCoarseFaces_; i++)
|
|
||||||
{
|
|
||||||
for (label j=0; j<totalNCoarseFaces_; j++)
|
|
||||||
{
|
|
||||||
const scalar sigmaT4 =
|
|
||||||
constant::physicoChemical::sigma.value()*T4[j];
|
|
||||||
|
|
||||||
if (i==j)
|
|
||||||
{
|
|
||||||
q[i] += (Fmatrix_()(i, j) - 1.0)*sigmaT4 - qrExt[j];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
q[i] += Fmatrix_()(i, j)*sigmaT4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
InfoInFunction
|
|
||||||
<< "\nLU Back substitute C matrix.." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
LUBacksubstitute(CLU_(), pivotIndices_, q);
|
|
||||||
iterCounter_ ++;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
// Scatter q and fill qr
|
// Scatter q and fill qr
|
||||||
Pstream::listCombineScatter(q);
|
Pstream::listCombineScatter(q);
|
||||||
Pstream::listCombineGather(q, maxEqOp<scalar>());
|
Pstream::listCombineGather(q, maxEqOp<scalar>());
|
||||||
|
|
||||||
label globCoarseId = 0;
|
label globCoarseId = 0;
|
||||||
forAll(selectedPatches_, i)
|
for (const label patchID : selectedPatches_)
|
||||||
{
|
{
|
||||||
const label patchID = selectedPatches_[i];
|
|
||||||
const polyPatch& pp = mesh_.boundaryMesh()[patchID];
|
const polyPatch& pp = mesh_.boundaryMesh()[patchID];
|
||||||
|
|
||||||
if (pp.size() > 0)
|
if (pp.size() > 0)
|
||||||
{
|
{
|
||||||
scalarField& qrp = qrBf[patchID];
|
scalarField& qrp = qrBf[patchID];
|
||||||
@ -627,7 +639,9 @@ void Foam::radiation::viewFactor::calculate()
|
|||||||
forAll(coarseToFine, coarseI)
|
forAll(coarseToFine, coarseI)
|
||||||
{
|
{
|
||||||
label globalCoarse =
|
label globalCoarse =
|
||||||
globalNumbering.toGlobal(Pstream::myProcNo(), globCoarseId);
|
globalNumbering.toGlobal
|
||||||
|
(Pstream::myProcNo(), globCoarseId);
|
||||||
|
|
||||||
const label coarseFaceID = coarsePatchFace[coarseI];
|
const label coarseFaceID = coarsePatchFace[coarseI];
|
||||||
const labelList& fineFaces = coarseToFine[coarseFaceID];
|
const labelList& fineFaces = coarseToFine[coarseFaceID];
|
||||||
forAll(fineFaces, k)
|
forAll(fineFaces, k)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
@ -74,12 +74,23 @@ class viewFactor
|
|||||||
:
|
:
|
||||||
public radiationModel
|
public radiationModel
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- No copy construct
|
||||||
|
viewFactor(const viewFactor&) = delete;
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const viewFactor&) = delete;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Static data
|
// Static data
|
||||||
|
|
||||||
//- Static name for view factor walls
|
//- Static name for view factor walls
|
||||||
static const word viewFactorWalls;
|
static const word viewFactorWalls;
|
||||||
|
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -126,6 +137,9 @@ protected:
|
|||||||
//- Solar load radiation model
|
//- Solar load radiation model
|
||||||
autoPtr<solarLoad> solarLoad_;
|
autoPtr<solarLoad> solarLoad_;
|
||||||
|
|
||||||
|
//-Number of bands
|
||||||
|
label nBands_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -142,12 +156,6 @@ protected:
|
|||||||
scalarSquareMatrix& matrix
|
scalarSquareMatrix& matrix
|
||||||
);
|
);
|
||||||
|
|
||||||
//- No copy construct
|
|
||||||
viewFactor(const viewFactor&) = delete;
|
|
||||||
|
|
||||||
//- No copy assignment
|
|
||||||
void operator=(const viewFactor&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -165,7 +173,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~viewFactor();
|
virtual ~viewFactor() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
@ -189,6 +197,12 @@ public:
|
|||||||
|
|
||||||
//- Const access to total radiative heat flux field
|
//- Const access to total radiative heat flux field
|
||||||
inline const volScalarField& qr() const;
|
inline const volScalarField& qr() const;
|
||||||
|
|
||||||
|
//- Use useSolarLoad
|
||||||
|
inline bool useSolarLoad() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
virtual label nBands() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
@ -31,4 +31,15 @@ inline const Foam::volScalarField& Foam::radiation::viewFactor::qr() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::radiation::viewFactor::useSolarLoad() const
|
||||||
|
{
|
||||||
|
return useSolarLoad_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline label Foam::radiation::viewFactor::nBands() const
|
||||||
|
{
|
||||||
|
return nBands_;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "boundaryRadiationProperties.H"
|
#include "boundaryRadiationProperties.H"
|
||||||
|
#include "radiationModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -63,6 +64,15 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
|
|||||||
|
|
||||||
if (boundaryIO.typeHeaderOk<IOdictionary>(true))
|
if (boundaryIO.typeHeaderOk<IOdictionary>(true))
|
||||||
{
|
{
|
||||||
|
const radiationModel& radiation =
|
||||||
|
mesh.lookupObject<radiationModel>
|
||||||
|
(
|
||||||
|
"radiationProperties"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Model number of bands
|
||||||
|
label nBands = radiation.nBands();
|
||||||
|
|
||||||
const IOdictionary radiationDict(boundaryIO);
|
const IOdictionary radiationDict(boundaryIO);
|
||||||
|
|
||||||
forAll(mesh.boundary(), patchi)
|
forAll(mesh.boundary(), patchi)
|
||||||
@ -75,8 +85,17 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
|
|||||||
|
|
||||||
radBoundaryPropertiesPtrList_[patchi].reset
|
radBoundaryPropertiesPtrList_[patchi].reset
|
||||||
(
|
(
|
||||||
new boundaryRadiationPropertiesPatch(pp, dict)
|
boundaryRadiationPropertiesPatch::New(dict, pp)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (nBands != radBoundaryPropertiesPtrList_[patchi]->nBands())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Radiation bands : " << nBands << nl
|
||||||
|
<< "Bands on patch : " << patchi << " is "
|
||||||
|
<< radBoundaryPropertiesPtrList_[patchi]->nBands()
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,12 +108,19 @@ Foam::tmp<Foam::scalarField>
|
|||||||
Foam::radiation::boundaryRadiationProperties::emissivity
|
Foam::radiation::boundaryRadiationProperties::emissivity
|
||||||
(
|
(
|
||||||
const label patchi,
|
const label patchi,
|
||||||
const label bandi
|
const label bandi,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
{
|
{
|
||||||
return radBoundaryPropertiesPtrList_[patchi]->emissivity(bandi);
|
return radBoundaryPropertiesPtrList_[patchi]->e
|
||||||
|
(
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -107,16 +133,53 @@ Foam::radiation::boundaryRadiationProperties::emissivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
Foam::scalar Foam::radiation::boundaryRadiationProperties::faceEmissivity
|
||||||
Foam::radiation::boundaryRadiationProperties::absorptivity
|
|
||||||
(
|
(
|
||||||
const label patchi,
|
const label patchi,
|
||||||
const label bandi
|
const label faceI,
|
||||||
|
const label bandi,
|
||||||
|
vector incomingDirection,
|
||||||
|
scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
{
|
{
|
||||||
return radBoundaryPropertiesPtrList_[patchi]->absorptivity(bandi);
|
return radBoundaryPropertiesPtrList_[patchi]->e
|
||||||
|
(
|
||||||
|
faceI,
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
|
||||||
|
<< " is not found in the boundaryRadiationProperties. "
|
||||||
|
<< "Please add it"
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::boundaryRadiationProperties::absorptivity
|
||||||
|
(
|
||||||
|
const label patchi,
|
||||||
|
const label bandi,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
|
{
|
||||||
|
return radBoundaryPropertiesPtrList_[patchi]->a
|
||||||
|
(
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -129,16 +192,53 @@ Foam::radiation::boundaryRadiationProperties::absorptivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::boundaryRadiationProperties::faceAbsorptivity
|
||||||
|
(
|
||||||
|
const label patchi,
|
||||||
|
const label faceI,
|
||||||
|
const label bandi,
|
||||||
|
vector incomingDirection,
|
||||||
|
scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
|
{
|
||||||
|
return radBoundaryPropertiesPtrList_[patchi]->a
|
||||||
|
(
|
||||||
|
faceI,
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
|
||||||
|
<< " is not found in the boundaryRadiationProperties. "
|
||||||
|
<< "Please add it"
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
Foam::tmp<Foam::scalarField>
|
||||||
Foam::radiation::boundaryRadiationProperties::transmissivity
|
Foam::radiation::boundaryRadiationProperties::transmissivity
|
||||||
(
|
(
|
||||||
const label patchi,
|
const label patchi,
|
||||||
const label bandi
|
const label bandi,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
{
|
{
|
||||||
return radBoundaryPropertiesPtrList_[patchi]->transmissivity(bandi);
|
return radBoundaryPropertiesPtrList_[patchi]->t
|
||||||
|
(
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -151,16 +251,53 @@ Foam::radiation::boundaryRadiationProperties::transmissivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::boundaryRadiationProperties::faceTransmissivity
|
||||||
|
(
|
||||||
|
const label patchi,
|
||||||
|
const label faceI,
|
||||||
|
const label bandi,
|
||||||
|
vector incomingDirection,
|
||||||
|
scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
|
{
|
||||||
|
return radBoundaryPropertiesPtrList_[patchi]->t
|
||||||
|
(
|
||||||
|
faceI,
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
|
||||||
|
<< " is not found in the boundaryRadiationProperties. "
|
||||||
|
<< "Please add it"
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
Foam::tmp<Foam::scalarField>
|
||||||
Foam::radiation::boundaryRadiationProperties::reflectivity
|
Foam::radiation::boundaryRadiationProperties::diffReflectivity
|
||||||
(
|
(
|
||||||
const label patchi,
|
const label patchi,
|
||||||
const label bandi
|
const label bandi,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
{
|
{
|
||||||
return radBoundaryPropertiesPtrList_[patchi]->reflectivity(bandi);
|
return radBoundaryPropertiesPtrList_[patchi]->rDiff
|
||||||
|
(
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -173,10 +310,93 @@ Foam::radiation::boundaryRadiationProperties::reflectivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
Foam::scalar Foam::radiation::boundaryRadiationProperties::faceDiffReflectivity
|
||||||
|
(
|
||||||
|
const label patchi,
|
||||||
|
const label faceI,
|
||||||
|
const label bandi,
|
||||||
|
vector incomingDirection,
|
||||||
|
scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
|
{
|
||||||
|
return radBoundaryPropertiesPtrList_[patchi]->rDiff
|
||||||
|
(
|
||||||
|
faceI,
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Foam::radiation::boundaryRadiationProperties::~boundaryRadiationProperties()
|
FatalErrorInFunction
|
||||||
{}
|
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
|
||||||
|
<< " is not found in the boundaryRadiationProperties. "
|
||||||
|
<< "Please add it"
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::boundaryRadiationProperties::specReflectivity
|
||||||
|
(
|
||||||
|
const label patchi,
|
||||||
|
const label bandi,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
|
{
|
||||||
|
return radBoundaryPropertiesPtrList_[patchi]->rSpec
|
||||||
|
(
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
|
||||||
|
<< " is not found in the boundaryRadiationProperties. "
|
||||||
|
<< "Please add it"
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return tmp<scalarField>::New();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::boundaryRadiationProperties::faceSpecReflectivity
|
||||||
|
(
|
||||||
|
const label patchi,
|
||||||
|
const label faceI,
|
||||||
|
const label bandi,
|
||||||
|
vector incomingDirection,
|
||||||
|
scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (!radBoundaryPropertiesPtrList_[patchi].empty())
|
||||||
|
{
|
||||||
|
return radBoundaryPropertiesPtrList_[patchi]->rSpec
|
||||||
|
(
|
||||||
|
faceI,
|
||||||
|
bandi,
|
||||||
|
incomingDirection,
|
||||||
|
T
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
|
||||||
|
<< " is not found in the boundaryRadiationProperties. "
|
||||||
|
<< "Please add it"
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -86,35 +86,100 @@ public:
|
|||||||
tmp<scalarField> emissivity
|
tmp<scalarField> emissivity
|
||||||
(
|
(
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Access boundary emissivity on face
|
||||||
|
scalar faceEmissivity
|
||||||
|
(
|
||||||
|
const label patchI,
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
vector incomingDirection = Zero,
|
||||||
|
scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Access boundary absorptivity on patch
|
//- Access boundary absorptivity on patch
|
||||||
tmp<scalarField> absorptivity
|
tmp<scalarField> absorptivity
|
||||||
(
|
(
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Access boundary absorptivity on face
|
||||||
|
scalar faceAbsorptivity
|
||||||
|
(
|
||||||
|
const label patchI,
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
vector incomingDirection = Zero,
|
||||||
|
scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Access boundary transmissivity on patch
|
//- Access boundary transmissivity on patch
|
||||||
tmp<scalarField> transmissivity
|
tmp<scalarField> transmissivity
|
||||||
(
|
(
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Access boundary reflectivity on patch
|
//- Access boundary transmissivity on face
|
||||||
tmp<scalarField> reflectivity
|
scalar faceTransmissivity
|
||||||
(
|
(
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
vector incomingDirection = Zero,
|
||||||
|
scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Access boundary diffuse reflectivity on patch
|
||||||
|
tmp<scalarField> diffReflectivity
|
||||||
|
(
|
||||||
|
const label patchI,
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Access boundary diffuse reflectivity on face
|
||||||
|
scalar faceDiffReflectivity
|
||||||
|
(
|
||||||
|
const label patchI,
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
vector incomingDirection = Zero,
|
||||||
|
scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Access boundary specular reflectivity on patch
|
||||||
|
tmp<scalarField> specReflectivity
|
||||||
|
(
|
||||||
|
const label patchI,
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Access boundary specular reflectivity on face
|
||||||
|
scalar faceSpecReflectivity
|
||||||
|
(
|
||||||
|
const label patchI,
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
vector incomingDirection = Zero,
|
||||||
|
scalar T = 0
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~boundaryRadiationProperties();
|
~boundaryRadiationProperties() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,17 +29,47 @@ License
|
|||||||
#include "absorptionEmissionModel.H"
|
#include "absorptionEmissionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(boundaryRadiationPropertiesPatch, 0);
|
||||||
|
defineRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
boundaryRadiationPropertiesPatch,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const Foam::Enum
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
<
|
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::methodType
|
Foam::autoPtr<Foam::radiation::boundaryRadiationPropertiesPatch>
|
||||||
>
|
Foam::radiation::boundaryRadiationPropertiesPatch::New
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::methodTypeNames_
|
(
|
||||||
({
|
const dictionary& dict,
|
||||||
{ methodType::SOLIDRADIATION, "solidRadiation" },
|
const polyPatch& pp
|
||||||
{ methodType::LOOKUP, "lookup" },
|
)
|
||||||
{ methodType::MODEL, "model" },
|
{
|
||||||
});
|
word modelType(dict.lookupCompat("type", {{"mode", 1812}}));
|
||||||
|
|
||||||
|
Info<< "Selecting boundary radiation Model: "
|
||||||
|
<< modelType << endl;
|
||||||
|
|
||||||
|
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||||
|
|
||||||
|
if (!cstrIter.found())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Unknown modelType type "
|
||||||
|
<< modelType << nl << nl
|
||||||
|
<< "Valid radiation types are : " << nl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cstrIter()(dict, pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Private functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Private functions * * * * * * * * * * * * //
|
||||||
@ -70,362 +100,36 @@ Foam::radiation::boundaryRadiationPropertiesPatch::nbrRegion() const
|
|||||||
Foam::radiation::boundaryRadiationPropertiesPatch::
|
Foam::radiation::boundaryRadiationPropertiesPatch::
|
||||||
boundaryRadiationPropertiesPatch
|
boundaryRadiationPropertiesPatch
|
||||||
(
|
(
|
||||||
const polyPatch& p,
|
const dictionary& dict,
|
||||||
const dictionary& dict
|
const polyPatch& p
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
method_(methodTypeNames_.get("mode", dict)),
|
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
|
patch_(p),
|
||||||
absorptionEmission_(nullptr),
|
absorptionEmission_(nullptr),
|
||||||
transmissivity_(nullptr),
|
transmissivity_(nullptr)
|
||||||
patch_(p)
|
|
||||||
{
|
|
||||||
switch (method_)
|
|
||||||
{
|
|
||||||
case SOLIDRADIATION:
|
|
||||||
{
|
|
||||||
if (!isA<mappedPatchBase>(p))
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "\n patch type '" << p.type()
|
|
||||||
<< "' not type '" << mappedPatchBase::typeName << "'"
|
|
||||||
<< "\n for patch " << p.name()
|
|
||||||
<< abort(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MODEL:
|
|
||||||
{
|
|
||||||
const fvMesh& mesh =
|
|
||||||
refCast<const fvMesh>(p.boundaryMesh().mesh());
|
|
||||||
|
|
||||||
absorptionEmission_.reset
|
|
||||||
(
|
|
||||||
absorptionEmissionModel::New(dict, mesh).ptr()
|
|
||||||
);
|
|
||||||
|
|
||||||
transmissivity_.reset
|
|
||||||
(
|
|
||||||
transmissivityModel::New(dict, mesh).ptr()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LOOKUP:
|
|
||||||
{
|
|
||||||
//Do nothing
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::
|
|
||||||
~boundaryRadiationPropertiesPatch()
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::radiation::absorptionEmissionModel&
|
const Foam::radiation::wallAbsorptionEmissionModel&
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::absorptionEmission() const
|
Foam::radiation::boundaryRadiationPropertiesPatch::absorptionEmission() const
|
||||||
{
|
{
|
||||||
return *absorptionEmission_;
|
return *absorptionEmission_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::radiation::transmissivityModel&
|
const Foam::radiation::wallTransmissivityModel&
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::transmissiveModel() const
|
Foam::radiation::boundaryRadiationPropertiesPatch::transmissiveModel() const
|
||||||
{
|
{
|
||||||
return *transmissivity_;
|
return *transmissivity_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
void Foam::radiation::boundaryRadiationPropertiesPatch::write(Ostream& os) const
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::emissivity
|
|
||||||
(
|
|
||||||
const label bandI
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
switch (method_)
|
NotImplemented;
|
||||||
{
|
|
||||||
case SOLIDRADIATION:
|
|
||||||
{
|
|
||||||
const fvMesh& nbrMesh = nbrRegion();
|
|
||||||
|
|
||||||
const radiation::radiationModel& radiation =
|
|
||||||
nbrMesh.lookupObject<radiation::radiationModel>
|
|
||||||
(
|
|
||||||
"radiationProperties"
|
|
||||||
);
|
|
||||||
|
|
||||||
scalarField emissivity
|
|
||||||
(
|
|
||||||
radiation.absorptionEmission().e(bandI)().boundaryField()
|
|
||||||
[
|
|
||||||
nbrPatchIndex()
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
const mappedPatchBase& mpp =
|
|
||||||
refCast<const mappedPatchBase>(patch_);
|
|
||||||
|
|
||||||
mpp.distribute(emissivity);
|
|
||||||
|
|
||||||
return tmp<scalarField>::New(std::move(emissivity));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LOOKUP:
|
|
||||||
{
|
|
||||||
return tmp<scalarField>::New
|
|
||||||
(
|
|
||||||
patch_.size(),
|
|
||||||
dict_.get<scalar>("emissivity")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MODEL:
|
|
||||||
{
|
|
||||||
const label index = patch_.index();
|
|
||||||
|
|
||||||
return tmp<scalarField>::New
|
|
||||||
(
|
|
||||||
absorptionEmission_->e(bandI)().boundaryField()[index]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Please set 'mode' to one of "
|
|
||||||
<< methodTypeNames_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return scalarField(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::absorptivity
|
|
||||||
(
|
|
||||||
const label bandI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
switch (method_)
|
|
||||||
{
|
|
||||||
case SOLIDRADIATION:
|
|
||||||
{
|
|
||||||
const fvMesh& nbrMesh = nbrRegion();
|
|
||||||
|
|
||||||
const radiation::radiationModel& radiation =
|
|
||||||
nbrMesh.lookupObject<radiation::radiationModel>
|
|
||||||
(
|
|
||||||
"radiationProperties"
|
|
||||||
);
|
|
||||||
|
|
||||||
scalarField absorp
|
|
||||||
(
|
|
||||||
radiation.absorptionEmission().a(bandI)().boundaryField()
|
|
||||||
[
|
|
||||||
nbrPatchIndex()
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
const mappedPatchBase& mpp =
|
|
||||||
refCast<const mappedPatchBase>(patch_);
|
|
||||||
|
|
||||||
mpp.distribute(absorp);
|
|
||||||
|
|
||||||
return tmp<scalarField>::New(std::move(absorp));
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MODEL:
|
|
||||||
{
|
|
||||||
const label index = patch_.index();
|
|
||||||
|
|
||||||
return tmp<scalarField>::New
|
|
||||||
(
|
|
||||||
absorptionEmission_->a(bandI)().boundaryField()[index]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LOOKUP:
|
|
||||||
{
|
|
||||||
return tmp<scalarField>::New
|
|
||||||
(
|
|
||||||
patch_.size(),
|
|
||||||
dict_.get<scalar>("absorptivity")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unimplemented method " << method_ << endl
|
|
||||||
<< "Please set 'mode' to one of "
|
|
||||||
<< methodTypeNames_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return scalarField(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::transmissivity
|
|
||||||
(
|
|
||||||
const label bandI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
switch (method_)
|
|
||||||
{
|
|
||||||
case SOLIDRADIATION:
|
|
||||||
{
|
|
||||||
const fvMesh& nbrMesh = nbrRegion();
|
|
||||||
|
|
||||||
const radiation::radiationModel& radiation =
|
|
||||||
nbrMesh.lookupObject<radiation::radiationModel>
|
|
||||||
(
|
|
||||||
"radiationProperties"
|
|
||||||
);
|
|
||||||
|
|
||||||
scalarField trans
|
|
||||||
(
|
|
||||||
radiation.transmissivity().tauEff(bandI)().boundaryField()
|
|
||||||
[
|
|
||||||
nbrPatchIndex()
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
const mappedPatchBase& mpp =
|
|
||||||
refCast<const mappedPatchBase>(patch_);
|
|
||||||
|
|
||||||
mpp.distribute(trans);
|
|
||||||
|
|
||||||
return tmp<scalarField>::New(std::move(trans));
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MODEL:
|
|
||||||
{
|
|
||||||
const label index = patch_.index();
|
|
||||||
|
|
||||||
return tmp<scalarField>::New
|
|
||||||
(
|
|
||||||
transmissivity_->tauEff(bandI)().boundaryField()[index]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
case LOOKUP:
|
|
||||||
{
|
|
||||||
return tmp<scalarField>::New
|
|
||||||
(
|
|
||||||
patch_.size(),
|
|
||||||
dict_.get<scalar>("transmissivity")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unimplemented method " << method_ << endl
|
|
||||||
<< "Please set 'mode' to one of "
|
|
||||||
<< methodTypeNames_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return scalarField(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::radiation::boundaryRadiationPropertiesPatch::reflectivity
|
|
||||||
(
|
|
||||||
const label bandI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const tmp<scalarField> tt = transmissivity(bandI);
|
|
||||||
const tmp<scalarField> ta = absorptivity(bandI);
|
|
||||||
|
|
||||||
return (1.0 - tt - ta);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::radiation::boundaryRadiationPropertiesPatch::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
os.writeEntry("mode", methodTypeNames_[method_]);
|
|
||||||
|
|
||||||
switch (method_)
|
|
||||||
{
|
|
||||||
case MODEL:
|
|
||||||
{
|
|
||||||
word modelType(dict_.get<word>("absorptionEmissionModel"));
|
|
||||||
|
|
||||||
os.writeEntry("absorptionEmissionModel", modelType);
|
|
||||||
|
|
||||||
word modelCoeffs(modelType + word("Coeffs"));
|
|
||||||
os.writeKeyword(modelCoeffs);
|
|
||||||
|
|
||||||
dict_.subDict(modelCoeffs).write(os);
|
|
||||||
|
|
||||||
modelType = dict_.get<word>("transmissivityModel");
|
|
||||||
|
|
||||||
os.writeEntry("transmissivityModel", modelType);
|
|
||||||
|
|
||||||
modelCoeffs = modelType + word("Coeffs");
|
|
||||||
|
|
||||||
os.writeKeyword(modelCoeffs);
|
|
||||||
|
|
||||||
dict_.subDict(modelCoeffs).write(os);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LOOKUP:
|
|
||||||
{
|
|
||||||
const scalarField emissivity("emissivity", dict_, patch_.size());
|
|
||||||
emissivity.writeEntry("emissivity", os);
|
|
||||||
|
|
||||||
const scalarField absorptivity
|
|
||||||
(
|
|
||||||
"absorptivity", dict_, patch_.size()
|
|
||||||
);
|
|
||||||
absorptivity.writeEntry("absorptivity", os);
|
|
||||||
|
|
||||||
const scalarField transmissivity
|
|
||||||
(
|
|
||||||
"transmissivity", dict_, patch_.size()
|
|
||||||
);
|
|
||||||
transmissivity.writeEntry("transmissivity", os);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SOLIDRADIATION:
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,12 +25,6 @@ Class
|
|||||||
Foam::boundaryRadiationPropertiesPatch
|
Foam::boundaryRadiationPropertiesPatch
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Common functions to emissivity. It gets supplied from lookup into a
|
|
||||||
dictionary or calculated by the solidThermo:
|
|
||||||
|
|
||||||
- 'lookup' : lookup volScalarField with name
|
|
||||||
- 'solidThermo' : use solidThermo
|
|
||||||
- 'model' : use a model
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
boundaryRadiationPropertiesPatch.C
|
boundaryRadiationPropertiesPatch.C
|
||||||
@ -44,8 +38,9 @@ SourceFiles
|
|||||||
#include "Enum.H"
|
#include "Enum.H"
|
||||||
#include "fvPatch.H"
|
#include "fvPatch.H"
|
||||||
#include "calculatedFvPatchFields.H"
|
#include "calculatedFvPatchFields.H"
|
||||||
#include "transmissivityModel.H"
|
#include "runTimeSelectionTables.H"
|
||||||
#include "absorptionEmissionModel.H"
|
#include "wallTransmissivityModel.H"
|
||||||
|
#include "wallAbsorptionEmissionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -54,40 +49,18 @@ namespace Foam
|
|||||||
namespace radiation
|
namespace radiation
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class boundaryRadiationPropertiesPatch Declaration
|
Class boundaryRadiationPropertiesPatch Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class boundaryRadiationPropertiesPatch
|
class boundaryRadiationPropertiesPatch
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
|
|
||||||
// - Type of method
|
|
||||||
enum methodType
|
|
||||||
{
|
|
||||||
SOLIDRADIATION,
|
|
||||||
LOOKUP,
|
|
||||||
MODEL
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
static const Enum<methodType> methodTypeNames_;
|
|
||||||
|
|
||||||
//- How to get property
|
|
||||||
const methodType method_;
|
|
||||||
|
|
||||||
//- Dictionary
|
//- Dictionary
|
||||||
const dictionary dict_;
|
const dictionary dict_;
|
||||||
|
|
||||||
//- Absorption/emission model
|
|
||||||
autoPtr<absorptionEmissionModel> absorptionEmission_;
|
|
||||||
|
|
||||||
//- transmissivity model
|
|
||||||
autoPtr<transmissivityModel> transmissivity_;
|
|
||||||
|
|
||||||
//- reference to fvPatch
|
//- reference to fvPatch
|
||||||
const polyPatch& patch_;
|
const polyPatch& patch_;
|
||||||
|
|
||||||
@ -101,52 +74,159 @@ private:
|
|||||||
const fvMesh& nbrRegion() const;
|
const fvMesh& nbrRegion() const;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Absorption/emission model
|
||||||
|
autoPtr<wallAbsorptionEmissionModel> absorptionEmission_;
|
||||||
|
|
||||||
|
//- Transmissivity model
|
||||||
|
autoPtr<wallTransmissivityModel> transmissivity_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("boundaryRadiationPropertiesPatch");
|
||||||
|
|
||||||
|
// Declare runtime constructor selection table
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
boundaryRadiationPropertiesPatch,
|
||||||
|
dictionary,
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
),
|
||||||
|
(dict, pp)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
//- Construct from patch, internal field and dictionary
|
||||||
boundaryRadiationPropertiesPatch
|
boundaryRadiationPropertiesPatch
|
||||||
(
|
(
|
||||||
const polyPatch&,
|
const dictionary&,
|
||||||
const dictionary&
|
const polyPatch&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~boundaryRadiationPropertiesPatch();
|
//- Selector
|
||||||
|
static autoPtr<boundaryRadiationPropertiesPatch> New
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~boundaryRadiationPropertiesPatch() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
//- Method to obtain properties
|
|
||||||
word method() const
|
|
||||||
{
|
|
||||||
return methodTypeNames_[method_];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Return absorptionEmissionModel
|
//- Return absorptionEmissionModel
|
||||||
const absorptionEmissionModel& absorptionEmission() const;
|
const wallAbsorptionEmissionModel& absorptionEmission() const;
|
||||||
|
|
||||||
//- Return transmissivityModel
|
//- Return transmissivityModel
|
||||||
const transmissivityModel& transmissiveModel() const;
|
const wallTransmissivityModel& transmissiveModel() const;
|
||||||
|
|
||||||
//- Calculate corresponding emissivity field for bandI
|
//- Return emissivity on patch
|
||||||
tmp<scalarField> emissivity(const label bandI = 0) const;
|
virtual tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
//- Calculate corresponding absorptivity field for bandI
|
//- Return emissivity on face
|
||||||
tmp<scalarField> absorptivity(const label bandI = 0) const;
|
virtual scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector& dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
//- Calculate corresponding transmissivity field for bandI
|
//- Return absorptivity on patch
|
||||||
tmp<scalarField> transmissivity(const label bandI = 0) const;
|
virtual tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
//- Calculate corresponding reflectivity field
|
//- Return absorptivity on face
|
||||||
tmp<scalarField> reflectivity(const label bandI = 0) const;
|
virtual scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector& dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Return transmissivity on patch
|
||||||
|
virtual tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Return transmissivity on face
|
||||||
|
virtual scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector& dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rSpec
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
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 scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rDiff
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
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 scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
virtual bool isGrey() const = 0;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
virtual label nBands() const = 0;
|
||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
void write(Ostream&) const;
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,204 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "lookup.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(lookup, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
boundaryRadiationPropertiesPatch,
|
||||||
|
lookup,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::lookup::lookup
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
:
|
||||||
|
boundaryRadiationPropertiesPatch(dict, pp),
|
||||||
|
pp_(pp),
|
||||||
|
dict_(dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::lookup::e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New
|
||||||
|
(
|
||||||
|
pp_.size(),
|
||||||
|
dict_.get<scalar>("emissivity")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::lookup::e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(dict_.get<scalar>("emissivity"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::lookup::a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New
|
||||||
|
(
|
||||||
|
pp_.size(),
|
||||||
|
dict_.get<scalar>("absorptivity")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::lookup::a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(dict_.get<scalar>("absorptivity"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::lookup::t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New
|
||||||
|
(
|
||||||
|
pp_.size(),
|
||||||
|
dict_.get<scalar>("transmissivity")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::lookup::t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(dict_.get<scalar>("transmissivity"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::lookup::rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::lookup::rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::lookup::rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::lookup::rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::radiation::lookup::isGrey() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::lookup::nBands() const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::radiation::lookup
|
||||||
|
|
||||||
|
Description
|
||||||
|
Look up type of boundary radiation properties.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type lookup;
|
||||||
|
absorptivity 0.1;
|
||||||
|
emissivity 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef lookup_H
|
||||||
|
#define lookup_H
|
||||||
|
|
||||||
|
#include "boundaryRadiationPropertiesPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class lookup Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class lookup
|
||||||
|
:
|
||||||
|
public boundaryRadiationPropertiesPatch
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Reference to the polyPatch
|
||||||
|
const polyPatch& pp_;
|
||||||
|
|
||||||
|
//-Dictionary
|
||||||
|
const dictionary dict_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("lookup");
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
lookup(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~lookup() = default;
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return emissivity
|
||||||
|
virtual tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emissivity on face
|
||||||
|
virtual scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on patch
|
||||||
|
virtual tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on face
|
||||||
|
virtual scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on patch
|
||||||
|
virtual tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on face
|
||||||
|
virtual scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on face
|
||||||
|
virtual scalar rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection ,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on face
|
||||||
|
virtual scalar rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
virtual bool isGrey() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
virtual label nBands() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace radiation
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,198 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "opaqueDiffusive.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(opaqueDiffusive, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
boundaryRadiationPropertiesPatch,
|
||||||
|
opaqueDiffusive,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::opaqueDiffusive::opaqueDiffusive
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
:
|
||||||
|
boundaryRadiationPropertiesPatch(dict, pp),
|
||||||
|
pp_(pp)
|
||||||
|
{
|
||||||
|
const dictionary& absorptionDict =
|
||||||
|
dict.subDict("wallAbsorptionEmissionModel");
|
||||||
|
|
||||||
|
absorptionEmission_.reset
|
||||||
|
(
|
||||||
|
wallAbsorptionEmissionModel::New(absorptionDict, pp).ptr()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::opaqueDiffusive::e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->e(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueDiffusive::e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->e(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::opaqueDiffusive::a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->a(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueDiffusive::a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->a(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::opaqueDiffusive::t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueDiffusive::t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::opaqueDiffusive::rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueDiffusive::rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::opaqueDiffusive::rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueDiffusive::rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::radiation::opaqueDiffusive::isGrey() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->isGrey();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::opaqueDiffusive::nBands() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->nBands();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::radiation::opaqueDiffusive
|
||||||
|
|
||||||
|
Description
|
||||||
|
Radiation boundary model for opaque diffusive walls. It requires to
|
||||||
|
specify a wallAbsorptionEmissionModel in boundaryRadiationProperties
|
||||||
|
file.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
type opaqueDiffusive;
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.3 0.7);
|
||||||
|
emissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef opaqueDiffusive_H
|
||||||
|
#define opaqueDiffusive_H
|
||||||
|
|
||||||
|
#include "boundaryRadiationPropertiesPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class opaqueDiffusive Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class opaqueDiffusive
|
||||||
|
:
|
||||||
|
public boundaryRadiationPropertiesPatch
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Reference to the polyPatch
|
||||||
|
const polyPatch& pp_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("opaqueDiffusive");
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
opaqueDiffusive(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~opaqueDiffusive() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return emissivity
|
||||||
|
virtual tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emissivity on face
|
||||||
|
virtual scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on patch
|
||||||
|
virtual tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on face
|
||||||
|
virtual scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on patch
|
||||||
|
virtual tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on face
|
||||||
|
virtual scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on face
|
||||||
|
virtual scalar rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection ,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on face
|
||||||
|
virtual scalar rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
virtual bool isGrey() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
virtual label nBands() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace radiation
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,200 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "opaqueReflective.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(opaqueReflective, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
boundaryRadiationPropertiesPatch,
|
||||||
|
opaqueReflective,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::opaqueReflective::opaqueReflective
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
:
|
||||||
|
boundaryRadiationPropertiesPatch(dict, pp),
|
||||||
|
pp_(pp),
|
||||||
|
fd_(dict.lookupOrDefault<scalar>("fd", 1))
|
||||||
|
{
|
||||||
|
const dictionary& absorptionDict =
|
||||||
|
dict.subDict("wallAbsorptionEmissionModel");
|
||||||
|
|
||||||
|
absorptionEmission_.reset
|
||||||
|
(
|
||||||
|
wallAbsorptionEmissionModel::New(absorptionDict, pp).ptr()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::opaqueReflective::e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->e(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueReflective::e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->e(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::opaqueReflective::a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->a(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueReflective::a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->a(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::opaqueReflective::t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueReflective::t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::opaqueReflective::rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return (1.0 - fd_)*(1.0 - a(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueReflective::rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return (1.0 - fd_)*(1.0 - a(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::opaqueReflective::rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return fd_*(1.0 - a(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::opaqueReflective::rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return fd_*(1.0 - a(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::radiation::opaqueReflective::isGrey() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->isGrey();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::opaqueReflective::nBands() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->nBands();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,205 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::radiation::opaqueReflective
|
||||||
|
|
||||||
|
Description
|
||||||
|
Radiation boundary model for opaque reflective walls. It requires to
|
||||||
|
specify a wallAbsorptionEmissionModel and the reflected fraction
|
||||||
|
in boundaryRadiationProperties file
|
||||||
|
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.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
type opaqueReflective;
|
||||||
|
|
||||||
|
fd 0.0;
|
||||||
|
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.3 0.7);
|
||||||
|
emissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef opaqueReflective_H
|
||||||
|
#define opaqueReflective_H
|
||||||
|
|
||||||
|
#include "boundaryRadiationPropertiesPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class opaqueReflective Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class opaqueReflective
|
||||||
|
:
|
||||||
|
public boundaryRadiationPropertiesPatch
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Reference to the polyPatch
|
||||||
|
const polyPatch& pp_;
|
||||||
|
|
||||||
|
//- Diffuse fraction
|
||||||
|
const scalar fd_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("opaqueReflective");
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
opaqueReflective(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~opaqueReflective() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return emissivity
|
||||||
|
virtual tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emissivity on face
|
||||||
|
virtual scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on patch
|
||||||
|
virtual tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on face
|
||||||
|
virtual scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on patch
|
||||||
|
virtual tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on face
|
||||||
|
virtual scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on face
|
||||||
|
virtual scalar rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection ,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on face
|
||||||
|
virtual scalar rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
virtual bool isGrey() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
virtual label nBands() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace radiation
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,200 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "transparent.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(transparent, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
boundaryRadiationPropertiesPatch,
|
||||||
|
transparent,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::transparent::transparent
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
:
|
||||||
|
boundaryRadiationPropertiesPatch(dict, pp),
|
||||||
|
pp_(pp)
|
||||||
|
{
|
||||||
|
const dictionary& absorptionDict =
|
||||||
|
dict.subDict("wallAbsorptionEmissionModel");
|
||||||
|
|
||||||
|
absorptionEmission_.reset
|
||||||
|
(
|
||||||
|
wallAbsorptionEmissionModel::New(absorptionDict, pp).ptr()
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::transparent::e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->e(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::transparent::e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->e(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::transparent::a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->a(bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::transparent::a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return(absorptionEmission_->a(faceI, bandI, dir, T));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::transparent::t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::transparent::t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::transparent::rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::transparent::rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::transparent::rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* dir,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>::New(pp_.size(), Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::transparent::rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::radiation::transparent::isGrey() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->isGrey();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::transparent::nBands() const
|
||||||
|
{
|
||||||
|
return absorptionEmission_->nBands();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::radiation::transparent
|
||||||
|
|
||||||
|
Description
|
||||||
|
Radiation boundary model for transparent walls. It requires to
|
||||||
|
specify a wallAbsorptionEmissionModel in boundaryRadiationProperties
|
||||||
|
file.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
type transparent;
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.3 0.7);
|
||||||
|
emissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef transparent_H
|
||||||
|
#define transparent_H
|
||||||
|
|
||||||
|
#include "boundaryRadiationPropertiesPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class transparent Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class transparent
|
||||||
|
:
|
||||||
|
public boundaryRadiationPropertiesPatch
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Reference to the polyPatch
|
||||||
|
const polyPatch& pp_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("transparent");
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
transparent(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~transparent() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return emissivity
|
||||||
|
virtual tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emissivity on face
|
||||||
|
virtual scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on patch
|
||||||
|
virtual tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on face
|
||||||
|
virtual scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on patch
|
||||||
|
virtual tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on face
|
||||||
|
virtual scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rSpec
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return specular reflectivity on face
|
||||||
|
virtual scalar rSpec
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on patch
|
||||||
|
virtual tmp<scalarField> rDiff
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection ,
|
||||||
|
scalarField* T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return diffusive reflectivity on face
|
||||||
|
virtual scalar rDiff
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector& dir,
|
||||||
|
const scalar T
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
virtual bool isGrey() const;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
virtual label nBands() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace radiation
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -66,7 +66,7 @@ Foam::solarCalculator::sunLoadModelTypeNames_
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::solarCalculator::calculateBetaTetha()
|
void Foam::solarCalculator::calculateBetaTheta()
|
||||||
{
|
{
|
||||||
scalar runTime = 0.0;
|
scalar runTime = 0.0;
|
||||||
switch (sunDirectionModel_)
|
switch (sunDirectionModel_)
|
||||||
@ -104,20 +104,20 @@ void Foam::solarCalculator::calculateBetaTetha()
|
|||||||
|
|
||||||
scalar deltaRad = degToRad(delta);
|
scalar deltaRad = degToRad(delta);
|
||||||
beta_ = max(asin(cos(L)*cos(deltaRad)*cos(H) + sin(L)*sin(deltaRad)), 1e-3);
|
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
|
// theta is the angle between the SOUTH axis and the Sun
|
||||||
// If the hour angle is lower than zero (morning) the Sun is positioned
|
// If the hour angle is lower than zero (morning) the Sun is positioned
|
||||||
// on the East side.
|
// on the East side.
|
||||||
if (H < 0)
|
if (H < 0)
|
||||||
{
|
{
|
||||||
tetha_ += 2*(constant::mathematical::pi - tetha_);
|
theta_ += 2*(constant::mathematical::pi - theta_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info << tab << "altitude : " << radToDeg(beta_) << endl;
|
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
|
// Assuming 'z' vertical, 'y' North and 'x' East
|
||||||
direction_.z() = -sin(beta_);
|
direction_.z() = -sin(beta_);
|
||||||
direction_.y() = cos(beta_)*cos(tetha_); // South axis
|
direction_.y() = cos(beta_)*cos(theta_); // South axis
|
||||||
direction_.x() = cos(beta_)*sin(tetha_); // West axis
|
direction_.x() = cos(beta_)*sin(theta_); // West axis
|
||||||
|
|
||||||
direction_.normalise();
|
direction_.normalise();
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ void Foam::solarCalculator::init()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
calculateBetaTetha();
|
calculateBetaTheta();
|
||||||
calculateSunDirection();
|
calculateSunDirection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ void Foam::solarCalculator::init()
|
|||||||
sunTrackingUpdateInterval_
|
sunTrackingUpdateInterval_
|
||||||
);
|
);
|
||||||
|
|
||||||
calculateBetaTetha();
|
calculateBetaTheta();
|
||||||
calculateSunDirection();
|
calculateSunDirection();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ void Foam::solarCalculator::init()
|
|||||||
|
|
||||||
if (!dict_.readIfPresent("beta", beta_))
|
if (!dict_.readIfPresent("beta", beta_))
|
||||||
{
|
{
|
||||||
calculateBetaTetha();
|
calculateBetaTheta();
|
||||||
}
|
}
|
||||||
|
|
||||||
directSolarRad_ =
|
directSolarRad_ =
|
||||||
@ -254,7 +254,7 @@ Foam::solarCalculator::solarCalculator
|
|||||||
A_(0.0),
|
A_(0.0),
|
||||||
B_(0.0),
|
B_(0.0),
|
||||||
beta_(0.0),
|
beta_(0.0),
|
||||||
tetha_(0.0),
|
theta_(0.0),
|
||||||
skyCloudCoverFraction_(0.0),
|
skyCloudCoverFraction_(0.0),
|
||||||
Setrn_(0.0),
|
Setrn_(0.0),
|
||||||
SunPrime_(0.0),
|
SunPrime_(0.0),
|
||||||
@ -270,12 +270,6 @@ Foam::solarCalculator::solarCalculator
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::solarCalculator::~solarCalculator()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::solarCalculator::correctSunDirection()
|
void Foam::solarCalculator::correctSunDirection()
|
||||||
@ -288,7 +282,7 @@ void Foam::solarCalculator::correctSunDirection()
|
|||||||
}
|
}
|
||||||
case mSunDirTracking:
|
case mSunDirTracking:
|
||||||
{
|
{
|
||||||
calculateBetaTetha();
|
calculateBetaTheta();
|
||||||
calculateSunDirection();
|
calculateSunDirection();
|
||||||
directSolarRad_ = A_/exp(B_/sin(max(beta_, ROOTVSMALL)));
|
directSolarRad_ = A_/exp(B_/sin(max(beta_, ROOTVSMALL)));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -98,7 +98,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class solarCalculator Declaration
|
Class solarCalculator Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class solarCalculator
|
class solarCalculator
|
||||||
@ -131,6 +131,7 @@ protected:
|
|||||||
//- Sun load models
|
//- Sun load models
|
||||||
static const Enum<sunLModel> sunLoadModelTypeNames_;
|
static const Enum<sunLModel> sunLoadModelTypeNames_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -158,7 +159,7 @@ private:
|
|||||||
scalar A_;
|
scalar A_;
|
||||||
scalar B_;
|
scalar B_;
|
||||||
scalar beta_;
|
scalar beta_;
|
||||||
scalar tetha_;
|
scalar theta_;
|
||||||
|
|
||||||
//- Sky cloud cover fraction [0-1]
|
//- Sky cloud cover fraction [0-1]
|
||||||
scalar skyCloudCoverFraction_;
|
scalar skyCloudCoverFraction_;
|
||||||
@ -206,8 +207,8 @@ private:
|
|||||||
//- Init
|
//- Init
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
//- Calculate beta and tetha angles
|
//- Calculate beta and theta angles
|
||||||
void calculateBetaTetha();
|
void calculateBetaTheta();
|
||||||
|
|
||||||
//- Calculate Sun direction
|
//- Calculate Sun direction
|
||||||
void calculateSunDirection();
|
void calculateSunDirection();
|
||||||
@ -226,15 +227,15 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~solarCalculator();
|
~solarCalculator() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- const acess to direction
|
//- const access to direction
|
||||||
const vector direction() const
|
const vector& direction() const
|
||||||
{
|
{
|
||||||
return direction_;
|
return direction_;
|
||||||
}
|
}
|
||||||
@ -245,14 +246,20 @@ public:
|
|||||||
return direction_;
|
return direction_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return direct solar irradiation
|
//- Return direct solar irradiation
|
||||||
scalar directSolarRad()
|
scalar& directSolarRad()
|
||||||
|
{
|
||||||
|
return directSolarRad_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return const access to direct solar irradiation
|
||||||
|
const scalar& directSolarRad() const
|
||||||
{
|
{
|
||||||
return directSolarRad_;
|
return directSolarRad_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return diffuse solar irradiation
|
//- Return diffuse solar irradiation
|
||||||
scalar diffuseSolarRad()
|
scalar& diffuseSolarRad()
|
||||||
{
|
{
|
||||||
return diffuseSolarRad_;
|
return diffuseSolarRad_;
|
||||||
}
|
}
|
||||||
@ -269,10 +276,10 @@ public:
|
|||||||
return beta_;
|
return beta_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return tetha
|
//- Return theta
|
||||||
scalar tetha()
|
scalar theta()
|
||||||
{
|
{
|
||||||
return tetha_;
|
return theta_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return Sun direction model
|
//- Return Sun direction model
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "multiBandSolidTransmissivity.H"
|
#include "constantAbsorption.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -32,12 +32,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace radiation
|
namespace radiation
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(multiBandSolidTransmissivity, 0);
|
defineTypeNameAndDebug(constantAbsorption, 0);
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
addToRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
transmissivityModel,
|
wallAbsorptionEmissionModel,
|
||||||
multiBandSolidTransmissivity,
|
constantAbsorption,
|
||||||
dictionary
|
dictionary
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -46,51 +46,65 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::radiation::multiBandSolidTransmissivity::multiBandSolidTransmissivity
|
Foam::radiation::constantAbsorption::constantAbsorption
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const polyPatch& pp
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
transmissivityModel(dict, mesh),
|
wallAbsorptionEmissionModel(dict, pp),
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
coeffsDict_(dict),
|
||||||
tauCoeffs_(),
|
a_(coeffsDict_.get<scalar>("absorptivity")),
|
||||||
nBands_(0)
|
e_(coeffsDict_.get<scalar>("emissivity"))
|
||||||
{
|
|
||||||
coeffsDict_.readEntry("transmissivity", tauCoeffs_);
|
|
||||||
nBands_ = tauCoeffs_.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::radiation::multiBandSolidTransmissivity::~multiBandSolidTransmissivity()
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::a
|
||||||
Foam::radiation::multiBandSolidTransmissivity::tauEff(const label bandI) const
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
tmp<volScalarField> tt
|
return tmp<scalarField>(new scalarField(pp_.size(), a_));
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"t",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar("t", dimless/dimLength, tauCoeffs_[bandI])
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return tt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::constantAbsorption::a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return a_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>(new scalarField(pp_.size(), e_));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::constantAbsorption::e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return e_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,23 +22,23 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::radiation::noTransmissivity
|
Foam::radiation::constantAbsorption
|
||||||
|
|
||||||
Group
|
Group
|
||||||
grpRadiationTransmissivitySubModels
|
grpRadiationTransmissivitySubModels
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Dummy transmissivity model for 'none'
|
Constant radiation transmissivity coefficient
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
noTransmissivity.C
|
constantAbsorption.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef radiation_noTransmissivity_H
|
#ifndef radiation_constantAbsorption_H
|
||||||
#define radiation_noTransmissivity_H
|
#define radiation_constantAbsorption_H
|
||||||
|
|
||||||
#include "transmissivityModel.H"
|
#include "wallAbsorptionEmissionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -48,42 +48,84 @@ namespace radiation
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class noTransmissivity Declaration
|
Class constantAbsorption Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class noTransmissivity
|
class constantAbsorption
|
||||||
:
|
:
|
||||||
public transmissivityModel
|
public wallAbsorptionEmissionModel
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Coefficients dictionary
|
||||||
|
dictionary coeffsDict_;
|
||||||
|
|
||||||
|
//- Absorptivity coefficient
|
||||||
|
scalar a_;
|
||||||
|
|
||||||
|
//- Emissivity coefficient
|
||||||
|
scalar e_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("none");
|
TypeName("constantAbsorption");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
noTransmissivity(const dictionary& dict, const fvMesh& mesh);
|
constantAbsorption(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~noTransmissivity();
|
virtual ~constantAbsorption() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return scatter coefficient
|
//- absorptivity coefficient
|
||||||
tmp<volScalarField> tauEff(const label bandI = 0) const;
|
tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Is Grey
|
//- Return absorptivity on face
|
||||||
|
scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emission coefficient
|
||||||
|
tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emission coefficient
|
||||||
|
scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
inline bool isGrey() const
|
inline bool isGrey() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Number of bands
|
//- Number of bands
|
||||||
inline label nBands() const
|
inline label nBands() const
|
||||||
{
|
{
|
||||||
@ -0,0 +1,121 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2015-2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "multiBandAbsorption.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(multiBandAbsorption, 0);
|
||||||
|
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
wallAbsorptionEmissionModel,
|
||||||
|
multiBandAbsorption,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::multiBandAbsorption::multiBandAbsorption
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
:
|
||||||
|
wallAbsorptionEmissionModel(dict, pp),
|
||||||
|
coeffsDict_(dict),
|
||||||
|
aCoeffs_(),
|
||||||
|
eCoeffs_(),
|
||||||
|
nBands_(0)
|
||||||
|
{
|
||||||
|
coeffsDict_.readEntry("absorptivity", aCoeffs_);
|
||||||
|
coeffsDict_.readEntry("emissivity", eCoeffs_);
|
||||||
|
nBands_ = aCoeffs_.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::multiBandAbsorption::~multiBandAbsorption()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::multiBandAbsorption::a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>(new scalarField(pp_.size(), aCoeffs_[bandI]));
|
||||||
|
}
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::multiBandAbsorption::a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return aCoeffs_[bandI];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::multiBandAbsorption::e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>(new scalarField(pp_.size(), eCoeffs_[bandI]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::multiBandAbsorption::e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return eCoeffs_[bandI];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,177 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2015-2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::radiation::multiBandAbsorption
|
||||||
|
|
||||||
|
Group
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
|
||||||
|
Description
|
||||||
|
multiBandAbsorption radiation transmissivity for solids.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.3 0.7);
|
||||||
|
emissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
multiBandAbsorption.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef multiBandAbsorption_H
|
||||||
|
#define multiBandAbsorption_H
|
||||||
|
|
||||||
|
#include "wallAbsorptionEmissionModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class multiBandAbsorption Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class multiBandAbsorption
|
||||||
|
:
|
||||||
|
public wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Public data
|
||||||
|
|
||||||
|
//- Maximum number of bands
|
||||||
|
static const label maxBands_ = 5;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Absorption model dictionary
|
||||||
|
dictionary coeffsDict_;
|
||||||
|
|
||||||
|
//- Absorption coefficients
|
||||||
|
scalarList aCoeffs_;
|
||||||
|
|
||||||
|
//- Emission coefficients
|
||||||
|
scalarList eCoeffs_;
|
||||||
|
|
||||||
|
//- Bands
|
||||||
|
label nBands_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("multiBandAbsorption");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
multiBandAbsorption
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~multiBandAbsorption();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- absorptivity coefficient
|
||||||
|
tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on face
|
||||||
|
scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emission coefficient
|
||||||
|
tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emission coefficient
|
||||||
|
scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
inline bool isGrey() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
inline label nBands() const
|
||||||
|
{
|
||||||
|
return nBands_;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace radiation
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,215 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2015-2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "solidAbsorption.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "mappedPatchBase.H"
|
||||||
|
#include "radiationModel.H"
|
||||||
|
#include "absorptionEmissionModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(solidAbsorption, 0);
|
||||||
|
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
wallAbsorptionEmissionModel,
|
||||||
|
solidAbsorption,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Private members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const Foam::fvMesh& Foam::radiation::solidAbsorption::nbrRegion() const
|
||||||
|
{
|
||||||
|
const mappedPatchBase& mpp = refCast<const mappedPatchBase>(pp_);
|
||||||
|
return (refCast<const fvMesh>(mpp.sampleMesh()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::solidAbsorption::nbrPatchIndex() const
|
||||||
|
{
|
||||||
|
const mappedPatchBase& mpp = refCast<const mappedPatchBase>(pp_);
|
||||||
|
return (mpp.samplePolyPatch().index());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::solidAbsorption::solidAbsorption
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
:
|
||||||
|
wallAbsorptionEmissionModel(dict, pp)
|
||||||
|
{
|
||||||
|
if (!isA<mappedPatchBase>(pp))
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "\n patch type '" << pp.type()
|
||||||
|
<< "' not type '" << mappedPatchBase::typeName << "'"
|
||||||
|
<< "\n for patch " << pp.name()
|
||||||
|
<< abort(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::solidAbsorption::~solidAbsorption()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::solidAbsorption::a
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// Since we're inside initEvaluate/evaluate there might be processor
|
||||||
|
// comms underway. Change the tag we use.
|
||||||
|
int oldTag = UPstream::msgType();
|
||||||
|
UPstream::msgType() = oldTag+1;
|
||||||
|
|
||||||
|
const fvMesh& nbrMesh = nbrRegion();
|
||||||
|
|
||||||
|
const radiation::radiationModel& radiation =
|
||||||
|
nbrMesh.lookupObject<radiation::radiationModel>
|
||||||
|
(
|
||||||
|
"radiationProperties"
|
||||||
|
);
|
||||||
|
|
||||||
|
scalarField absorptivity
|
||||||
|
(
|
||||||
|
radiation.absorptionEmission().a
|
||||||
|
(
|
||||||
|
bandI
|
||||||
|
)().boundaryField()
|
||||||
|
[
|
||||||
|
nbrPatchIndex()
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
const mappedPatchBase& mpp = refCast<const mappedPatchBase>(pp_);
|
||||||
|
|
||||||
|
mpp.distribute(absorptivity);
|
||||||
|
|
||||||
|
// Restore tag
|
||||||
|
UPstream::msgType() = oldTag;
|
||||||
|
|
||||||
|
return tmp<scalarField>::New(std::move(absorptivity));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::solidAbsorption::a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return a(bandI, nullptr, nullptr)()[faceI];
|
||||||
|
}
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::radiation::solidAbsorption::e
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
|
||||||
|
// Since we're inside initEvaluate/evaluate there might be processor
|
||||||
|
// comms underway. Change the tag we use.
|
||||||
|
int oldTag = UPstream::msgType();
|
||||||
|
UPstream::msgType() = oldTag+1;
|
||||||
|
|
||||||
|
const fvMesh& nbrMesh = nbrRegion();
|
||||||
|
|
||||||
|
const radiation::radiationModel& radiation =
|
||||||
|
nbrMesh.lookupObject<radiation::radiationModel>
|
||||||
|
(
|
||||||
|
"radiationProperties"
|
||||||
|
);
|
||||||
|
|
||||||
|
scalarField emissivity
|
||||||
|
(
|
||||||
|
radiation.absorptionEmission().e
|
||||||
|
(
|
||||||
|
bandI
|
||||||
|
)().boundaryField()
|
||||||
|
[
|
||||||
|
nbrPatchIndex()
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
const mappedPatchBase& mpp = refCast<const mappedPatchBase>(pp_);
|
||||||
|
|
||||||
|
mpp.distribute(emissivity);
|
||||||
|
|
||||||
|
// Restore tag
|
||||||
|
UPstream::msgType() = oldTag;
|
||||||
|
|
||||||
|
return tmp<scalarField>::New(std::move(emissivity));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::radiation::solidAbsorption::e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return e(bandI, nullptr, nullptr)()[faceI];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::radiation::solidAbsorption::nBands() const
|
||||||
|
{
|
||||||
|
const fvMesh& nbrMesh = nbrRegion();
|
||||||
|
|
||||||
|
const radiation::radiationModel& radiation =
|
||||||
|
nbrMesh.lookupObject<radiation::radiationModel>
|
||||||
|
(
|
||||||
|
"radiationProperties"
|
||||||
|
);
|
||||||
|
|
||||||
|
return (radiation.absorptionEmission().nBands());
|
||||||
|
}
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2015-2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::radiation::solidAbsorption
|
||||||
|
|
||||||
|
|
||||||
|
Description
|
||||||
|
Radiation absorptivity-emissivity model to be used on walls on
|
||||||
|
inter-regions patches when the solid opaque radiation model is used
|
||||||
|
in the solid and the wall emissivity and absorptivity are taken from
|
||||||
|
the solid radiation properties
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type solidAbsorption;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
solidAbsorption.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef radiation_solidAbsorption_H
|
||||||
|
#define radiation_solidAbsorption_H
|
||||||
|
|
||||||
|
#include "wallAbsorptionEmissionModel.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class solidAbsorption Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class solidAbsorption
|
||||||
|
:
|
||||||
|
public wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
|
||||||
|
// Private members
|
||||||
|
|
||||||
|
//- Nbr region
|
||||||
|
const fvMesh& nbrRegion() const;
|
||||||
|
|
||||||
|
//- Nbr index patch
|
||||||
|
label nbrPatchIndex() const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("solidAbsorption");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
solidAbsorption(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~solidAbsorption();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- absorptivity coefficient
|
||||||
|
tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return absorptivity on face
|
||||||
|
scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emission coefficient
|
||||||
|
tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return emission coefficient
|
||||||
|
scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
inline bool isGrey() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
inline label nBands() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace radiation
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -24,7 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
#include "transmissivityModel.H"
|
#include "wallAbsorptionEmissionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -32,27 +32,27 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace radiation
|
namespace radiation
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(transmissivityModel, 0);
|
defineTypeNameAndDebug(wallAbsorptionEmissionModel, 0);
|
||||||
defineRunTimeSelectionTable(transmissivityModel, dictionary);
|
defineRunTimeSelectionTable(wallAbsorptionEmissionModel, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::radiation::transmissivityModel::transmissivityModel
|
Foam::radiation::wallAbsorptionEmissionModel::wallAbsorptionEmissionModel
|
||||||
(
|
(
|
||||||
const dictionary&,
|
const dictionary&,
|
||||||
const fvMesh& mesh
|
const polyPatch& pp
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mesh_(mesh)
|
pp_(pp)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::radiation::transmissivityModel::~transmissivityModel()
|
Foam::radiation::wallAbsorptionEmissionModel::~wallAbsorptionEmissionModel()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,160 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::radiation::wallAbsorptionEmissionModel
|
||||||
|
|
||||||
|
Description
|
||||||
|
Based class for wall absorption emission models
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef wallAbsorptionEmissionModel_H
|
||||||
|
#define wallAbsorptionEmissionModel_H
|
||||||
|
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
#include "runTimeSelectionTables.H"
|
||||||
|
#include "polyPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class wallAbsorptionEmissionModel Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Reference to the polyPatch
|
||||||
|
const polyPatch& pp_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("wallAbsorptionEmissionModel");
|
||||||
|
|
||||||
|
// Declare runtime constructor selection table
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
wallAbsorptionEmissionModel,
|
||||||
|
dictionary,
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
),
|
||||||
|
(dict, pp)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
(
|
||||||
|
const dictionary& dict, const polyPatch& pp
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Selector
|
||||||
|
|
||||||
|
static autoPtr<wallAbsorptionEmissionModel> New
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~wallAbsorptionEmissionModel();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return emissivity on patch
|
||||||
|
virtual tmp<scalarField> e
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//- Return emissivity on face
|
||||||
|
virtual scalar e
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//- Return absorptivity on patch
|
||||||
|
virtual tmp<scalarField> a
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//- Return absorptivity on face
|
||||||
|
virtual scalar a
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Is Grey
|
||||||
|
virtual bool isGrey() const = 0;
|
||||||
|
|
||||||
|
//- Number of bands
|
||||||
|
virtual label nBands() const = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace radiation
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "error.H"
|
||||||
|
#include "wallAbsorptionEmissionModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::radiation::wallAbsorptionEmissionModel> Foam::radiation::
|
||||||
|
wallAbsorptionEmissionModel::New
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const word modelType(dict.get<word>("type"));
|
||||||
|
|
||||||
|
auto cstrIter = dictionaryConstructorTablePtr_->find(modelType);
|
||||||
|
|
||||||
|
if (!cstrIter.found())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Unknown wallAbsorptionEmissionModel type "
|
||||||
|
<< modelType << nl << nl
|
||||||
|
<< "Valid wallAbsorptionEmissionModel types :" << nl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<wallAbsorptionEmissionModel>(cstrIter()(dict, pp));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ namespace Foam
|
|||||||
|
|
||||||
addToRunTimeSelectionTable
|
addToRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
transmissivityModel,
|
wallTransmissivityModel,
|
||||||
constantTransmissivity,
|
constantTransmissivity,
|
||||||
dictionary
|
dictionary
|
||||||
);
|
);
|
||||||
@ -49,45 +49,38 @@ namespace Foam
|
|||||||
Foam::radiation::constantTransmissivity::constantTransmissivity
|
Foam::radiation::constantTransmissivity::constantTransmissivity
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const polyPatch& pp
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
transmissivityModel(dict, mesh),
|
wallTransmissivityModel(dict, pp),
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
coeffsDict_(dict),
|
||||||
tau_(coeffsDict_.get<scalar>("transmissivity"))
|
tau_(coeffsDict_.get<scalar>("transmissivity"))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::radiation::constantTransmissivity::~constantTransmissivity()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::scalarField>
|
||||||
Foam::radiation::constantTransmissivity::tauEff(const label bandI) const
|
Foam::radiation::constantTransmissivity::t
|
||||||
|
(
|
||||||
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
tmp<volScalarField> tt
|
return tmp<scalarField>::New(pp_.size(), tau_);
|
||||||
(
|
}
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"tau",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar("tau", dimless/dimLength, tau_)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return tt;
|
|
||||||
|
Foam::scalar Foam::radiation::constantTransmissivity::t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI,
|
||||||
|
const vector dir,
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tau_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,7 +38,7 @@ SourceFiles
|
|||||||
#ifndef radiation_constantTransmissivity_H
|
#ifndef radiation_constantTransmissivity_H
|
||||||
#define radiation_constantTransmissivity_H
|
#define radiation_constantTransmissivity_H
|
||||||
|
|
||||||
#include "transmissivityModel.H"
|
#include "wallTransmissivityModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ namespace radiation
|
|||||||
|
|
||||||
class constantTransmissivity
|
class constantTransmissivity
|
||||||
:
|
:
|
||||||
public transmissivityModel
|
public wallTransmissivityModel
|
||||||
{
|
{
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -61,7 +61,7 @@ class constantTransmissivity
|
|||||||
//- Coefficients dictionary
|
//- Coefficients dictionary
|
||||||
dictionary coeffsDict_;
|
dictionary coeffsDict_;
|
||||||
|
|
||||||
//- Transmissivity coefficient / []
|
//- Transmissivity coefficient
|
||||||
scalar tau_;
|
scalar tau_;
|
||||||
|
|
||||||
|
|
||||||
@ -74,18 +74,31 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
constantTransmissivity(const dictionary& dict, const fvMesh& mesh);
|
constantTransmissivity(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~constantTransmissivity();
|
virtual ~constantTransmissivity() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return scatter coefficient
|
//- Return transmissivity coefficient
|
||||||
tmp<volScalarField> tauEff(const label bandI = 0) const;
|
tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on facw
|
||||||
|
scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Is Grey
|
//- Is Grey
|
||||||
inline bool isGrey() const
|
inline bool isGrey() const
|
||||||
@ -93,7 +106,6 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Number of bands
|
//- Number of bands
|
||||||
inline label nBands() const
|
inline label nBands() const
|
||||||
{
|
{
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "noTransmissivity.H"
|
#include "multiBandTransmissivity.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -32,11 +32,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace radiation
|
namespace radiation
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(noTransmissivity, 0);
|
defineTypeNameAndDebug(multiBandTransmissivity, 0);
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
addToRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
transmissivityModel,
|
wallTransmissivityModel,
|
||||||
noTransmissivity,
|
multiBandTransmissivity,
|
||||||
dictionary
|
dictionary
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -45,46 +46,45 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::radiation::noTransmissivity::noTransmissivity
|
Foam::radiation::multiBandTransmissivity::multiBandTransmissivity
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const polyPatch& pp
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
transmissivityModel(dict, mesh)
|
wallTransmissivityModel(dict, pp),
|
||||||
{}
|
coeffsDict_(dict),
|
||||||
|
tauCoeffs_(),
|
||||||
|
nBands_(0)
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
{
|
||||||
|
coeffsDict_.readEntry("transmissivity", tauCoeffs_);
|
||||||
Foam::radiation::noTransmissivity::~noTransmissivity()
|
nBands_ = tauCoeffs_.size();
|
||||||
{}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::radiation::noTransmissivity::tauEff
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::radiation::multiBandTransmissivity::t
|
||||||
(
|
(
|
||||||
const label bandI
|
const label bandI,
|
||||||
|
vectorField* incomingDirection,
|
||||||
|
scalarField* T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<scalarField>::New(pp_.size(), tauCoeffs_[bandI]);
|
||||||
(
|
}
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
Foam::scalar Foam::radiation::multiBandTransmissivity::t
|
||||||
(
|
(
|
||||||
"tau",
|
const label faceI,
|
||||||
mesh_.time().timeName(),
|
const label bandI,
|
||||||
mesh_,
|
const vector dir,
|
||||||
IOobject::NO_READ,
|
const scalar T
|
||||||
IOobject::NO_WRITE,
|
) const
|
||||||
false
|
{
|
||||||
),
|
return tauCoeffs_[bandI];
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimless, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,23 +22,34 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::radiation::multiBandSolidTransmissivity
|
Foam::radiation::multiBandTransmissivity
|
||||||
|
|
||||||
Group
|
Group
|
||||||
grpRadiationTransmissivitySubModels
|
grpwallTransmissivityModel
|
||||||
|
|
||||||
Description
|
Description
|
||||||
multiBandSolidTransmissivity radiation transmissivity for solids.
|
multiBandTransmissivity radiation transmissivity for solids.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
wallTransmissivityModel
|
||||||
|
{
|
||||||
|
type multiBandTransmissivity;
|
||||||
|
transmissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
multiBandSolidTransmissivity.C
|
multiBandTransmissivity.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef multiBandSolidTransmissivity_H
|
#ifndef multiBandTransmissivity_H
|
||||||
#define multiBandSolidTransmissivity_H
|
#define multiBandTransmissivity_H
|
||||||
|
|
||||||
#include "transmissivityModel.H"
|
#include "wallTransmissivityModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -48,12 +59,12 @@ namespace radiation
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class multiBandSolidTransmissivity Declaration
|
Class multiBandTransmissivity Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class multiBandSolidTransmissivity
|
class multiBandTransmissivity
|
||||||
:
|
:
|
||||||
public transmissivityModel
|
public wallTransmissivityModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -80,30 +91,43 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("multiBandSolidTransmissivity");
|
TypeName("multiBandTransmissivity");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
multiBandSolidTransmissivity
|
multiBandTransmissivity
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const polyPatch& p
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~multiBandSolidTransmissivity();
|
virtual ~multiBandTransmissivity() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Transmissivity coefficient
|
//- Return transmissivity
|
||||||
tmp<volScalarField> tauEff(const label bandI) const;
|
tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return transmissivity on face
|
||||||
|
scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Is Grey
|
//- Is Grey
|
||||||
inline bool isGrey() const
|
inline bool isGrey() const
|
||||||
@ -111,13 +135,11 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Number of bands
|
//- Number of bands
|
||||||
inline label nBands() const
|
inline label nBands() const
|
||||||
{
|
{
|
||||||
return nBands_;
|
return nBands_;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "error.H"
|
||||||
|
#include "wallTransmissivityModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace radiation
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(wallTransmissivityModel, 0);
|
||||||
|
defineRunTimeSelectionTable(wallTransmissivityModel, dictionary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::radiation::wallTransmissivityModel::wallTransmissivityModel
|
||||||
|
(
|
||||||
|
const dictionary&,
|
||||||
|
const polyPatch& pp
|
||||||
|
)
|
||||||
|
:
|
||||||
|
pp_(pp)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,20 +22,20 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::radiation::transmissivityModel
|
Foam::radiation::wallTransmissivityModel
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Base class for radiation scattering
|
Base class for wall transmissivity models
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef transmissivityModel_H
|
#ifndef wallTransmissivityModel_H
|
||||||
#define transmissivityModel_H
|
#define wallTransmissivityModel_H
|
||||||
|
|
||||||
#include "IOdictionary.H"
|
#include "dictionary.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
#include "volFields.H"
|
#include "polyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -45,69 +45,83 @@ namespace radiation
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class transmissivityModel Declaration
|
Class wallTransmissivityModel Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class transmissivityModel
|
class wallTransmissivityModel
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Reference to the fvMesh
|
//- Reference to the polyPatch
|
||||||
const fvMesh& mesh_;
|
const polyPatch& pp_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("transmissivityModel");
|
TypeName("wallTransmissivityModel");
|
||||||
|
|
||||||
// Declare runtime constructor selection table
|
// Declare runtime constructor selection table
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
declareRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
autoPtr,
|
autoPtr,
|
||||||
transmissivityModel,
|
wallTransmissivityModel,
|
||||||
dictionary,
|
dictionary,
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const polyPatch& pp
|
||||||
),
|
),
|
||||||
(dict, mesh)
|
(dict, pp)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
transmissivityModel(const dictionary& dict, const fvMesh& mesh);
|
wallTransmissivityModel(const dictionary& dict, const polyPatch& pp);
|
||||||
|
|
||||||
|
|
||||||
// Selector
|
// Selector
|
||||||
|
|
||||||
static autoPtr<transmissivityModel> New
|
static autoPtr<wallTransmissivityModel> New
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const polyPatch& pp
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~transmissivityModel();
|
virtual ~wallTransmissivityModel() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return scatter coefficient
|
//- Return transmissivity
|
||||||
virtual tmp<volScalarField> tauEff(const label bandI = 0) const = 0;
|
virtual tmp<scalarField> t
|
||||||
|
(
|
||||||
|
const label bandI = 0,
|
||||||
|
vectorField* incomingDirection = nullptr,
|
||||||
|
scalarField* T = nullptr
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Return transmissivity on face
|
||||||
|
virtual scalar t
|
||||||
|
(
|
||||||
|
const label faceI,
|
||||||
|
const label bandI = 0,
|
||||||
|
const vector dir = Zero,
|
||||||
|
const scalar T = 0
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
//- Is Grey
|
//- Is Grey
|
||||||
virtual bool isGrey() const = 0;
|
virtual bool isGrey() const = 0;
|
||||||
|
|
||||||
//- Number of bands
|
//- Number of bands
|
||||||
virtual label nBands() const = 0;
|
virtual label nBands() const = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,34 +24,32 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
#include "transmissivityModel.H"
|
#include "wallTransmissivityModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::autoPtr<Foam::radiation::transmissivityModel> Foam::radiation::
|
Foam::autoPtr<Foam::radiation::wallTransmissivityModel> Foam::radiation::
|
||||||
transmissivityModel::New
|
wallTransmissivityModel::New
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const polyPatch& pp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word modelType(dict.get<word>("transmissivityModel"));
|
const word modelType(dict.get<word>("wallTransmissivityModel"));
|
||||||
|
|
||||||
Info<< "Selecting transmissivityModel " << modelType << endl;
|
|
||||||
|
|
||||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||||
|
|
||||||
if (!cstrIter.found())
|
if (!cstrIter.found())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown transmissivityModel type "
|
<< "Unknown wallTransmissivityModel type "
|
||||||
<< modelType << nl << nl
|
<< modelType << nl << nl
|
||||||
<< "Valid transmissivityModel types :" << nl
|
<< "Valid wallTransmissivityModel types :" << nl
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<transmissivityModel>(cstrIter()(dict, mesh));
|
return autoPtr<wallTransmissivityModel>(cstrIter()(dict, pp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
55
tutorials/basic/potentialFoam/cylinder/0/U
Normal file
55
tutorials/basic/potentialFoam/cylinder/0/U
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
down
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
up
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type uniformFixedValue;
|
||||||
|
uniformValue constant (1 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
cylinder
|
||||||
|
{
|
||||||
|
type symmetry;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
55
tutorials/basic/potentialFoam/cylinder/0/p
Normal file
55
tutorials/basic/potentialFoam/cylinder/0/p
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
down
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
up
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
cylinder
|
||||||
|
{
|
||||||
|
type symmetry;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -17,16 +17,16 @@ FoamFile
|
|||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 0.8;
|
emissivity 0.8;
|
||||||
absorptivity 0.0;
|
absorptivity 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 0.9;
|
emissivity 0.9;
|
||||||
absorptivity 0.0;
|
absorptivity 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,6 @@ radiationModel opaqueSolid;
|
|||||||
|
|
||||||
absorptionEmissionModel none;
|
absorptionEmissionModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
scatterModel none;
|
scatterModel none;
|
||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|||||||
@ -187,6 +187,4 @@ scatterModel none;
|
|||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -18,12 +18,16 @@ FoamFile
|
|||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
region0_to_pyrolysisRegion_coupledWall
|
||||||
{
|
{
|
||||||
mode solidRadiation;
|
type opaqueDiffusive;
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type solidAbsorption;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
absorptivity 1.0;
|
absorptivity 1.0;
|
||||||
transmissivity 0.0;
|
transmissivity 0.0;
|
||||||
|
|||||||
@ -37,6 +37,5 @@ greyMeanSolidAbsorptionEmissionCoeffs
|
|||||||
|
|
||||||
scatterModel none;
|
scatterModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -52,7 +52,5 @@ scatterModel none;
|
|||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -18,15 +18,17 @@ FoamFile
|
|||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
type boundaryRadiation;
|
type lookup;
|
||||||
mode lookup;
|
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(region0_to.*)"
|
"(region0_to.*)"
|
||||||
{
|
{
|
||||||
type boundaryRadiation;
|
type opaqueDiffusive;
|
||||||
mode solidRadiation;
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type solidAbsorption;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,4 @@ greyMeanSolidAbsorptionEmissionCoeffs
|
|||||||
|
|
||||||
scatterModel none;
|
scatterModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -189,6 +189,4 @@ scatterModel none;
|
|||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,5 @@ greyMeanSolidAbsorptionEmissionCoeffs
|
|||||||
}
|
}
|
||||||
|
|
||||||
scatterModel none;
|
scatterModel none;
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -30,6 +30,5 @@ P1Coeffs
|
|||||||
|
|
||||||
scatterModel none;
|
scatterModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -17,25 +17,25 @@ FoamFile
|
|||||||
|
|
||||||
base
|
base
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sides
|
sides
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -194,7 +194,5 @@ mixtureFractionSootCoeffs
|
|||||||
Wsoot 12;
|
Wsoot 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -17,9 +17,8 @@ FoamFile
|
|||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
absorptivity 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -188,7 +188,5 @@ scatterModel none;
|
|||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
absorptivity 1.0;
|
absorptivity 1.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,4 @@ scatterModel none;
|
|||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
absorptivity 1.0;
|
absorptivity 1.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,4 @@ scatterModel none;
|
|||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
mode lookup;
|
type lookup;
|
||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
absorptivity 1.0;
|
absorptivity 1.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,10 +21,10 @@ radiationModel fvDOM;
|
|||||||
|
|
||||||
fvDOMCoeffs
|
fvDOMCoeffs
|
||||||
{
|
{
|
||||||
nPhi 3; // azimuthal angles in PI/2 on X-Y.(from Y to X)
|
nPhi 3;
|
||||||
nTheta 5; // polar angles in PI (from Z to X-Y plane)
|
nTheta 5;
|
||||||
maxIter 10; // maximum number of iterations
|
tolerance 1e-3;
|
||||||
tolerance 1e-3; // convergence criteria for radiation iteration
|
maxIter 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of flow iterations per radiation iteration
|
// Number of flow iterations per radiation iteration
|
||||||
@ -43,6 +43,5 @@ scatterModel none;
|
|||||||
|
|
||||||
sootModel none;
|
sootModel none;
|
||||||
|
|
||||||
transmissivityModel none;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -0,0 +1,39 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
"(solarpanel.*|ref_wall|ZMin)"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(YMax|YMin|XMax|XMin|ZMax)"
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue $internalField;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "0";
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0.1 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
|
"(solarpanel.*|ref_wall|YMax|YMin|XMax|XMin|ZMin)"
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
ZMax
|
||||||
|
{
|
||||||
|
type pressureInletOutletVelocity;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 101325;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object p_rgh;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 101325;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
|
"(solarpanel.*|ref_wall|YMax|YMin|XMax|XMin|ZMin)"
|
||||||
|
{
|
||||||
|
type fixedFluxPressure;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
ZMax
|
||||||
|
{
|
||||||
|
type prghTotalPressure;
|
||||||
|
p0 $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
8
tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allclean
Executable file
8
tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allclean
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
|
|
||||||
|
cleanCase0
|
||||||
|
rm -rf constant/extendedFeatureEdgeMesh
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
15
tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allrun
Executable file
15
tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allrun
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
restore0Dir
|
||||||
|
|
||||||
|
runApplication surfaceFeatureExtract
|
||||||
|
|
||||||
|
runApplication snappyHexMesh -overwrite
|
||||||
|
|
||||||
|
runApplication $(getApplication)
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object boundaryRadiationProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type transparent;
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
emissivity (1 1);
|
||||||
|
absorptivity (0 0);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
body_bottom
|
||||||
|
{
|
||||||
|
type opaqueDiffusive;
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.3 0.7);
|
||||||
|
emissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
"(solarpanel.*)"
|
||||||
|
{
|
||||||
|
type opaqueDiffusive;
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.3 0.7);
|
||||||
|
emissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
ref_wall
|
||||||
|
{
|
||||||
|
type opaqueReflective;
|
||||||
|
|
||||||
|
// Fraction of the reflected is diffussive
|
||||||
|
fd 0.0; // 0: all specular 1: all diffusive
|
||||||
|
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.03 0.07);
|
||||||
|
emissivity (0.03 0.07);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
ZMin
|
||||||
|
{
|
||||||
|
type opaqueDiffusive;
|
||||||
|
wallAbsorptionEmissionModel
|
||||||
|
{
|
||||||
|
type multiBandAbsorption;
|
||||||
|
absorptivity (0.3 0.7);
|
||||||
|
emissivity (0.3 0.7);
|
||||||
|
};
|
||||||
|
}
|
||||||
21
tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/g
Executable file
21
tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/g
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class uniformDimensionedVectorField;
|
||||||
|
location "constant";
|
||||||
|
object g;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -2 0 0 0 0];
|
||||||
|
|
||||||
|
value (0 0 -9.81);
|
||||||
|
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object radiationProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
radiation on;
|
||||||
|
|
||||||
|
radiationModel solarLoad;
|
||||||
|
|
||||||
|
solarLoadCoeffs
|
||||||
|
{
|
||||||
|
sunDirectionModel sunDirConstant;
|
||||||
|
|
||||||
|
skyCloudCoverFraction 0;
|
||||||
|
|
||||||
|
sunDirection (-1 0.7 -1.5);
|
||||||
|
|
||||||
|
localStandardMeridian -8; // GMT offset (hours)
|
||||||
|
startDay 22; // day of the year
|
||||||
|
startTime 10; // time of the day (hours decimal)
|
||||||
|
|
||||||
|
longitude -118.243683; // longitude (degrees)
|
||||||
|
latitude 34.052235; // latitude (degrees)
|
||||||
|
|
||||||
|
// Grid orientation
|
||||||
|
gridUp (0 0 1);
|
||||||
|
gridEast (0 1 0);
|
||||||
|
|
||||||
|
// Energy spectrum
|
||||||
|
spectralDistribution (2 1);
|
||||||
|
|
||||||
|
// Solar model:
|
||||||
|
// sunLoadConstant-sunLoadFairWeatherConditions-SunLoadTheoreticalMaximum;
|
||||||
|
sunLoadModel sunLoadFairWeatherConditions;
|
||||||
|
|
||||||
|
// Sun load constant model
|
||||||
|
//directSolarRad 500;
|
||||||
|
//diffuseSolarRad 40;
|
||||||
|
|
||||||
|
// Fair Weather Conditions Model Constants.
|
||||||
|
// Calculate beta from the Solar calculator or input
|
||||||
|
A 2229.78119355; // Apparent solar irradiation at air mass m = 0
|
||||||
|
B 0.142064516129; // Atmospheric extinction coefficient
|
||||||
|
|
||||||
|
//beta 45; // Solar altitude (in degrees) above the horizontal
|
||||||
|
|
||||||
|
// Theoretical maximum model constants
|
||||||
|
//Setrn 10;
|
||||||
|
//SunPrime 1;
|
||||||
|
|
||||||
|
// Ground reflectivity
|
||||||
|
groundReflectivity 0.2;
|
||||||
|
|
||||||
|
// Solar diffusivity constants
|
||||||
|
C 0.058064516129; // Model constant
|
||||||
|
|
||||||
|
// Radiative flux coupling flags
|
||||||
|
solidCoupled false; // Couple through Qr the solid regions (default true)
|
||||||
|
wallCoupled true; // Couple through Qr wall patches (default false)
|
||||||
|
|
||||||
|
// Reflecting rays
|
||||||
|
useReflectedRays true;
|
||||||
|
reflecting
|
||||||
|
{
|
||||||
|
nPhi 10;
|
||||||
|
nTheta 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
absorptionEmissionModel none;
|
||||||
|
scatterModel none;
|
||||||
|
sootModel none;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Number of flow iterations per radiation iteration
|
||||||
|
solverFreq 1;
|
||||||
|
|
||||||
|
absorptionEmissionModel none;
|
||||||
|
|
||||||
|
scatterModel none;
|
||||||
|
|
||||||
|
sootModel none;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object thermophysicalProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
thermoType
|
||||||
|
{
|
||||||
|
type heRhoThermo;
|
||||||
|
mixture pureMixture;
|
||||||
|
transport const;
|
||||||
|
thermo hConst;
|
||||||
|
equationOfState perfectGas;
|
||||||
|
specie specie;
|
||||||
|
energy sensibleEnthalpy;
|
||||||
|
}
|
||||||
|
|
||||||
|
mixture
|
||||||
|
{
|
||||||
|
|
||||||
|
specie
|
||||||
|
{
|
||||||
|
molWeight 28.966;
|
||||||
|
}
|
||||||
|
|
||||||
|
thermodynamics
|
||||||
|
{
|
||||||
|
Cp 1006.43;
|
||||||
|
Hf 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
transport
|
||||||
|
{
|
||||||
|
mu 1.846e-05;
|
||||||
|
Pr 0.706414;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,20 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
simulationType laminar;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
X_MIN_TUNNEL -1.84;
|
||||||
|
Y_MIN_TUNNEL -2.1;
|
||||||
|
Z_MIN_TUNNEL -3.0616171e-17;
|
||||||
|
X_MAX_TUNNEL 1.085;
|
||||||
|
Y_MAX_TUNNEL 2.4;
|
||||||
|
Z_MAX_TUNNEL 3.25;
|
||||||
|
NCELLS_X 11;
|
||||||
|
NCELLS_Y 17;
|
||||||
|
NCELLS_Z 12;
|
||||||
|
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
( $X_MIN_TUNNEL $Y_MIN_TUNNEL $Z_MIN_TUNNEL ) //Node 0
|
||||||
|
( $X_MAX_TUNNEL $Y_MIN_TUNNEL $Z_MIN_TUNNEL ) //Node 1
|
||||||
|
( $X_MAX_TUNNEL $Y_MAX_TUNNEL $Z_MIN_TUNNEL ) //Node 2
|
||||||
|
( $X_MIN_TUNNEL $Y_MAX_TUNNEL $Z_MIN_TUNNEL ) //Node 3
|
||||||
|
( $X_MIN_TUNNEL $Y_MIN_TUNNEL $Z_MAX_TUNNEL ) //Node 4
|
||||||
|
( $X_MAX_TUNNEL $Y_MIN_TUNNEL $Z_MAX_TUNNEL ) //Node 5
|
||||||
|
( $X_MAX_TUNNEL $Y_MAX_TUNNEL $Z_MAX_TUNNEL ) //Node 6
|
||||||
|
( $X_MIN_TUNNEL $Y_MAX_TUNNEL $Z_MAX_TUNNEL ) //Node 7
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) ( $NCELLS_X $NCELLS_Y $NCELLS_Z)
|
||||||
|
simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
XMin
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
XMax
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 2 6 5)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
YMin
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 1 5 4)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
YMax
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
ZMin
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
ZMax
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(4 5 6 7)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1806 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application buoyantSimpleFoam;
|
||||||
|
|
||||||
|
startFrom startTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 50;
|
||||||
|
|
||||||
|
deltaT 1;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 5;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user