diff --git a/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H b/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H index 8c94f372e245376133ee658e950e21b702f92a37..df38326ded081fc52a391c42f5cf01212e5e3568 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H +++ b/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H @@ -23,21 +23,6 @@ dict.add ); dict.add("mergeDistance", SMALL); -labelHashSet includePatches; -forAll(patches, patchI) -{ - const polyPatch& pp = patches[patchI]; - if - ( - !pp.coupled() - && !isA<cyclicAMIPolyPatch>(pp) - && !isA<emptyPolyPatch>(pp) - ) - { - includePatches.insert(patchI); - } -} - labelList triSurfaceToAgglom(5*nFineFaces); const triSurface localSurface = triangulate @@ -69,6 +54,4 @@ distributedTriSurfaceMesh surfacesMesh triSurfaceToAgglom.resize(surfacesMesh.size()); -//surfacesMesh.searchableSurface::write(); - surfacesMesh.setField(triSurfaceToAgglom); diff --git a/applications/utilities/preProcessing/viewFactorsGen/shootRays.H b/applications/utilities/preProcessing/viewFactorsGen/shootRays.H index 18888ff01fb26d4f6c93ea459b24086b6af1758e..973c1cb94604bdaebd33015fbb682245b5961bb1 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/shootRays.H +++ b/applications/utilities/preProcessing/viewFactorsGen/shootRays.H @@ -87,8 +87,8 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++) DynamicList<label> dRayIs; - // Collect the rays which has not hit obstacle inbetween rayStartFace - // and rayEndFace. If the ray hit itself get stored in dRayIs + // Collect the rays which have no obstacle in between rayStartFace + // and rayEndFace. If the ray hit itself, it gets stored in dRayIs forAll(hitInfo, rayI) { if (!hitInfo[rayI].hit()) diff --git a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C index bccf381ba15eaeb6d4f048fdd182ecf67326979b..ee7f6475b8c7a7a75f332c1a8ab0af68f7c381f5 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C +++ b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C @@ -29,33 +29,42 @@ Description (finalAgglom generated by faceAgglomerate utility). Each view factor between the agglomerated faces i and j (Fij) is calculated - using a double integral of the sub-areas composing the agglomaration. + using a double integral of the sub-areas composing the agglomeration. - The patches involved in the view factor calculation are taken from the Qr - volScalarField (radiative flux) when is greyDiffusiveRadiationViewFactor - otherwise they are not included. + The patches involved in the view factor calculation are taken from the + boundary file and should be part on the group viewFactorWall. ie.: + + floor + { + type wall; + inGroups 2(wall viewFactorWall); + nFaces 100; + startFace 3100; + } \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "Time.H" #include "fvMesh.H" -#include "singleCellFvMesh.H" #include "volFields.H" #include "surfaceFields.H" -#include "fixedValueFvPatchFields.H" #include "distributedTriSurfaceMesh.H" -#include "cyclicAMIPolyPatch.H" -#include "mapDistribute.H" #include "meshTools.H" + #include "uindirectPrimitivePatch.H" #include "DynamicField.H" +#include "unitConversion.H" + #include "scalarMatrices.H" +#include "labelListIOList.H" #include "scalarListIOList.H" +#include "singleCellFvMesh.H" + +#include "IOmapDistribute.H" + using namespace Foam; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // triSurface triangulate ( @@ -116,7 +125,7 @@ triSurface triangulate newPatchI++; } - triSurfaceToAgglom.resize(localTriFaceI); + //striSurfaceToAgglom.resize(localTriFaceI-1); triangles.shrink(); @@ -209,7 +218,7 @@ scalar calculateViewFactorFij return ( (cosThetaI*cosThetaJ*dAjMag*dAiMag) - /(sqr(rMag)*constant::mathematical::pi) + /(sqr(rMag)*constant::mathematical::pi) ); } else @@ -264,6 +273,8 @@ int main(int argc, char *argv[]) ) ); + const word viewFactorWall("viewFactorWall"); + const bool writeViewFactors = viewFactorDict.lookupOrDefault<bool>("writeViewFactorMatrix", false); @@ -272,19 +283,6 @@ int main(int argc, char *argv[]) const label debug = viewFactorDict.lookupOrDefault<label>("debug", 0); - volScalarField Qr - ( - IOobject - ( - "Qr", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ), - mesh - ); - // Read agglomeration map labelListIOList finalAgglom ( @@ -336,27 +334,14 @@ int main(int argc, char *argv[]) const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& coarsePatches = coarseMesh.boundaryMesh(); - labelList viewFactorsPatches(patches.size()); - - const volScalarField::GeometricBoundaryField& Qrb = Qr.boundaryField(); - - label count = 0; - forAll(Qrb, patchI) + labelList viewFactorsPatches(patches.findIndices(viewFactorWall)); + forAll (viewFactorsPatches, i) { - const polyPatch& pp = patches[patchI]; - const fvPatchScalarField& QrpI = Qrb[patchI]; - - if ((isA<fixedValueFvPatchScalarField>(QrpI)) && (pp.size() > 0)) - { - viewFactorsPatches[count] = QrpI.patch().index(); - nCoarseFaces += coarsePatches[patchI].size(); - nFineFaces += patches[patchI].size(); - count ++; - } + label patchI = viewFactorsPatches[i]; + nCoarseFaces += coarsePatches[patchI].size(); + nFineFaces += patches[patchI].size(); } - viewFactorsPatches.resize(count); - // total number of coarse faces label totalNCoarseFaces = nCoarseFaces; @@ -381,78 +366,85 @@ int main(int argc, char *argv[]) DynamicList<label> localAgg(nCoarseFaces); - forAll (viewFactorsPatches, i) + labelHashSet includePatches; + forAll(viewFactorsPatches, i) { const label patchID = viewFactorsPatches[i]; const polyPatch& pp = patches[patchID]; const labelList& agglom = finalAgglom[patchID]; - label nAgglom = max(agglom)+1; - labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); - const labelList& coarsePatchFace = coarseMesh.patchFaceMap()[patchID]; - - const pointField& coarseCf = coarseMesh.Cf().boundaryField()[patchID]; - const pointField& coarseSf = coarseMesh.Sf().boundaryField()[patchID]; - labelHashSet includePatches; includePatches.insert(patchID); - forAll(coarseCf, faceI) + if (agglom.size() > 0) { - point cf = coarseCf[faceI]; + label nAgglom = max(agglom)+1; + labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); + const labelList& coarsePatchFace = + coarseMesh.patchFaceMap()[patchID]; - const label coarseFaceI = coarsePatchFace[faceI]; - const labelList& fineFaces = coarseToFine[coarseFaceI]; - const label agglomI = - agglom[fineFaces[0]] + coarsePatches[patchID].start(); + const pointField& coarseCf = + coarseMesh.Cf().boundaryField()[patchID]; + const pointField& coarseSf = + coarseMesh.Sf().boundaryField()[patchID]; - // Construct single face - uindirectPrimitivePatch upp - ( - UIndirectList<face>(pp, fineFaces), - pp.points() - ); + forAll(coarseCf, faceI) + { + point cf = coarseCf[faceI]; + const label coarseFaceI = coarsePatchFace[faceI]; + const labelList& fineFaces = coarseToFine[coarseFaceI]; + const label agglomI = + agglom[fineFaces[0]] + coarsePatches[patchID].start(); - List<point> availablePoints - ( - upp.faceCentres().size() - + upp.localPoints().size() - ); + // Construct single face + uindirectPrimitivePatch upp + ( + UIndirectList<face>(pp, fineFaces), + pp.points() + ); - SubList<point> - ( - availablePoints, - upp.faceCentres().size() - ).assign(upp.faceCentres()); - SubList<point> - ( - availablePoints, - upp.localPoints().size(), - upp.faceCentres().size() - ).assign(upp.localPoints()); - - point cfo = cf; - scalar dist = GREAT; - forAll(availablePoints, iPoint) - { - point cfFine = availablePoints[iPoint]; - if (mag(cfFine-cfo) < dist) + List<point> availablePoints + ( + upp.faceCentres().size() + + upp.localPoints().size() + ); + + SubList<point> + ( + availablePoints, + upp.faceCentres().size() + ).assign(upp.faceCentres()); + + SubList<point> + ( + availablePoints, + upp.localPoints().size(), + upp.faceCentres().size() + ).assign(upp.localPoints()); + + point cfo = cf; + scalar dist = GREAT; + forAll(availablePoints, iPoint) { - dist = mag(cfFine-cfo); - cf = cfFine; + point cfFine = availablePoints[iPoint]; + if (mag(cfFine-cfo) < dist) + { + dist = mag(cfFine-cfo); + cf = cfFine; + } } - } - point sf = coarseSf[faceI]; - localCoarseCf.append(cf); - localCoarseSf.append(sf); - localAgg.append(agglomI); + point sf = coarseSf[faceI]; + localCoarseCf.append(cf); + localCoarseSf.append(sf); + localAgg.append(agglomI); + + } } } - // Distribute local coarse Cf and Sf for shooting rays // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -478,7 +470,6 @@ int main(int argc, char *argv[]) // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include "searchingEngine.H" - // Determine rays between coarse face centres // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DynamicList<label> rayStartFace(nCoarseFaces + 0.01*nCoarseFaces); @@ -486,8 +477,8 @@ int main(int argc, char *argv[]) DynamicList<label> rayEndFace(rayStartFace.size()); - // Return rayStartFace in local index andrayEndFace in global index - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Return rayStartFace in local index and rayEndFace in global index + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include "shootRays.H" @@ -508,7 +499,6 @@ int main(int argc, char *argv[]) nViewFactors += nVisibleFaceFaces[faceI]; } - // - Construct compact numbering // - return map from remote to compact indices // (per processor (!= myProcNo) a map from remote index to compact index) @@ -519,54 +509,6 @@ int main(int argc, char *argv[]) mapDistribute map(globalNumbering, rayEndFace, compactMap); - labelListIOList IOsubMap - ( - IOobject - ( - "subMap", - mesh.facesInstance(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - map.subMap() - ); - IOsubMap.write(); - - - labelListIOList IOconstructMap - ( - IOobject - ( - "constructMap", - mesh.facesInstance(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - map.constructMap() - ); - IOconstructMap.write(); - - - IOList<label> consMapDim - ( - IOobject - ( - "constructMapDim", - mesh.facesInstance(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - List<label>(1, map.constructSize()) - ); - consMapDim.write(); - - // visibleFaceFaces has: // (local face, local viewed face) = compact viewed face // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -600,33 +542,38 @@ int main(int argc, char *argv[]) forAll(viewFactorsPatches, i) { label patchID = viewFactorsPatches[i]; - const labelList& agglom = finalAgglom[patchID]; - label nAgglom = max(agglom)+1; - labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); - const labelList& coarsePatchFace = coarseMesh.patchFaceMap()[patchID]; - forAll(coarseToFine, coarseI) + const labelList& agglom = finalAgglom[patchID]; + if (agglom.size() > 0) { - compactPatchId.append(patchID); - List<point>& fineCf = compactFineCf[compactI]; - List<point>& fineSf = compactFineSf[compactI++]; + label nAgglom = max(agglom)+1; + labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); + const labelList& coarsePatchFace = + coarseMesh.patchFaceMap()[patchID]; - const label coarseFaceI = coarsePatchFace[coarseI]; - const labelList& fineFaces = coarseToFine[coarseFaceI]; + forAll(coarseToFine, coarseI) + { + compactPatchId.append(patchID); + List<point>& fineCf = compactFineCf[compactI]; + List<point>& fineSf = compactFineSf[compactI++]; - fineCf.setSize(fineFaces.size()); - fineSf.setSize(fineFaces.size()); + const label coarseFaceI = coarsePatchFace[coarseI]; + const labelList& fineFaces = coarseToFine[coarseFaceI]; - fineCf = UIndirectList<point> - ( - mesh.Cf().boundaryField()[patchID], - coarseToFine[coarseFaceI] - ); - fineSf = UIndirectList<point> - ( - mesh.Sf().boundaryField()[patchID], - coarseToFine[coarseFaceI] - ); + fineCf.setSize(fineFaces.size()); + fineSf.setSize(fineFaces.size()); + + fineCf = UIndirectList<point> + ( + mesh.Cf().boundaryField()[patchID], + coarseToFine[coarseFaceI] + ); + fineSf = UIndirectList<point> + ( + mesh.Sf().boundaryField()[patchID], + coarseToFine[coarseFaceI] + ); + } } } @@ -837,22 +784,25 @@ int main(int argc, char *argv[]) { label patchID = viewFactorsPatches[i]; const labelList& agglom = finalAgglom[patchID]; - label nAgglom = max(agglom)+1; - labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); - const labelList& coarsePatchFace = - coarseMesh.patchFaceMap()[patchID]; - - forAll(coarseToFine, coarseI) + if (agglom.size() > 0) { - const scalar Fij = sum(F[compactI]); - const label coarseFaceID = coarsePatchFace[coarseI]; - const labelList& fineFaces = coarseToFine[coarseFaceID]; - forAll (fineFaces, fineId) + label nAgglom = max(agglom)+1; + labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); + const labelList& coarsePatchFace = + coarseMesh.patchFaceMap()[patchID]; + + forAll(coarseToFine, coarseI) { - const label faceID = fineFaces[fineId]; - viewFactorField.boundaryField()[patchID][faceID] = Fij; + const scalar Fij = sum(F[compactI]); + const label coarseFaceID = coarsePatchFace[coarseI]; + const labelList& fineFaces = coarseToFine[coarseFaceID]; + forAll (fineFaces, fineId) + { + const label faceID = fineFaces[fineId]; + viewFactorField.boundaryField()[patchID][faceID] = Fij; + } + compactI++; } - compactI++; } } viewFactorField.write(); @@ -886,66 +836,64 @@ int main(int argc, char *argv[]) } - if (Pstream::master()) + labelListList globalFaceFaces(visibleFaceFaces.size()); + + // Create globalFaceFaces needed to insert view factors + // in F to the global matrix Fmatrix + forAll(globalFaceFaces, faceI) { - scalarSquareMatrix Fmatrix(totalNCoarseFaces, totalNCoarseFaces, 0.0); + globalFaceFaces[faceI] = renumber + ( + compactToGlobal, + visibleFaceFaces[faceI] + ); + } - labelListList globalFaceFaces(visibleFaceFaces.size()); + labelListIOList IOglobalFaceFaces + ( + IOobject + ( + "globalFaceFaces", + mesh.facesInstance(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + globalFaceFaces + ); + IOglobalFaceFaces.write(); - // Create globalFaceFaces needed to insert view factors - // in F to the global matrix Fmatrix - forAll(globalFaceFaces, faceI) - { - globalFaceFaces[faceI] = renumber - ( - compactToGlobal, - visibleFaceFaces[faceI] - ); - } - labelListIOList IOglobalFaceFaces + labelListIOList IOvisibleFaceFaces + ( + IOobject ( - IOobject - ( - "globalFaceFaces", - mesh.facesInstance(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - globalFaceFaces - ); - IOglobalFaceFaces.write(); - } - else - { - labelListList globalFaceFaces(visibleFaceFaces.size()); - forAll(globalFaceFaces, faceI) - { - globalFaceFaces[faceI] = renumber - ( - compactToGlobal, - visibleFaceFaces[faceI] - ); - } + "visibleFaceFaces", + mesh.facesInstance(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + visibleFaceFaces + ); + IOvisibleFaceFaces.write(); - labelListIOList IOglobalFaceFaces + IOmapDistribute IOmapDist + ( + IOobject ( - IOobject - ( - "globalFaceFaces", - mesh.facesInstance(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - globalFaceFaces - ); + "mapDist", + mesh.facesInstance(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + map.xfer() + ); - IOglobalFaceFaces.write(); - } + IOmapDist.write(); Info<< "End\n" << endl; return 0; diff --git a/src/thermophysicalModels/radiation/Make/files b/src/thermophysicalModels/radiation/Make/files index 5f520b2dcd2f65a398a0e68a6d60d156d581f437..ef6e105719bb0306bbf766443ac247876f97cba4 100644 --- a/src/thermophysicalModels/radiation/Make/files +++ b/src/thermophysicalModels/radiation/Make/files @@ -9,6 +9,8 @@ radiationModels/fvDOM/blackBodyEmission/blackBodyEmission.C radiationModels/fvDOM/absorptionCoeffs/absorptionCoeffs.C radiationModels/viewFactor/viewFactor.C radiationModels/opaqueSolid/opaqueSolid.C +radiationModels/solarLoad/solarLoad.C +radiationModels/solarLoad/faceShading/faceShading.C /* Scatter model */ submodels/scatterModel/scatterModel/scatterModel.C @@ -25,6 +27,8 @@ submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmiss submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C +submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.C +submodels/boundaryRadiationProperties/boundaryRadiationProperties.C /* Soot model */ submodels/sootModel/sootModel/sootModel.C @@ -32,12 +36,22 @@ submodels/sootModel/sootModel/sootModelNew.C submodels/sootModel/mixtureFractionSoot/mixtureFractionSoots.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 */ +submodels/solarCalculator/solarCalculator.C + /* Boundary conditions */ derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C -derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C +derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.C LIB = $(FOAM_LIBBIN)/libradiationModels diff --git a/src/thermophysicalModels/radiation/Make/options b/src/thermophysicalModels/radiation/Make/options index 726b76e76442077c0a0c4f77334e54d9bfe6a6ad..8b4db40a1533130ea3afeac29c83177a6d368e3a 100644 --- a/src/thermophysicalModels/radiation/Make/options +++ b/src/thermophysicalModels/radiation/Make/options @@ -10,7 +10,9 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/parallel/distributed/lnInclude LIB_LIBS = \ -lcompressibleTransportModels \ @@ -23,4 +25,6 @@ LIB_LIBS = \ -lsolidProperties \ -lliquidProperties \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -ldistributed \ + -ltriSurface diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C index dbe62c4a6d099f8fd30c3585282dbba75367ef22..935d2884b88bccbd8744e66866d7baf171cfc966 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C @@ -29,17 +29,18 @@ License #include "volFields.H" #include "radiationModel.H" #include "physicoChemicalConstants.H" +#include "boundaryRadiationProperties.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField +Foam::radiation::MarshakRadiationFvPatchScalarField:: +MarshakRadiationFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF ) : mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, "undefined", scalarField::null()), TName_("T") { refValue() = 0.0; @@ -48,7 +49,8 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField } -Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField +Foam::radiation::MarshakRadiationFvPatchScalarField:: +MarshakRadiationFvPatchScalarField ( const MarshakRadiationFvPatchScalarField& ptf, const fvPatch& p, @@ -57,18 +59,12 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField ) : mixedFvPatchScalarField(ptf, p, iF, mapper), - radiationCoupledBase - ( - p, - ptf.emissivityMethod(), - ptf.emissivity_, - mapper - ), TName_(ptf.TName_) {} -Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField +Foam::radiation::MarshakRadiationFvPatchScalarField:: +MarshakRadiationFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -76,7 +72,6 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, dict), TName_(dict.lookupOrDefault<word>("T", "T")) { if (dict.found("value")) @@ -97,63 +92,51 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField } -Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField +Foam::radiation::MarshakRadiationFvPatchScalarField:: +MarshakRadiationFvPatchScalarField ( const MarshakRadiationFvPatchScalarField& ptf ) : mixedFvPatchScalarField(ptf), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), TName_(ptf.TName_) {} -Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField +Foam::radiation::MarshakRadiationFvPatchScalarField:: +MarshakRadiationFvPatchScalarField ( const MarshakRadiationFvPatchScalarField& ptf, const DimensionedField<scalar, volMesh>& iF ) : mixedFvPatchScalarField(ptf, iF), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), TName_(ptf.TName_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::MarshakRadiationFvPatchScalarField::autoMap +void Foam::radiation::MarshakRadiationFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) { - mixedFvPatchScalarField::autoMap(m); - radiationCoupledBase::autoMap(m); + scalarField::autoMap(m); } -void Foam::MarshakRadiationFvPatchScalarField::rmap +void Foam::radiation::MarshakRadiationFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr ) { mixedFvPatchScalarField::rmap(ptf, addr); - radiationCoupledBase::rmap(ptf, addr); } -void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs() +void Foam::radiation::MarshakRadiationFvPatchScalarField::updateCoeffs() { if (this->updated()) { @@ -176,9 +159,17 @@ void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs() const scalarField& gamma = patch().lookupPatchField<volScalarField, scalar>("gammaRad"); - const scalarField temissivity = emissivity(); + const boundaryRadiationProperties& boundaryRadiation = + boundaryRadiationProperties::New(dimensionedInternalField().mesh()); + + const tmp<scalarField> temissivity + ( + boundaryRadiation.emissivity(patch().index()) + ); - const scalarField Ep(temissivity/(2.0*(2.0 - temissivity))); + const scalarField& emissivity = temissivity(); + + const scalarField Ep(emissivity/(2.0*(scalar(2.0) - emissivity))); // Set value fraction valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep); @@ -190,10 +181,12 @@ void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs() } -void Foam::MarshakRadiationFvPatchScalarField::write(Ostream& os) const +void Foam::radiation::MarshakRadiationFvPatchScalarField::write +( + Ostream& os +) const { mixedFvPatchScalarField::write(os); - radiationCoupledBase::write(os); writeEntryIfDifferent<word>(os, "T", "T", TName_); } @@ -201,6 +194,8 @@ void Foam::MarshakRadiationFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam +{ +namespace radiation { makePatchTypeField ( @@ -208,6 +203,6 @@ namespace Foam MarshakRadiationFvPatchScalarField ); } - +} // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H index a43a295fcda605eec8bec4fa2d319100cf544d24..9a6f9a8f6b2bcb2bae0969d33c8e20720db6c9bb 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H @@ -64,12 +64,13 @@ SourceFiles #define MarshakRadiationMixedFvPatchField_H #include "mixedFvPatchFields.H" -#include "radiationCoupledBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +namespace radiation +{ /*---------------------------------------------------------------------------*\ Class MarshakRadiationFvPatchScalarField Declaration @@ -77,8 +78,7 @@ namespace Foam class MarshakRadiationFvPatchScalarField : - public mixedFvPatchScalarField, - public radiationCoupledBase + public mixedFvPatchScalarField { // Private data @@ -204,6 +204,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace radiation } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C index b55812ace17bde40b53a14aaece424055ce2994f..99e61bc5245c614d386834f228ed90c3f4222c1d 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C @@ -29,10 +29,11 @@ License #include "volFields.H" #include "radiationModel.H" #include "physicoChemicalConstants.H" +#include "boundaryRadiationProperties.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::MarshakRadiationFixedTemperatureFvPatchScalarField:: +Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField:: MarshakRadiationFixedTemperatureFvPatchScalarField ( const fvPatch& p, @@ -40,7 +41,6 @@ MarshakRadiationFixedTemperatureFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, "undefined", scalarField::null()), Trad_(p.size()) { refValue() = 0.0; @@ -49,7 +49,7 @@ MarshakRadiationFixedTemperatureFvPatchScalarField } -Foam::MarshakRadiationFixedTemperatureFvPatchScalarField:: +Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField:: MarshakRadiationFixedTemperatureFvPatchScalarField ( const MarshakRadiationFixedTemperatureFvPatchScalarField& ptf, @@ -59,18 +59,11 @@ MarshakRadiationFixedTemperatureFvPatchScalarField ) : mixedFvPatchScalarField(ptf, p, iF, mapper), - radiationCoupledBase - ( - p, - ptf.emissivityMethod(), - ptf.emissivity_, - mapper - ), Trad_(ptf.Trad_, mapper) {} -Foam::MarshakRadiationFixedTemperatureFvPatchScalarField:: +Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField:: MarshakRadiationFixedTemperatureFvPatchScalarField ( const fvPatch& p, @@ -79,7 +72,6 @@ MarshakRadiationFixedTemperatureFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, dict), Trad_("Trad", dict, p.size()) { // refValue updated on each call to updateCoeffs() @@ -94,24 +86,18 @@ MarshakRadiationFixedTemperatureFvPatchScalarField } -Foam::MarshakRadiationFixedTemperatureFvPatchScalarField:: +Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField:: MarshakRadiationFixedTemperatureFvPatchScalarField ( const MarshakRadiationFixedTemperatureFvPatchScalarField& ptf ) : mixedFvPatchScalarField(ptf), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), Trad_(ptf.Trad_) {} -Foam::MarshakRadiationFixedTemperatureFvPatchScalarField:: +Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField:: MarshakRadiationFixedTemperatureFvPatchScalarField ( const MarshakRadiationFixedTemperatureFvPatchScalarField& ptf, @@ -119,37 +105,31 @@ MarshakRadiationFixedTemperatureFvPatchScalarField ) : mixedFvPatchScalarField(ptf, iF), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), Trad_(ptf.Trad_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::autoMap +void Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField:: +autoMap ( const fvPatchFieldMapper& m ) { mixedFvPatchScalarField::autoMap(m); - radiationCoupledBase::autoMap(m); Trad_.autoMap(m); } -void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::rmap +void Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr ) { mixedFvPatchScalarField::rmap(ptf, addr); - radiationCoupledBase::rmap(ptf, addr); + const MarshakRadiationFixedTemperatureFvPatchScalarField& mrptf = refCast<const MarshakRadiationFixedTemperatureFvPatchScalarField>(ptf); @@ -157,7 +137,8 @@ void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::rmap } -void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::updateCoeffs() +void Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField:: +updateCoeffs() { if (this->updated()) { @@ -176,9 +157,18 @@ void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::updateCoeffs() const scalarField& gamma = patch().lookupPatchField<volScalarField, scalar>("gammaRad"); - const scalarField temissivity = emissivity(); + //const scalarField temissivity = emissivity(); + const boundaryRadiationProperties& boundaryRadiation = + boundaryRadiationProperties::New(dimensionedInternalField().mesh()); - const scalarField Ep(temissivity/(2.0*(scalar(2.0) - temissivity))); + const tmp<scalarField> temissivity + ( + boundaryRadiation.emissivity(patch().index()) + ); + + const scalarField& emissivity = temissivity(); + + const scalarField Ep(emissivity/(2.0*(scalar(2.0) - emissivity))); // Set value fraction valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep); @@ -190,13 +180,12 @@ void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::updateCoeffs() } -void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::write +void Foam::radiation::MarshakRadiationFixedTemperatureFvPatchScalarField::write ( Ostream& os ) const { mixedFvPatchScalarField::write(os); - radiationCoupledBase::write(os); Trad_.writeEntry("Trad", os); } @@ -204,6 +193,8 @@ void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam +{ +namespace radiation { makePatchTypeField ( @@ -211,6 +202,6 @@ namespace Foam MarshakRadiationFixedTemperatureFvPatchScalarField ); } - +} // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H index c224f035ba3bdda9552ed6c72ca501acc864064b..57f7cbcc229cf418f00769550a545418e18cbacb 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H @@ -64,21 +64,21 @@ SourceFiles #define MarshakRadiationFixedTemperatureFvPatchScalarField_H #include "mixedFvPatchFields.H" -#include "radiationCoupledBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - +namespace radiation +{ /*---------------------------------------------------------------------------*\ Class MarshakRadiationFixedTemperatureFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class MarshakRadiationFixedTemperatureFvPatchScalarField : - public mixedFvPatchScalarField, - public radiationCoupledBase + public mixedFvPatchScalarField + //public radiationCoupledBase { // Private data @@ -208,6 +208,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace radiation } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.C new file mode 100644 index 0000000000000000000000000000000000000000..aa3e086e20ef374b0b48ae479bc49fdc8c2ae211 --- /dev/null +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.C @@ -0,0 +1,551 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "boundaryRadiationPropertiesFvPatchField.H" +#include "volFields.H" +#include "mappedPatchBase.H" +#include "fvPatchFieldMapper.H" +#include "radiationModel.H" +#include "absorptionEmissionModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // + +namespace Foam +{ + template<> + const char* Foam::NamedEnum + < + Foam::radiation::boundaryRadiationPropertiesFvPatchField::methodType, + 3 + >::names[] = + { + "solidRadiation", + "lookup", + "model" + }; +} + +const Foam::NamedEnum +< + Foam::radiation::boundaryRadiationPropertiesFvPatchField::methodType, + 3 +> Foam::radiation::boundaryRadiationPropertiesFvPatchField::methodTypeNames_; + + +// * * * * * * * * * * * * * * * * Private functions * * * * * * * * * * * * // + +Foam::label +Foam::radiation::boundaryRadiationPropertiesFvPatchField::nbrPatchIndex() const +{ + // Get the coupling information from the mappedPatchBase + const mappedPatchBase& mpp = + refCast<const mappedPatchBase>(patch().patch()); + + return (mpp.samplePolyPatch().index()); +} + + +const Foam::fvMesh& +Foam::radiation::boundaryRadiationPropertiesFvPatchField::nbrRegion() const +{ + const mappedPatchBase& mpp = + refCast<const mappedPatchBase>(patch().patch()); + + return (refCast<const fvMesh>(mpp.sampleMesh())); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + + +Foam::radiation::boundaryRadiationPropertiesFvPatchField:: +boundaryRadiationPropertiesFvPatchField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + calculatedFvPatchScalarField(p, iF), + method_(LOOKUP), + dict_(), + absorptionEmission_(NULL), + transmissivity_(NULL) +{} + + +Foam::radiation::boundaryRadiationPropertiesFvPatchField:: +boundaryRadiationPropertiesFvPatchField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + calculatedFvPatchScalarField(p, iF), + method_(methodTypeNames_.read(dict.lookup("mode"))), + dict_(dict), + absorptionEmission_(NULL), + transmissivity_(NULL) +{ + switch (method_) + { + case SOLIDRADIATION: + { + if (!isA<mappedPatchBase>(p.patch())) + { + FatalErrorInFunction + << "\n patch type '" << p.type() + << "' not type '" << mappedPatchBase::typeName << "'" + << "\n for patch " << p.name() + << abort(FatalIOError); + } + } + break; + + case MODEL: + { + const fvMesh& mesh = this->dimensionedInternalField().mesh(); + + //if (dict.found("absorptionEmissionModel")) + { + absorptionEmission_.reset + ( + absorptionEmissionModel::New(dict, mesh).ptr() + ); + } + + // if (dict.found("transmissivityModel")) + { + transmissivity_.reset + ( + transmissivityModel::New(dict, mesh).ptr() + ); + } + } + case LOOKUP: + { + //Do nothing + } + break; + } + + if (dict.found("value")) + { + fvPatchScalarField::operator= + ( + scalarField("value", dict, p.size()) + ); + + } + else + { + fvPatchScalarField::operator=(0.0); + } +} + + +Foam::radiation::boundaryRadiationPropertiesFvPatchField:: +boundaryRadiationPropertiesFvPatchField +( + const boundaryRadiationPropertiesFvPatchField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + calculatedFvPatchScalarField(ptf, p, iF, mapper), + method_(ptf.method_), + dict_(ptf.dict_), + absorptionEmission_(NULL), + transmissivity_(NULL) +{} + + +Foam::radiation::boundaryRadiationPropertiesFvPatchField:: +boundaryRadiationPropertiesFvPatchField +( + const boundaryRadiationPropertiesFvPatchField& ptf +) +: + calculatedFvPatchScalarField(ptf), + method_(ptf.method_), + dict_(ptf.dict_), + absorptionEmission_(NULL), + transmissivity_(NULL) +{} + + +Foam::radiation::boundaryRadiationPropertiesFvPatchField:: +boundaryRadiationPropertiesFvPatchField +( + const boundaryRadiationPropertiesFvPatchField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + calculatedFvPatchScalarField(ptf, iF), + method_(ptf.method_), + dict_(ptf.dict_), + absorptionEmission_(NULL), + transmissivity_(NULL) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::radiation::absorptionEmissionModel& +Foam::radiation::boundaryRadiationPropertiesFvPatchField:: +absorptionEmission() const +{ + return absorptionEmission_(); +} + + +const Foam::radiation::transmissivityModel& +Foam::radiation::boundaryRadiationPropertiesFvPatchField:: +transmissiveModel() const +{ + return transmissivity_(); +} + + +Foam::tmp<Foam::scalarField> Foam::radiation:: +boundaryRadiationPropertiesFvPatchField:: +emissivity(const label bandI) const +{ + switch (method_) + { + 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().patch()); + + mpp.distribute(emissivity); + + const tmp<scalarField> te(new scalarField(emissivity)); + + return te; + + } + break; + + case LOOKUP: + { + tmp<scalarField> e + ( + new scalarField("emissivity", dict_, patch().size()) + ); + + return e; + } + + case MODEL: + { + const label index = patch().index(); + + tmp<scalarField> e + ( + new scalarField + ( + absorptionEmission_->e(bandI)().boundaryField()[index] + ) + ); + + return e; + } + + default: + { + FatalErrorInFunction + << "Please set 'mode' to one of " << methodTypeNames_.toc() + << exit(FatalError); + } + break; + } + + return scalarField(0); +} + + +Foam::tmp<Foam::scalarField> Foam::radiation:: +boundaryRadiationPropertiesFvPatchField::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().patch()); + + mpp.distribute(absorp); + + const tmp<scalarField> ta(new scalarField(absorp)); + + return ta; + + } + break; + + case MODEL: + { + const label index = patch().index(); + tmp<scalarField> a + ( + new scalarField + ( + absorptionEmission_->a(bandI)().boundaryField()[index] + ) + ); + return a; + } + + case LOOKUP: + { + tmp<scalarField> a + ( + new scalarField("absorptivity", dict_, patch().size()) + ); + + return a; + } + + default: + { + FatalErrorInFunction + << "Unimplemented method " << method_ << endl + << "Please set 'mode' to one of " + << methodTypeNames_.toc() + << exit(FatalError); + } + break; + } + + return scalarField(0); +} + + +Foam::tmp<Foam::scalarField> Foam::radiation:: +boundaryRadiationPropertiesFvPatchField:: +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().patch()); + + mpp.distribute(trans); + + const tmp<scalarField> tt(new scalarField(trans)); + + return tt; + + } + break; + + case MODEL: + { + const label index = patch().index(); + tmp<scalarField> tau + ( + new scalarField + ( + transmissivity_->tauEff(bandI)().boundaryField()[index] + ) + ); + return tau; + } + + case LOOKUP: + { + tmp<scalarField> tau + ( + new scalarField + ( + "transmissivity", dict_, patch().size() + ) + ); + return tau; + } + + default: + { + FatalErrorInFunction + << "Unimplemented method " << method_ << endl + << "Please set 'mode' to one of " + << methodTypeNames_.toc() + << exit(FatalError); + } + break; + } + + return scalarField(0); +} + + + +Foam::tmp<Foam::scalarField> Foam::radiation:: +boundaryRadiationPropertiesFvPatchField:: +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::boundaryRadiationPropertiesFvPatchField:: +write(Ostream& os) const +{ + calculatedFvPatchScalarField::write(os); + + os.writeKeyword("mode") << methodTypeNames_[method_] + << token::END_STATEMENT << nl; + + switch (method_) + { + case MODEL: + { + word modelType + ( + word(dict_.lookup("absorptionEmissionModel")) + ); + + os.writeKeyword("absorptionEmissionModel") << modelType + << token::END_STATEMENT << nl; + + word modelCoeffs(modelType + word("Coeffs")); + os.writeKeyword(modelCoeffs); + + dict_.subDict(modelCoeffs).write(os); + + modelType = word(dict_.lookup("transmissivityModel")); + + os.writeKeyword("transmissivityModel") << modelType + << token::END_STATEMENT << nl; + + 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: + { + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ + makePatchTypeField + ( + fvPatchScalarField, + boundaryRadiationPropertiesFvPatchField + ); +} +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.H new file mode 100644 index 0000000000000000000000000000000000000000..e6cf0ac5021bf2adcd907728296539ce15456f1c --- /dev/null +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.H @@ -0,0 +1,212 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::boundaryRadiationPropertiesFvPatchField + +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 + boundaryRadiationPropertiesFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef boundaryRadiationPropertiesFvPatchField_H +#define boundaryRadiationPropertiesFvPatchField_H + +#include "scalarField.H" +#include "NamedEnum.H" +#include "fvPatch.H" +#include "calculatedFvPatchFields.H" +#include "transmissivityModel.H" +#include "absorptionEmissionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ +/*---------------------------------------------------------------------------*\ + Class boundaryRadiationPropertiesFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +class boundaryRadiationPropertiesFvPatchField +: + public calculatedFvPatchScalarField +{ +public: + + // - Type of look up + enum methodType + { + SOLIDRADIATION, + LOOKUP, + MODEL + }; + + +private: + + // Private data + + static const NamedEnum<methodType, 3> methodTypeNames_; + + //- How to get property + const methodType method_; + + //- Dictionary + const dictionary dict_; + + //- Absorption/emission model + autoPtr<absorptionEmissionModel> absorptionEmission_; + + //- transmissivity model + autoPtr<transmissivityModel> transmissivity_; + + + // Private functions + + //- Return nbr patch index + label nbrPatchIndex() const; + + //- Return nbr mesh + const fvMesh& nbrRegion() const; + + +public: + + //- Runtime type information + TypeName("boundaryRadiation"); + + // Constructors + + + //- Construct from patch and internal field + boundaryRadiationPropertiesFvPatchField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + boundaryRadiationPropertiesFvPatchField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given a + // greyDiffusiveViewFactorFixedValueFvPatchScalarField onto a new patch + boundaryRadiationPropertiesFvPatchField + ( + const boundaryRadiationPropertiesFvPatchField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + boundaryRadiationPropertiesFvPatchField + ( + const boundaryRadiationPropertiesFvPatchField& + ); + + //- Construct as copy setting internal field reference + boundaryRadiationPropertiesFvPatchField + ( + const boundaryRadiationPropertiesFvPatchField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new boundaryRadiationPropertiesFvPatchField(*this) + ); + } + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new boundaryRadiationPropertiesFvPatchField(*this, iF) + ); + } + + + // Member functions + + //- Method to obtain properties + word method() const + { + return methodTypeNames_[method_]; + } + + + //- Return absorptionEmissionModel + const absorptionEmissionModel& absorptionEmission() const; + + //- Return transmissivityModel + const transmissivityModel& transmissiveModel() const; + + //- Calculate corresponding emissivity field for bandI + tmp<scalarField> emissivity(const label bandI = 0) const; + + //- Calculate corresponding absorptivity field for bandI + tmp<scalarField> absorptivity(const label bandI = 0) const; + + //- Calculate corresponding transmissivity field for bandI + tmp<scalarField> transmissivity(const label bandI = 0) const; + + //- Calculate corresponding reflectivity field + tmp<scalarField> reflectivity(const label bandI = 0) const; + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam +} // End namespace radiation + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index f07c7c5a0923b0fe445977e4ddc09d84ffcfeb02..6138abf45fd579de77eba8eee8a08c0799a38118 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -27,6 +27,7 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" +#include "boundaryRadiationProperties.H" #include "fvDOM.H" #include "constants.H" @@ -44,8 +45,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, "undefined", scalarField::null()), - TName_("T") + TName_("T"), + solarLoad_(false) { refValue() = 0.0; refGrad() = 0.0; @@ -63,13 +64,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField ) : mixedFvPatchScalarField(ptf, p, iF, mapper), - radiationCoupledBase - ( - p, - ptf.emissivityMethod(), - ptf.emissivity_ - ), - TName_(ptf.TName_) + TName_(ptf.TName_), + solarLoad_(ptf.solarLoad_) {} @@ -82,8 +78,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, dict), - TName_(dict.lookupOrDefault<word>("T", "T")) + TName_(dict.lookupOrDefault<word>("T", "T")), + solarLoad_(dict.lookupOrDefault<bool>("solarLoad", false)) { if (dict.found("refValue")) { @@ -113,13 +109,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField ) : mixedFvPatchScalarField(ptf), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), - TName_(ptf.TName_) + TName_(ptf.TName_), + solarLoad_(ptf.solarLoad_) {} @@ -131,13 +122,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField ) : mixedFvPatchScalarField(ptf, iF), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), - TName_(ptf.TName_) + TName_(ptf.TName_), + solarLoad_(ptf.solarLoad_) {} @@ -178,6 +164,7 @@ updateCoeffs() } scalarField& Iw = *this; + const vectorField n(patch().nf()); radiativeIntensityRay& ray = @@ -187,7 +174,15 @@ updateCoeffs() ray.Qr().boundaryField()[patchI] += Iw*nAve; - const scalarField temissivity = emissivity(); + const boundaryRadiationProperties& boundaryRadiation = + boundaryRadiationProperties::New(dimensionedInternalField().mesh()); + + const tmp<scalarField> temissivity + ( + boundaryRadiation.emissivity(patch().index()) + ); + + const scalarField& emissivity = temissivity(); scalarField& Qem = ray.Qem().boundaryField()[patchI]; scalarField& Qin = ray.Qin().boundaryField()[patchI]; @@ -203,6 +198,14 @@ updateCoeffs() Ir += dom.IRay(rayI).Qin().boundaryField()[patchI]; } + if (solarLoad_) + { + Ir += patch().lookupPatchField<volScalarField,scalar> + ( + radiation.externalRadHeatFieldName_ + ); + } + forAll(Iw, faceI) { if ((-n[faceI] & myRayId) > 0.0) @@ -212,8 +215,8 @@ updateCoeffs() valueFraction()[faceI] = 1.0; refValue()[faceI] = ( - Ir[faceI]*(scalar(1.0) - temissivity[faceI]) - + temissivity[faceI]*physicoChemical::sigma.value() + Ir[faceI]*(scalar(1.0) - emissivity[faceI]) + + emissivity[faceI]*physicoChemical::sigma.value() * pow4(Tp[faceI]) )/pi; @@ -245,8 +248,8 @@ void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::write ) const { mixedFvPatchScalarField::write(os); - radiationCoupledBase::write(os); writeEntryIfDifferent<word>(os, "T", "T", TName_); + os.writeKeyword("solarLoad") << solarLoad_ << token::END_STATEMENT << nl; } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index d554d59708e3fb1a59c74513a06d011a47af75e8..bce882d5d753f6b53c332fc4fdb66b9595c63f63 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H @@ -38,7 +38,6 @@ Description \table Property | Description | Required | Default value T | temperature field name | no | T - emissivityMode | emissivity mode: solidRadiation or lookup | yes | \endtable Example of the boundary condition specification: @@ -47,15 +46,14 @@ Description { type greyDiffusiveRadiation; T T; - emissivityMode solidRadiation; value uniform 0; } \endverbatim SeeAlso - Foam::radiationCoupledBase Foam::radiation::radiationModel Foam::radiation::fvDOM + Foam::radiationCoupledBase Foam::mixedFvPatchField SourceFiles @@ -67,7 +65,6 @@ SourceFiles #define greyDiffusiveRadiationMixedFvPatchScalarField_H #include "mixedFvPatchFields.H" -#include "radiationCoupledBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -81,14 +78,16 @@ namespace radiation class greyDiffusiveRadiationMixedFvPatchScalarField : - public mixedFvPatchScalarField, - public radiationCoupledBase + public mixedFvPatchScalarField { // Private data //- Name of temperature field word TName_; + //- Activate solar load + bool solarLoad_; + public: @@ -191,8 +190,8 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace radiation } // End namespace Foam +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C index 233d80b4507ed39945476e8b05138afb608ccbfe..5ae7ff434bee0f6db97fb8354c940744e9a67a98 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C @@ -27,7 +27,7 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" - +#include "radiationModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -39,8 +39,8 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), - radiationCoupledBase(patch(), "undefined", scalarField::null()), - Qro_(p.size(), 0.0) + Qro_(), + solarLoad_(false) {} @@ -54,13 +54,8 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper), - radiationCoupledBase - ( - patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), - Qro_(ptf.Qro_) + Qro_(ptf.Qro_, mapper), + solarLoad_(ptf.solarLoad_) {} @@ -73,8 +68,8 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), - radiationCoupledBase(p, dict), - Qro_("Qro", dict, p.size()) + Qro_("Qro", dict, p.size()), + solarLoad_(dict.lookupOrDefault<bool>("solarLoad", false)) { if (dict.found("value")) { @@ -98,13 +93,8 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), - Qro_(ptf.Qro_) + Qro_(ptf.Qro_), + solarLoad_(ptf.solarLoad_) {} @@ -116,13 +106,8 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf, iF), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), - Qro_(ptf.Qro_) + Qro_(ptf.Qro_), + solarLoad_(ptf.solarLoad_) {} @@ -136,6 +121,7 @@ updateCoeffs() return; } + // Do nothing if (debug) @@ -152,8 +138,26 @@ updateCoeffs() << " avg:" << gAverage(*this) << endl; } +} + + +Foam::tmp<Foam::scalarField> Foam::radiation:: +greyDiffusiveViewFactorFixedValueFvPatchScalarField::Qro() const +{ + tmp<scalarField> tQrt(new scalarField(Qro_)); + + if (solarLoad_) + { + const radiationModel& radiation = + db().lookupObject<radiationModel>("radiationProperties"); + + tQrt() += patch().lookupPatchField<volScalarField,scalar> + ( + radiation.externalRadHeatFieldName_ + ); + } - fixedValueFvPatchScalarField::updateCoeffs(); + return tQrt; } @@ -164,8 +168,8 @@ write ) const { fixedValueFvPatchScalarField::write(os); - radiationCoupledBase::write(os); Qro_.writeEntry("Qro", os); + os.writeKeyword("solarLoad") << solarLoad_ << token::END_STATEMENT << nl; } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H index 820fde3ee528d11267d75b9534a3ac3d98d9acc1..dd5c3564c8e92f72c6d5e61f8a8335508e46fb0f 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H @@ -36,7 +36,6 @@ Description \table Property | Description | Required | Default value Qro | external radiative heat flux | yes | - emissivityMode | emissivity mode: solidRadiation or lookup | yes | \endtable Example of the boundary condition specification: @@ -45,15 +44,14 @@ Description { type greyDiffusiveRadiationViewFactor; Qro uniform 0; - emissivityMode solidRadiation; value uniform 0; } \endverbatim SeeAlso - Foam::radiationCoupledBase Foam::radiation::radiationModel Foam::radiation::viewFactor + Foam::radiationCoupledBase Foam::fixedValueFvPatchField SourceFiles @@ -64,7 +62,6 @@ SourceFiles #ifndef greyDiffusiveViewFactorFixedValueFvPatchScalarField_H #define greyDiffusiveViewFactorFixedValueFvPatchScalarField_H -#include "radiationCoupledBase.H" #include "fixedValueFvPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,21 +70,22 @@ namespace Foam { namespace radiation { - /*---------------------------------------------------------------------------*\ Class greyDiffusiveViewFactorFixedValueFvPatchScalarField declaration \*---------------------------------------------------------------------------*/ class greyDiffusiveViewFactorFixedValueFvPatchScalarField : - public fixedValueFvPatchScalarField, - public radiationCoupledBase + public fixedValueFvPatchScalarField { // Private data //- External radiative heat flux scalarField Qro_; + //- Activate solar load + bool solarLoad_; + public: @@ -165,11 +163,8 @@ public: // Access - //- Return external radiative heat flux - const scalarList& Qro() - { - return Qro_; - } + //- Return external + solar load radiative heat flux + tmp<scalarField> Qro() const; // Evaluation functions @@ -187,8 +182,8 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace radiation } // End namespace Foam +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C deleted file mode 100644 index 98fb60d6be11e1cf40baf7dd08a336d199353fb9..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C +++ /dev/null @@ -1,236 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "radiationCoupledBase.H" -#include "volFields.H" -#include "mappedPatchBase.H" -#include "fvPatchFieldMapper.H" -#include "radiationModel.H" -#include "absorptionEmissionModel.H" - -// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(radiationCoupledBase, 0); -} - - -namespace Foam -{ - template<> - const char* Foam::NamedEnum - < - Foam::radiationCoupledBase::emissivityMethodType, - 2 - >::names[] = - { - "solidRadiation", - "lookup" - }; -} - - -const Foam::NamedEnum<Foam::radiationCoupledBase::emissivityMethodType, 2> - Foam::radiationCoupledBase::emissivityMethodTypeNames_; - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::radiationCoupledBase::radiationCoupledBase -( - const fvPatch& patch, - const word& calculationType, - const scalarField& emissivity -) -: - patch_(patch), - method_(emissivityMethodTypeNames_[calculationType]), - emissivity_(emissivity) -{} - - -Foam::radiationCoupledBase::radiationCoupledBase -( - const fvPatch& patch, - const word& calculationType, - const scalarField& emissivity, - const fvPatchFieldMapper& mapper -) -: - patch_(patch), - method_(emissivityMethodTypeNames_[calculationType]), - emissivity_(emissivity, mapper) -{} - - -Foam::radiationCoupledBase::radiationCoupledBase -( - const fvPatch& patch, - const dictionary& dict -) -: - patch_(patch), - method_(emissivityMethodTypeNames_.read(dict.lookup("emissivityMode"))) -{ - switch (method_) - { - case SOLIDRADIATION: - { - if (!isA<mappedPatchBase>(patch_.patch())) - { - FatalIOErrorInFunction - ( - dict - ) << "\n patch type '" << patch_.type() - << "' not type '" << mappedPatchBase::typeName << "'" - << "\n for patch " << patch_.name() - << exit(FatalIOError); - } - - emissivity_ = scalarField(patch_.size(), 0.0); - } - break; - - case LOOKUP: - { - if (!dict.found("emissivity")) - { - FatalIOErrorInFunction - ( - dict - ) << "\n emissivity key does not exist for patch " - << patch_.name() - << exit(FatalIOError); - } - else - { - emissivity_ = scalarField("emissivity", dict, patch_.size()); - } - } - break; - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -Foam::radiationCoupledBase::~radiationCoupledBase() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalarField Foam::radiationCoupledBase::emissivity() const -{ - switch (method_) - { - case SOLIDRADIATION: - { - // Get the coupling information from the mappedPatchBase - const mappedPatchBase& mpp = - refCast<const mappedPatchBase>(patch_.patch()); - - const polyMesh& nbrMesh = mpp.sampleMesh(); - - const radiation::radiationModel& radiation = - nbrMesh.lookupObject<radiation::radiationModel> - ( - "radiationProperties" - ); - - - const fvMesh& nbrFvMesh = refCast<const fvMesh>(nbrMesh); - - const fvPatch& nbrPatch = - nbrFvMesh.boundary()[mpp.samplePolyPatch().index()]; - - - scalarField emissivity - ( - radiation.absorptionEmission().e()().boundaryField() - [ - nbrPatch.index() - ] - ); - mpp.distribute(emissivity); - - return emissivity; - - } - break; - - case LOOKUP: - { - // return local value - return emissivity_; - } - - default: - { - FatalErrorInFunction - << "Unimplemented method " << method_ << endl - << "Please set 'emissivity' to one of " - << emissivityMethodTypeNames_.toc() - << exit(FatalError); - } - break; - } - - return scalarField(0); -} - - -void Foam::radiationCoupledBase::autoMap -( - const fvPatchFieldMapper& m -) -{ - emissivity_.autoMap(m); -} - - -void Foam::radiationCoupledBase::rmap -( - const fvPatchScalarField& ptf, - const labelList& addr -) -{ - const radiationCoupledBase& mrptf = - refCast<const radiationCoupledBase>(ptf); - - emissivity_.rmap(mrptf.emissivity_, addr); -} - - -void Foam::radiationCoupledBase::write(Ostream& os) const -{ - os.writeKeyword("emissivityMode") << emissivityMethodTypeNames_[method_] - << token::END_STATEMENT << nl; - emissivity_.writeEntry("emissivity", os); -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.H deleted file mode 100644 index 910371fb4abc30131a4ac7c0df848e80c2d97be5..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.H +++ /dev/null @@ -1,172 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 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::radiationCoupledBase - -Description - Common functions to emissivity. It gets supplied from lookup into a - dictionary or calculated by the solidThermo: - - - 'lookup' : Read the patch emissivity field from the dictionary - - 'solidRadiation' : Use the emissivity field mapped from the adjacent solid - -SourceFiles - radiationCoupledBase.C - -\*---------------------------------------------------------------------------*/ - -#ifndef radiationCoupledBase_H -#define radiationCoupledBase_H - -#include "scalarField.H" -#include "NamedEnum.H" -#include "fvPatch.H" -#include "fvPatchFieldMapper.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class radiationCoupledBase Declaration -\*---------------------------------------------------------------------------*/ - -class radiationCoupledBase -{ -public: - - //- Type of supplied emissivity - enum emissivityMethodType - { - SOLIDRADIATION, - LOOKUP - }; - - -private: - - // Private data - - static const NamedEnum<emissivityMethodType, 2> - emissivityMethodTypeNames_; - - //- Underlying patch - const fvPatch& patch_; - - -protected: - - // Protected data - - //- How to get emissivity - const emissivityMethodType method_; - - //- Emissivity - // Cached locally when is read from dictionary (lookup mode) - scalarField emissivity_; - - -public: - - //- Runtime type information - TypeName("radiationCoupledBase"); - - - // Constructors - - //- Construct from patch, emissivity mode and emissivity - radiationCoupledBase - ( - const fvPatch& patch, - const word& calculationMethod, - const scalarField& emissivity - ); - - //- Construct from patch, emissivity mode and emissivity and mapper - radiationCoupledBase - ( - const fvPatch& patch, - const word& calculationMethod, - const scalarField& emissivity, - const fvPatchFieldMapper& mapper - ); - - //- Construct from patch and dictionary - radiationCoupledBase - ( - const fvPatch& patch, - const dictionary& dict - ); - - - //- Destructor - virtual ~radiationCoupledBase(); - - - // Member functions - - // Access - - //- Method to obtain emissivity - word emissivityMethod() const - { - return emissivityMethodTypeNames_[method_]; - } - - - //- Calculate corresponding emissivity field - scalarField emissivity() const; - - - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchScalarField&, - const labelList& - ); - - - //- Write - void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index 3d768a0bd89501d5b3b452646e013a19580b6607..8c3e44547cd6ad7913f8953b0512d93f5863ae52 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -31,6 +31,7 @@ License #include "fvDOM.H" #include "wideBandAbsorptionEmission.H" #include "constants.H" +#include "boundaryRadiationProperties.H" using namespace Foam::constant; using namespace Foam::constant::mathematical; @@ -44,9 +45,7 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField const DimensionedField<scalar, volMesh>& iF ) : - mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, "undefined", scalarField::null()), - TName_("T") + mixedFvPatchScalarField(p, iF) { refValue() = 0.0; refGrad() = 0.0; @@ -63,14 +62,7 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField const fvPatchFieldMapper& mapper ) : - mixedFvPatchScalarField(ptf, p, iF, mapper), - radiationCoupledBase - ( - p, - ptf.emissivityMethod(), - ptf.emissivity_ - ), - TName_(ptf.TName_) + mixedFvPatchScalarField(ptf, p, iF, mapper) {} @@ -82,9 +74,7 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField const dictionary& dict ) : - mixedFvPatchScalarField(p, iF), - radiationCoupledBase(p, dict), - TName_(dict.lookupOrDefault<word>("T", "T")) + mixedFvPatchScalarField(p, iF) { if (dict.found("value")) { @@ -98,12 +88,9 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField } else { - const scalarField& Tp = - patch().lookupPatchField<volScalarField, scalar>(TName_); - - refValue() = - 4.0*physicoChemical::sigma.value()*pow4(Tp)*emissivity()/pi; + refValue() = 0.0; refGrad() = 0.0; + valueFraction() = 1.0; fvPatchScalarField::operator=(refValue()); } @@ -116,14 +103,7 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField const wideBandDiffusiveRadiationMixedFvPatchScalarField& ptf ) : - mixedFvPatchScalarField(ptf), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), - TName_(ptf.TName_) + mixedFvPatchScalarField(ptf) {} @@ -134,14 +114,7 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField const DimensionedField<scalar, volMesh>& iF ) : - mixedFvPatchScalarField(ptf, iF), - radiationCoupledBase - ( - ptf.patch(), - ptf.emissivityMethod(), - ptf.emissivity_ - ), - TName_(ptf.TName_) + mixedFvPatchScalarField(ptf, iF) {} @@ -193,7 +166,16 @@ updateCoeffs() dom.blackBody().bLambda(lambdaId).boundaryField()[patchI] ); - scalarField temissivity = emissivity(); + const boundaryRadiationProperties& boundaryRadiation = + boundaryRadiationProperties::New(dimensionedInternalField().mesh()); + + + const tmp<scalarField> temissivity + ( + boundaryRadiation.emissivity(patch().index(), lambdaId) + ); + + const scalarField& emissivity = temissivity(); scalarField& Qem = ray.Qem().boundaryField()[patchI]; scalarField& Qin = ray.Qin().boundaryField()[patchI]; @@ -218,8 +200,8 @@ updateCoeffs() valueFraction()[faceI] = 1.0; refValue()[faceI] = ( - Ir[faceI]*(1.0 - temissivity[faceI]) - + temissivity[faceI]*Eb[faceI] + Ir[faceI]*(1.0 - emissivity[faceI]) + + emissivity[faceI]*Eb[faceI] )/pi; // Emmited heat flux from this ray direction @@ -250,8 +232,6 @@ void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::write ) const { mixedFvPatchScalarField::write(os); - radiationCoupledBase::write(os); - writeEntryIfDifferent<word>(os, "T", "T", TName_); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index 612cce0445c6f1d49899a785ee39b9a611d6e4e5..fbed4f83994f8e0e0c0c173e28f5cf254b1e41e0 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -60,7 +60,7 @@ SourceFiles #define wideBandDiffusiveRadiationMixedFvPatchScalarField_H #include "mixedFvPatchFields.H" -#include "radiationCoupledBase.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,15 +74,8 @@ namespace radiation class wideBandDiffusiveRadiationMixedFvPatchScalarField : - public mixedFvPatchScalarField, - public radiationCoupledBase + public mixedFvPatchScalarField { - // Private data - - //- Name of temperature field - word TName_; - - public: //- Runtime type information @@ -153,20 +146,6 @@ public: // Member functions - // Access - - //- Return the temperature field name - const word& TName() const - { - return TName_; - } - - //- Return reference to the temperature field name to allow - // adjustment - word& TName() - { - return TName_; - } // Evaluation functions diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C index 61878d35e8529e926661ee4e5734ffa93b6ec418..469710573999922239a333392e9a7c7bf78fade8 100644 --- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C @@ -87,14 +87,6 @@ void Foam::radiation::fvDOM::initialise() // 2D else if (mesh_.nSolutionD() == 2) { - // Currently 2D solution is limited to the x-y plane - if (mesh_.solutionD()[vector::Z] != -1) - { - FatalErrorInFunction - << "Currently 2D solution is limited to the x-y plane" - << exit(FatalError); - } - scalar thetai = piByTwo; scalar deltaTheta = pi; nRay_ = 4*nPhi_; @@ -127,14 +119,6 @@ void Foam::radiation::fvDOM::initialise() // 1D else { - // Currently 1D solution is limited to the x-direction - if (mesh_.solutionD()[vector::X] != 1) - { - FatalErrorInFunction - << "Currently 1D solution is limited to the x-direction" - << exit(FatalError); - } - scalar thetai = piByTwo; scalar deltaTheta = pi; nRay_ = 2; @@ -221,11 +205,35 @@ void Foam::radiation::fvDOM::initialise() { omegaMax_ = IRay_[rayId].omega(); } - Info<< '\t' << IRay_[rayId].I().name() << " : " << "omega : " - << '\t' << IRay_[rayId].omega() << nl; + Info<< '\t' << IRay_[rayId].I().name() << " : " << "dAve : " + << '\t' << IRay_[rayId].dAve() << nl; } Info<< endl; + + if (this->found("useSolarLoad")) + { + this->lookup("useSolarLoad") >> useSolarLoad_; + } + + if (useSolarLoad_) + { + const dictionary& solarDict = this->subDict("solarLoarCoeffs"); + solarLoad_.reset + ( + new solarLoad(solarDict, T_, externalRadHeatFieldName_) + ); + + if (solarLoad_->nBands() > 1) + { + FatalErrorInFunction + << "Requested solar radiation with fvDOM. Using " + << "more than one band for the solar load is not allowed" + << abort(FatalError); + } + + Info<< "Creating Solar Load Model " << nl; + } } @@ -294,7 +302,7 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) mesh_.time().timeName(), mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), mesh_, dimensionedScalar("a", dimless/dimLength, 0.0) @@ -310,7 +318,13 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)), fvRayDiv_(nLambda_), cacheDiv_(coeffs_.lookupOrDefault<bool>("cacheDiv", false)), - omegaMax_(0) + omegaMax_(0), + useSolarLoad_(false), + solarLoad_(), + meshOrientation_ + ( + coeffs_.lookupOrDefault<vector>("meshOrientation", vector::zero) + ) { initialise(); } @@ -399,7 +413,13 @@ Foam::radiation::fvDOM::fvDOM maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)), fvRayDiv_(nLambda_), cacheDiv_(coeffs_.lookupOrDefault<bool>("cacheDiv", false)), - omegaMax_(0) + omegaMax_(0), + useSolarLoad_(false), + solarLoad_(), + meshOrientation_ + ( + coeffs_.lookupOrDefault<vector>("meshOrientation", vector::zero) + ) { initialise(); } @@ -436,6 +456,11 @@ void Foam::radiation::fvDOM::calculate() updateBlackBodyEmission(); + if (useSolarLoad_) + { + solarLoad_->calculate(); + } + // Set rays convergence false List<bool> rayIdConv(nRay_, false); @@ -482,8 +507,7 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::fvDOM::Rp() const IOobject::NO_WRITE, false ), - // Only include continuous phase emission - 4*absorptionEmission_->aCont()*physicoChemical::sigma + 4.0*a_*physicoChemical::sigma //absorptionEmission_->a() ) ); } @@ -495,15 +519,12 @@ Foam::radiation::fvDOM::Ru() const const DimensionedField<scalar, volMesh>& G = G_.dimensionedInternalField(); - const DimensionedField<scalar, volMesh> E = absorptionEmission_->ECont()().dimensionedInternalField(); - - // Only include continuous phase absorption const DimensionedField<scalar, volMesh> a = - absorptionEmission_->aCont()().dimensionedInternalField(); + a_.dimensionedInternalField(); - return a*G - E; + return a*G - E; } diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.H b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.H index dd8bb8c1dbff3e3d51fe8f059c2f90ae0a693e8b..4fb15edbc56a9920a55ac4905ca95d6e9beb8514 100644 --- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.H +++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.H @@ -47,16 +47,23 @@ Description cacheDiv true; // cache the div of the RTE equation. //NOTE: Caching div is "only" accurate if the upwind scheme is used //in div(Ji,Ii_h) + meshOrientation (1 1 1); //Mesh ortientation used for 2D and 1D } solverFreq 1; // Number of flow iterations per radiation iteration \endverbatim - The total number of solid angles is 4*nPhi*nTheta. + The total number of solid angles is 4*nPhi*nTheta in 3-D. - In 1D the direction of the rays is X (nPhi and nTheta are ignored) - In 2D the direction of the rays is on X-Y plane (only nPhi is considered) - In 3D (nPhi and nTheta are considered) + In 1-D the ray directions are on X, Y or Z (nPhi and nTheta are ignored). + 'meshOrientation' vector can be used for any other 1D direction. + + In 2-D the ray directions are on X-Y, X-Z or Y-Z planes. + (only nPhi is considered). 'meshOrientation' vector can be used for + not-aligned planes specifying the plane normal vector. + + In 3D (nPhi and nTheta are considered). 'meshOrientation' vector is not + considered. SourceFiles fvDOM.C @@ -69,6 +76,7 @@ SourceFiles #include "radiativeIntensityRay.H" #include "radiationModel.H" #include "fvMatrices.H" +#include "solarLoad.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -139,6 +147,15 @@ class fvDOM //- Maximum omega weight scalar omegaMax_; + //- Use Solar Load model + bool useSolarLoad_; + + //- Solar load radiation model + autoPtr<solarLoad> solarLoad_; + + //- Mesh orientation vector + vector meshOrientation_; + // Private Member Functions @@ -260,6 +277,9 @@ public: //- Return omegaMax inline scalar omegaMax() const; + + //- Return meshOrientation + inline vector meshOrientation() const; }; diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOMI.H b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOMI.H index 8e4c201b31348a779f00e3a38241817f64a35d45..c8408993547efe3dfb3e0622b1d0c718a85e5f76 100644 --- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOMI.H +++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOMI.H @@ -132,4 +132,10 @@ inline Foam::scalar Foam::radiation::fvDOM::omegaMax() const } +inline Foam::vector Foam::radiation::fvDOM::meshOrientation() const +{ + return meshOrientation_; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C index c27520f4e581d8b2bf0c8254b702dc2a9fe111b4..3de54c8c6e5ae3167f680b886c05293d6957c033 100644 --- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C @@ -30,10 +30,8 @@ License using namespace Foam::constant; -const Foam::word Foam::radiation::radiativeIntensityRay::intensityPrefix -( - "ILambda" -); +const Foam::word +Foam::radiation::radiativeIntensityRay::intensityPrefix("ILambda"); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -137,6 +135,53 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay 0.5*deltaPhi*Foam::sin(2.0*theta)*Foam::sin(deltaTheta) ); + if (mesh_.nSolutionD() == 2) + { + vector meshDir(vector::zero); + if (dom_.meshOrientation() != vector::zero) + { + meshDir = dom_.meshOrientation(); + } + else + { + for (direction cmpt=0; cmpt<vector::nComponents; cmpt++) + { + if (mesh_.geometricD()[cmpt] == -1) + { + meshDir[cmpt] = 1; + } + } + } + const vector normal(vector(0, 0, 1)); + + const tensor coordRot = rotationTensor(normal, meshDir); + + dAve_ = coordRot & dAve_; + d_ = coordRot & d_; + } + else if (mesh_.nSolutionD() == 1) + { + vector meshDir(vector::zero); + if (dom_.meshOrientation() != vector::zero) + { + meshDir = dom_.meshOrientation(); + } + else + { + for (direction cmpt=0; cmpt<vector::nComponents; cmpt++) + { + if (mesh_.geometricD()[cmpt] == 1) + { + meshDir[cmpt] = 1; + } + } + } + const vector normal(vector(1, 0, 0)); + + dAve_ = (dAve_ & normal)*meshDir; + d_ = (d_ & normal)*meshDir; + } + autoPtr<volScalarField> IDefaultPtr; forAll(ILambda_, lambdaI) @@ -226,12 +271,11 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct() + fvm::Sp(k*omega_, ILambda_[lambdaI]) == 1.0/constant::mathematical::pi*omega_ - *( - // Remove aDisp from k + * ( (k - absorptionEmission_.aDisp(lambdaI)) - *blackBody_.bLambda(lambdaI) - - + absorptionEmission_.E(lambdaI)/4 + *blackBody_.bLambda(lambdaI) + + absorptionEmission_.ECont(lambdaI) + + absorptionEmission_.EDisp(lambdaI) ) ); } @@ -244,10 +288,8 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct() == 1.0/constant::mathematical::pi*omega_ * ( - // Remove aDisp from k - (k - absorptionEmission_.aDisp(lambdaI)) - *blackBody_.bLambda(lambdaI) - + (k - absorptionEmission_.aDisp(lambdaI)) + *blackBody_.bLambda(lambdaI) + absorptionEmission_.E(lambdaI)/4 ) ); diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C index c8ae902c49e8c078b92893ff9d75c04a3692dc8d..5639f864fe53fc3cca2b8c5436d71a93ce09726f 100644 --- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C @@ -42,6 +42,8 @@ namespace Foam } } +const Foam::word Foam::radiation::radiationModel::externalRadHeatFieldName_ = + "QrExt"; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -86,6 +88,8 @@ void Foam::radiation::radiationModel::initialise() scatter_.reset(scatterModel::New(*this, mesh_).ptr()); soot_.reset(sootModel::New(*this, mesh_).ptr()); + + transmissivity_.reset(transmissivityModel::New(*this, mesh_).ptr()); } } @@ -114,7 +118,8 @@ Foam::radiation::radiationModel::radiationModel(const volScalarField& T) firstIter_(true), absorptionEmission_(NULL), scatter_(NULL), - soot_(NULL) + soot_(NULL), + transmissivity_(NULL) {} @@ -134,7 +139,8 @@ Foam::radiation::radiationModel::radiationModel firstIter_(true), absorptionEmission_(NULL), scatter_(NULL), - soot_(NULL) + soot_(NULL), + transmissivity_(NULL) { if (readOpt() == IOobject::NO_READ) { @@ -173,7 +179,8 @@ Foam::radiation::radiationModel::radiationModel firstIter_(true), absorptionEmission_(NULL), scatter_(NULL), - soot_(NULL) + soot_(NULL), + transmissivity_(NULL) { initialise(); } @@ -286,4 +293,18 @@ Foam::radiation::radiationModel::soot() const } +const Foam::radiation::transmissivityModel& +Foam::radiation::radiationModel::transmissivity() const +{ + if (!transmissivity_.valid()) + { + FatalErrorInFunction + << "Requested radiation sootModel model, but model is " + << "not activate" << abort(FatalError); + } + + return transmissivity_(); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H index 08b797eb2a72421dd99b44fd1d58f07bb0431725..7c11eab46a013f66f8bb7210ca9da646a30ceaaf 100644 --- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H @@ -49,6 +49,7 @@ SourceFiles #include "DimensionedField.H" #include "fvMatricesFwd.H" #include "Switch.H" +#include "transmissivityModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,8 +75,17 @@ class radiationModel : public IOdictionary { +public: + + // Static data + + //- Static name external radiative fluxes + static const word externalRadHeatFieldName_; + protected: + + // Protected data //- Reference to the mesh database @@ -112,6 +122,9 @@ protected: //- Soot model autoPtr<sootModel> soot_; + //- Transmissivity model + autoPtr<transmissivityModel> transmissivity_; + private: @@ -237,8 +250,12 @@ public: //- Access to absorptionEmission model const absorptionEmissionModel& absorptionEmission() const; + //- Access to transmissivity Model + const transmissivityModel& transmissivity() const; + //- Access to soot Model const sootModel& soot() const; + }; diff --git a/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.C b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.C new file mode 100644 index 0000000000000000000000000000000000000000..0389e6562f3d78198dab2c21dafdf3f125391819 --- /dev/null +++ b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.C @@ -0,0 +1,447 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "faceShading.H" +#include "fvMesh.H" +#include "boundaryRadiationProperties.H" +#include "OFstream.H" +#include "cyclicAMIPolyPatch.H" +#include "volFields.H" +#include "distributedTriSurfaceMesh.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(faceShading, 0); +} + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + +void Foam::faceShading::writeRays +( + const fileName& fName, + const DynamicField<point>& endCf, + const pointField& myFc +) +{ + OFstream str(fName); + label vertI = 0; + + Pout<< "Dumping rays to " << str.name() << endl; + + forAll(myFc, faceI) + { + meshTools::writeOBJ(str, myFc[faceI]); + vertI++; + meshTools::writeOBJ(str, endCf[faceI]); + vertI++; + str << "l " << vertI-1 << ' ' << vertI << nl; + } + string cmd("objToVTK " + fName + " " + fName.lessExt() + ".vtk"); + Pout<< "cmd:" << cmd << endl; + system(cmd); +} + + +Foam::triSurface Foam::faceShading::triangulate +( + const labelHashSet& includePatches, + const List<labelHashSet>& includeAllFacesPerPatch +) +{ + const polyBoundaryMesh& bMesh = mesh_.boundaryMesh(); + + // Storage for surfaceMesh. Size estimate. + DynamicList<labelledTri> triangles + ( + mesh_.nFaces() - mesh_.nInternalFaces() + ); + + label newPatchI = 0; + + forAllConstIter(labelHashSet, includePatches, iter) + { + const label patchI = iter.key(); + const polyPatch& patch = bMesh[patchI]; + const pointField& points = patch.points(); + + label nTriTotal = 0; + + if (includeAllFacesPerPatch[patchI].size() > 0) + { + forAllConstIter + ( + labelHashSet, + includeAllFacesPerPatch[patchI], + iter1 + ) + { + const label patchFaceI = iter1.key(); + + const face& f = patch[patchFaceI]; + + faceList triFaces(f.nTriangles(points)); + + label nTri = 0; + + f.triangles(points, nTri, triFaces); + + forAll(triFaces, triFaceI) + { + const face& f = triFaces[triFaceI]; + + triangles.append + ( + labelledTri(f[0], f[1], f[2], newPatchI) + ); + nTriTotal++; + } + } + newPatchI++; + } + } + + triangles.shrink(); + + // Create globally numbered tri surface + triSurface rawSurface(triangles, mesh_.points()); + + // Create locally numbered tri surface + triSurface surface + ( + rawSurface.localFaces(), + rawSurface.localPoints() + ); + + // Add patch names to surface + surface.patches().setSize(newPatchI); + + newPatchI = 0; + + forAllConstIter(labelHashSet, includePatches, iter) + { + const label patchI = iter.key(); + const polyPatch& patch = bMesh[patchI]; + + if (includeAllFacesPerPatch[patchI].size() > 0) + { + surface.patches()[newPatchI].name() = patch.name(); + surface.patches()[newPatchI].geometricType() = patch.type(); + + newPatchI++; + } + } + + return surface; +} + + +void Foam::faceShading::calculate() +{ + const radiation::boundaryRadiationProperties& boundaryRadiation = + radiation::boundaryRadiationProperties::New(mesh_); + + label nFaces = 0; //total number of direct hit faces + + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + + DynamicList<point> dynCf(nFaces); + 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 scalarField& t = tt(); + const vectorField& n = pp.faceNormals(); + + forAll(n, faceI) + { + const vector nf(n[faceI]); + if (((direction_ & nf) > 0) && (t[faceI] == 0.0)) + { + dynFacesI.append(faceI + pp.start()); + dynCf.append(cf[faceI]); + nFaces++; + } + } + } + } + + label numberPotentialHits = nFaces; + + reduce(numberPotentialHits, sumOp<label>()); + + Info<< "Number of 'potential' direct hits : " + << numberPotentialHits << endl; + + labelList hitFacesIds(nFaces); + hitFacesIds.transfer(dynFacesI); + + pointField Cfs(hitFacesIds.size()); + Cfs.transfer(dynCf); + + // * * * * * * * * * * * * * * * + // 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); + + labelHashSet includePatches; + List<labelHashSet> includeAllFacesPerPatch(patches.size()); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp)) + { + includePatches.insert(patchI); + + const tmp<scalarField> tt = + boundaryRadiation.transmissivity(patchI); + const scalarField& tau = tt(); + + forAll(pp, faceI) + { + if (tau[faceI] == 0.0) + { + includeAllFacesPerPatch[patchI].insert + ( + faceI //pp.start() + ); + } + } + } + } + + labelList triSurfaceToAgglom(5*nFaces); + + triSurface localSurface = triangulate + ( + includePatches, + includeAllFacesPerPatch + ); + + distributedTriSurfaceMesh surfacesMesh + ( + IOobject + ( + "opaqueSurface.stl", + mesh_.time().constant(), // directory + "triSurface", // instance + mesh_.time(), // registry + IOobject::NO_READ, + IOobject::NO_WRITE + ), + localSurface, + dict + ); + + surfacesMesh.searchableSurface::write(); + + triSurfaceToAgglom.resize(surfacesMesh.size()); + + scalar maxBounding = 5.0*mag(mesh_.bounds().max() - mesh_.bounds().min()); + + reduce(maxBounding, maxOp<scalar>()); + + // Calculate index of faces which have a direct hit (local) + DynamicList<label> rayStartFace(nFaces + 0.01*nFaces); + + // Shoot Rays + // * * * * * * * * * * * * * * * * + { + + DynamicField<point> start(nFaces); + DynamicField<point> end(start.size()); + DynamicList<label> startIndex(start.size()); + + label i = 0; + do + { + for (; i < Cfs.size(); i++) + { + const point& fc = Cfs[i]; + + const label myFaceId = hitFacesIds[i]; + + const vector d(direction_*maxBounding); + + start.append(fc - SMALL*d); + + startIndex.append(myFaceId); + + end.append(fc - d); + + } + + }while (returnReduce(i < Cfs.size(), orOp<bool>())); + + List<pointIndexHit> hitInfo(startIndex.size()); + surfacesMesh.findLine(start, end, hitInfo); + + // Collect the rays which has 'only one not wall' obstacle bettween + // start and end. + // If the ray hit itself get stored in dRayIs + forAll (hitInfo, rayI) + { + if (!hitInfo[rayI].hit()) + { + rayStartFace.append(startIndex[rayI]); + } + } + + // Plot all rays between visible faces. + if (debug) + { + writeRays + ( + mesh_.time().path()/"allVisibleFaces.obj", + end, + Cfs + ); + } + + start.clear(); + startIndex.clear(); + end.clear(); + } + + rayStartFaces_.transfer(rayStartFace); + + if (debug) + { + tmp<volScalarField> thitFaces + ( + new volScalarField + ( + IOobject + ( + "hitFaces", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimless, 0) + ) + ); + + volScalarField& hitFaces = thitFaces(); + + hitFaces.boundaryField() = 0.0; + forAll (rayStartFaces_, i) + { + const label faceI = rayStartFaces_[i]; + label patchID = patches.whichPatch(faceI); + const polyPatch& pp = patches[patchID]; + hitFaces.boundaryField()[patchID][faceI - pp.start()] = 1.0; + } + hitFaces.write(); + } + + label totalHitFaces = rayStartFaces_.size(); + + reduce(totalHitFaces, sumOp<label>()); + + Info<< "Total number of hit faces : " << totalHitFaces << endl; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::faceShading::faceShading +( + const fvMesh& mesh, + const vector dir, + const labelList& hitFaceList +) +: + mesh_(mesh), + direction_(dir), + rayStartFaces_(hitFaceList) +{} + + + +Foam::faceShading::faceShading +( + const fvMesh& mesh, + const vector dir +) +: + mesh_(mesh), + direction_(dir), + rayStartFaces_(0) +{ + calculate(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::faceShading::~faceShading() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::faceShading::correct() +{ + calculate(); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.H b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.H new file mode 100644 index 0000000000000000000000000000000000000000..e096cb3ecd1a6b3c719211459ab0096eda423d9f --- /dev/null +++ b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.H @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 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::faceShading + +Description + + faceShading uses the transmissivity value in the boundaryRadiationProperties + in order to evaluate which faces are "hit" by the "direction" vector. + NOTE: Only transmissivity values of zero are considered for opaque walls. + +SourceFiles + faceShading.C + +\*---------------------------------------------------------------------------*/ + +#ifndef faceShading_H +#define faceShading_H + +#include "fvMesh.H" +#include "Time.H" +#include "meshTools.H" +#include "DynamicField.H" +#include "labelIOList.H" +#include "wallPolyPatch.H" +#include "triSurfaceTools.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class faceShading Declaration +\*---------------------------------------------------------------------------*/ + +class faceShading +{ + // Private data + + //- Reference to mesh + const fvMesh& mesh_; + + //- Direction + vector direction_; + + //- Faces directly hit by vector direction + labelList rayStartFaces_; + + + // Private members + + //- Calculate ray start faces + void calculate(); + + + //- Construct a triSurface from patches and faces on global local index + triSurface triangulate + ( + const labelHashSet& includePatches, + const List<labelHashSet>& includeAllFaces + ); + + //- Write rays + void writeRays + ( + const fileName& fName, + const DynamicField<point>& endCf, + const pointField& myFc + ); + + //- Disallow default bitwise copy construct + faceShading(const faceShading&); + + //- Disallow default bitwise assignment + void operator=(const faceShading&); + + +public: + + // Declare name of the class and its debug switch + ClassName("faceShading"); + + + // Constructors + + //- Construct from components + faceShading + ( + const fvMesh& mesh, + const vector dir, + const labelList& hitFaceList + ); + + //- Construct from mesh and vector + faceShading + ( + const fvMesh& mesh, + const vector + ); + + + //- Destructor + ~faceShading(); + + + // Member Functions + + // Access + + //- const acess to direction + const vector direction() const + { + return direction_; + } + + //- Non-const access to direction + vector& direction() + { + return direction_; + } + + //- Access to rayStartFaces + const labelList& rayStartFaces() const + { + return rayStartFaces_; + } + + + //- Recalculate rayStartFaces using direction vector + void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.C b/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.C new file mode 100644 index 0000000000000000000000000000000000000000..469a33e1f58ab1558d9b52bd1ca5b553c82b0d70 --- /dev/null +++ b/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.C @@ -0,0 +1,1043 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "solarLoad.H" +#include "surfaceFields.H" +#include "vectorList.H" +#include "addToRunTimeSelectionTable.H" +#include "boundaryRadiationProperties.H" +#include "uniformDimensionedFields.H" +#include "cyclicAMIPolyPatch.H" +#include "mappedPatchBase.H" +#include "wallPolyPatch.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiation + { + defineTypeNameAndDebug(solarLoad, 0); + addToRadiationRunTimeSelectionTables(solarLoad); + } +} + +const Foam::word Foam::radiation::solarLoad::viewFactorWalls + = "viewFactorWall"; + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +bool Foam::radiation::solarLoad::updateHitFaces() +{ + if (hitFaces_.empty()) + { + hitFaces_.reset(new faceShading(mesh_, solarCalc_.direction())); + return true; + } + else + { + switch (solarCalc_.sunDirectionModel()) + { + case solarCalculator::mSunDirConstant: + { + return false; + break; + } + case solarCalculator::mSunDirTraking: + { + label updateIndex = label + ( + mesh_.time().value()/solarCalc_.sunTrackingUpdateInterval() + ); + + if (updateIndex > updateTimeIndex_) + { + Info << "Updating Sun position..." << endl; + updateTimeIndex_ = updateIndex; + solarCalc_.correctSunDirection(); + hitFaces_->direction() = solarCalc_.direction(); + hitFaces_->correct(); + return true; + break; + } + } + } + } + + return false; +} + + +void Foam::radiation::solarLoad::updateAbsorptivity +( + const labelHashSet& includePatches +) +{ + const boundaryRadiationProperties& boundaryRadiation = + boundaryRadiationProperties::New(mesh_); + + forAllConstIter(labelHashSet, includePatches, iter) + { + const label patchID = iter.key(); + absorptivity_[patchID].setSize(nBands_); + for (label bandI = 0; bandI < nBands_; bandI++) + { + absorptivity_[patchID][bandI] = + boundaryRadiation.absorptivity(patchID, bandI); + } + } +} + + +void Foam::radiation::solarLoad::updateDirectHitRadiation +( + const labelList& hitFacesId, + const labelHashSet& includeMappedPatchBasePatches +) +{ + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + const scalarField& V = mesh_.V(); + + forAll (hitFacesId, i) + { + 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(); + + if (includeMappedPatchBasePatches[patchID]) + { + const vectorField n = pp.faceNormals(); + + for (label bandI = 0; bandI < nBands_; bandI++) + { + Qr_.boundaryField()[patchID][localFaceI] += + (qPrim & n[localFaceI]) + * spectralDistribution_[bandI] + * 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++) + { + Ru_[cellI] += + (qPrim & sf[localFaceI]) + * spectralDistribution_[bandI] + * absorptivity_[patchID][bandI]()[localFaceI] + / V[cellI]; + } + } + } +} + +void Foam::radiation::solarLoad::updateSkyDiffusiveRadiation +( + const labelHashSet& includePatches, + const labelHashSet& includeMappedPatchBasePatches +) +{ + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + const scalarField& V = mesh_.V(); + + switch(solarCalc_.sunLoadModel()) + { + case solarCalculator::mSunLoadFairWeatherConditions: + case solarCalculator::mSunLoadTheoreticalMaximum: + { + forAllConstIter(labelHashSet, includePatches, iter) + { + const label patchID = iter.key(); + const polyPatch& pp = patches[patchID]; + const scalarField& sf = mesh_.magSf().boundaryField()[patchID]; + + const vectorField n = pp.faceNormals(); + const labelList& cellIds = pp.faceCells(); + + forAll (n, faceI) + { + const scalar cosEpsilon(verticalDir_ & -n[faceI]); + + scalar Ed(0.0); + scalar Er(0.0); + const scalar cosTheta(solarCalc_.direction() & -n[faceI]); + + { + // Above the horizon + if (cosEpsilon == 0.0) + { + // Vertical walls + scalar Y(0); + + if (cosTheta > -0.2) + { + Y = 0.55+0.437*cosTheta + 0.313*sqr(cosTheta); + } + else + { + Y = 0.45; + } + + Ed = solarCalc_.C()*Y*solarCalc_.directSolarRad(); + } + else + { + //Other than vertical walls + Ed = + solarCalc_.C() + * solarCalc_.directSolarRad() + * (1.0 + cosEpsilon)/2.0; + } + + // Ground reflected + Er = + solarCalc_.directSolarRad() + * (solarCalc_.C() + Foam::sin(solarCalc_.beta())) + * solarCalc_.groundReflectivity() + * (1.0 - cosEpsilon)/2.0; + } + + const label cellI = cellIds[faceI]; + if (includeMappedPatchBasePatches[patchID]) + { + for (label bandI = 0; bandI < nBands_; bandI++) + { + Qr_.boundaryField()[patchID][faceI] += + (Ed + Er) + * spectralDistribution_[bandI] + * absorptivity_[patchID][bandI]()[faceI]; + } + } + else + { + for (label bandI = 0; bandI < nBands_; bandI++) + { + Ru_[cellI] += + (Ed + Er) + * spectralDistribution_[bandI] + * absorptivity_[patchID][bandI]()[faceI] + * sf[faceI]/V[cellI]; + } + } + } + } + } + break; + + case solarCalculator::mSunLoadConstant: + { + forAllConstIter(labelHashSet, includePatches, iter) + { + const label patchID = iter.key(); + const polyPatch& pp = patches[patchID]; + const scalarField& sf = mesh_.magSf().boundaryField()[patchID]; + + const labelList& cellIds = pp.faceCells(); + forAll (pp, faceI) + { + const label cellI = cellIds[faceI]; + if (includeMappedPatchBasePatches[patchID]) + { + for (label bandI = 0; bandI < nBands_; bandI++) + { + Qr_.boundaryField()[patchID][faceI] += + solarCalc_.diffuseSolarRad() + * spectralDistribution_[bandI] + * absorptivity_[patchID][bandI]()[faceI]; + } + } + else + { + for (label bandI = 0; bandI < nBands_; bandI++) + { + Ru_[cellI] += + ( + spectralDistribution_[bandI] + * absorptivity_[patchID][bandI]()[faceI] + * solarCalc_.diffuseSolarRad() + )*sf[faceI]/V[cellI]; + } + } + } + } + break; + } + } +} + + +void Foam::radiation::solarLoad::initialise(const dictionary& coeffs) +{ + + if (coeffs.found("gridUp")) + { + coeffs.lookup("gridUp") >> verticalDir_; + verticalDir_ /= mag(verticalDir_); + } + else if (mesh_.foundObject<uniformDimensionedVectorField>("g")) + { + const uniformDimensionedVectorField& g = + mesh_.lookupObject<uniformDimensionedVectorField>("g"); + verticalDir_ = (-g/mag(g)).value(); + } + + includePatches_ = mesh_.boundaryMesh().findIndices(viewFactorWalls); + + coeffs.lookup("useVFbeamToDiffuse") >> useVFbeamToDiffuse_; + + coeffs.lookup("spectralDistribution") >> spectralDistribution_; + spectralDistribution_ = + spectralDistribution_/sum(spectralDistribution_); + + nBands_ = spectralDistribution_.size(); + + if (useVFbeamToDiffuse_) + { + map_.reset + ( + new IOmapDistribute + ( + IOobject + ( + "mapDist", + mesh_.facesInstance(), + mesh_, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ); + } + + if (coeffs.found("solidCoupled")) + { + coeffs.lookup("solidCoupled") >> solidCoupled_; + } + + if (coeffs.found("wallCoupled")) + { + coeffs.lookup("wallCoupled") >> wallCoupled_; + } + + if (coeffs.found("updateAbsorptivity")) + { + coeffs.lookup("updateAbsorptivity") >> updateAbsorptivity_; + } +} + + +void Foam::radiation::solarLoad::calculateQdiff +( + const labelHashSet& includePatches, + const labelHashSet& includeMappedPatchBasePatches +) +{ + + scalarListIOList FmyProc + ( + IOobject + ( + "F", + mesh_.facesInstance(), + mesh_, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ); + + + if (finalAgglom_.size() > 0 && coarseMesh_.empty()) + { + coarseMesh_.reset + ( + new singleCellFvMesh + ( + IOobject + ( + "coarse:" + mesh_.name(), + mesh_.polyMesh::instance(), + mesh_.time(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + finalAgglom_ + ) + ); + } + + label nLocalVFCoarseFaces = 0; + forAll(includePatches_, i) + { + const label patchI = includePatches_[i]; + nLocalVFCoarseFaces += + coarseMesh_->boundaryMesh()[patchI].size(); + } + + label totalFVNCoarseFaces = nLocalVFCoarseFaces; + reduce(totalFVNCoarseFaces, sumOp<label>()); + + // Calculate weighted absorptivity on coarse patches + List<scalar> localCoarseRave(nLocalVFCoarseFaces); + List<scalar> localCoarsePartialArea(nLocalVFCoarseFaces); + List<vector> localCoarseNorm(nLocalVFCoarseFaces); + + scalarField compactCoarseRave(map_->constructSize(), 0.0); + scalarField compactCoarsePartialArea(map_->constructSize(), 0.0); + vectorList compactCoarseNorm(map_->constructSize(), vector::zero); + + const boundaryRadiationProperties& boundaryRadiation = + boundaryRadiationProperties::New(mesh_); + + coarseToFine_.setSize(includePatches_.size()); + + const labelList& hitFacesId = hitFaces_->rayStartFaces(); + + label startI = 0; + label compactI = 0; + forAll (includePatches_, i) + { + const label patchID = includePatches_[i]; + const polyPatch& pp = mesh_.boundaryMesh()[patchID]; + + const polyPatch& cpp = coarseMesh_->boundaryMesh()[patchID]; + + const labelList& agglom = finalAgglom_[patchID]; + //if (pp.size() > 0) + if (agglom.size() > 0) + { + label nAgglom = max(agglom) + 1; + coarseToFine_[i] = invertOneToMany(nAgglom, agglom); + } + + scalarField r(pp.size(), 0.0); + for (label bandI = 0; bandI < nBands_; bandI++) + { + const tmp<scalarField> tr = + spectralDistribution_[bandI] + *boundaryRadiation.reflectivity(patchID, bandI); + r += tr(); + } + + scalarList Rave(cpp.size(), 0.0); + scalarList area(cpp.size(), 0.0); + + const scalarField& sf = mesh_.magSf().boundaryField()[patchID]; + + const labelList& coarsePatchFace = + coarseMesh_->patchFaceMap()[patchID]; + + forAll (cpp, coarseI) + { + const label coarseFaceID = coarsePatchFace[coarseI]; + const labelList& fineFaces = + coarseToFine_[i][coarseFaceID]; + + UIndirectList<scalar> fineSf + ( + sf, + fineFaces + ); + scalar fineArea = sum(fineSf()); + + scalar fullArea = 0.0; + forAll(fineFaces, j) + { + label faceI = fineFaces[j]; + label globalFaceI = faceI + pp.start(); + + if (findIndex(hitFacesId, globalFaceI) != -1) + { + fullArea += sf[faceI]; + } + Rave[coarseI] += (r[faceI]*sf[faceI])/fineArea; + } + localCoarsePartialArea[compactI++] = fullArea/fineArea; + } + + SubList<scalar> + ( + localCoarseRave, + Rave.size(), + startI + ).assign(Rave); + + + const vectorList coarseNSf = cpp.faceNormals(); + SubList<vector> + ( + localCoarseNorm, + cpp.size(), + startI + ).assign(coarseNSf); + startI += cpp.size(); + } + + + SubList<scalar>(compactCoarsePartialArea, nLocalVFCoarseFaces).assign + ( + localCoarsePartialArea + ); + + SubList<scalar>(compactCoarseRave, nLocalVFCoarseFaces).assign + ( + localCoarseRave + ); + + SubList<vector>(compactCoarseNorm, nLocalVFCoarseFaces).assign + ( + localCoarseNorm + ); + + map_->distribute(compactCoarsePartialArea); + map_->distribute(compactCoarseRave); + map_->distribute(compactCoarseNorm); + + + // Calculate coarse hitFaces and Sun direct hit heat fluxes + scalarList localqDiffusive(nLocalVFCoarseFaces, 0.0); + + label locaFaceI = 0; + forAll (includePatches_, i) + { + const label patchID = includePatches_[i]; + const polyPatch& pp = coarseMesh_->boundaryMesh()[patchID]; + const polyPatch& ppf = mesh_.boundaryMesh()[patchID]; + + const labelList& coarsePatchFace = + coarseMesh_->patchFaceMap()[patchID]; + const scalarField& sf = mesh_.magSf().boundaryField()[patchID]; + + scalarField a(ppf.size(), 0.0); + for (label bandI = 0; bandI < nBands_; bandI++) + { + const tmp<scalarField> ta = + spectralDistribution_[bandI] + * absorptivity_[patchID][bandI](); + a += ta(); + } + + forAll (pp, coarseI) + { + const label coarseFaceID = coarsePatchFace[coarseI]; + const labelList& fineFaces = coarseToFine_[i][coarseFaceID]; + UIndirectList<scalar> fineSf + ( + sf, + fineFaces + ); + scalar fineArea = sum(fineSf()); + + scalar aAve = 0.0; + forAll(fineFaces, j) + { + label faceI = fineFaces[j]; + aAve += (a[faceI]*sf[faceI])/fineArea; + } + + const scalarList& vf = FmyProc[locaFaceI]; + + const labelList& compactFaces = visibleFaceFaces_[locaFaceI]; + + + forAll (compactFaces, j) + { + label compactI = compactFaces[j]; + + localqDiffusive[locaFaceI] += + compactCoarsePartialArea[compactI] + * aAve + * (solarCalc_.directSolarRad()*solarCalc_.direction()) + & compactCoarseNorm[compactI] + * vf[j] + * compactCoarseRave[compactI]; + + } + locaFaceI++; + } + } + + // Fill QsecondRad_ + label compactId = 0; + forAll (includePatches_, i) + { + const label patchID = includePatches_[i]; + const polyPatch& pp = coarseMesh_->boundaryMesh()[patchID]; + + if (pp.size() > 0) + { + scalarField& Qrp = QsecondRad_.boundaryField()[patchID]; + + const labelList& coarsePatchFace = + coarseMesh_->patchFaceMap()[patchID]; + + forAll(pp, coarseI) + { + const label coarseFaceID = coarsePatchFace[coarseI]; + const labelList& fineFaces = coarseToFine_[i][coarseFaceID]; + forAll(fineFaces, k) + { + label faceI = fineFaces[k]; + Qrp[faceI] = localqDiffusive[compactId]; + } + compactId ++; + } + } + } + + const scalarField& V = mesh_.V(); + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + + forAllConstIter(labelHashSet, includePatches, iter) + { + const label patchID = iter.key(); + const scalarField& qSecond = QsecondRad_.boundaryField()[patchID]; + if (includeMappedPatchBasePatches[patchID]) + { + Qr_.boundaryField()[patchID] += qSecond; + } + else + { + const polyPatch& pp = patches[patchID]; + const labelList& cellIds = pp.faceCells(); + const scalarField& sf = mesh_.magSf().boundaryField()[patchID]; + forAll (pp, faceI) + { + const label cellI = cellIds[faceI]; + Ru_[cellI] += qSecond[faceI]*sf[faceI]/V[cellI]; + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiation::solarLoad::solarLoad(const volScalarField& T) +: + radiationModel(typeName, T), + finalAgglom_ + ( + IOobject + ( + "finalAgglom", + mesh_.facesInstance(), + mesh_, + IOobject::READ_IF_PRESENT, + IOobject::NO_WRITE, + false + ) + ), + coarseMesh_(), + Qr_ + ( + IOobject + ( + "Qr", + mesh_.time().timeName(), + mesh_, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0) + ), + QsecondRad_ + ( + IOobject + ( + "QsecondRad", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("QsecondRad", dimMass/pow3(dimTime), 0.0) + ), + hitFaces_(), + Ru_ + ( + IOobject + ( + "Ru", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0) + ), + solarCalc_(this->subDict(typeName + "Coeffs"), mesh_), + verticalDir_(vector::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), + absorptivity_(mesh_.boundaryMesh().size()), + updateAbsorptivity_(false), + firstIter_(true), + updateTimeIndex_(0) +{ + initialise(coeffs_); +} + + +Foam::radiation::solarLoad::solarLoad +( + const dictionary& dict, + const volScalarField& T +) +: + radiationModel(typeName, dict, T), + finalAgglom_ + ( + IOobject + ( + "finalAgglom", + mesh_.facesInstance(), + mesh_, + IOobject::READ_IF_PRESENT, + IOobject::NO_WRITE, + false + ) + ), + coarseMesh_(), + Qr_ + ( + IOobject + ( + "Qr", + mesh_.time().timeName(), + mesh_, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0) + ), + QsecondRad_ + ( + IOobject + ( + "QsecondRad", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("QsecondRad", dimMass/pow3(dimTime), 0.0) + ), + hitFaces_(), + Ru_ + ( + IOobject + ( + "Ru", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0) + ), + solarCalc_(coeffs_, mesh_), + verticalDir_(vector::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("Qr", dimMass/pow3(dimTime), 0.0) + ), + QsecondRad_ + ( + IOobject + ( + "QsecondRad", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("QsecondRad", dimMass/pow3(dimTime), 0.0) + ), + hitFaces_(), + Ru_ + ( + IOobject + ( + "Ru", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0) + ), + solarCalc_(dict, mesh_), + verticalDir_(vector::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) +{ + initialise(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiation::solarLoad::~solarLoad() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::label Foam::radiation::solarLoad::nBands() const +{ + return nBands_; +} + + +bool Foam::radiation::solarLoad::read() +{ + if (radiationModel::read()) + { + return true; + } + else + { + return false; + } +} + + +void Foam::radiation::solarLoad::calculate() +{ + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + labelHashSet includePatches; + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp)) + { + includePatches.insert(patchI); + } + } + + labelHashSet includeMappedPatchBasePatches; + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + if + ( + (isA<mappedPatchBase>(pp) && solidCoupled_) + || (isA<wallPolyPatch>(pp) && wallCoupled_) + ) + { + includeMappedPatchBasePatches.insert(patchI); + } + } + + if (updateAbsorptivity_ || firstIter_) + { + updateAbsorptivity(includePatches); + } + + bool facesChanged = updateHitFaces(); + + if (facesChanged) + { + // Reset Ru and Qr + Ru_ = dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0); + Qr_.boundaryField() = 0.0; + + // Add direct hit radation + const labelList& hitFacesId = hitFaces_->rayStartFaces(); + updateDirectHitRadiation(hitFacesId, includeMappedPatchBasePatches); + + // Add sky diffusive radiation + updateSkyDiffusiveRadiation + ( + includePatches, + includeMappedPatchBasePatches + ); + + // Add indirect diffusive radiation + if (useVFbeamToDiffuse_) + { + calculateQdiff(includePatches, includeMappedPatchBasePatches); + } + + firstIter_ = false; + } + + if (debug) + { + if (mesh_.time().outputTime()) + { + Ru_.write(); + } + } +} + + +Foam::tmp<Foam::volScalarField> Foam::radiation::solarLoad::Rp() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "Rp", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh_, + dimensionedScalar + ( + "zero", + dimMass/pow3(dimTime)/dimLength/pow4(dimTemperature), + 0.0 + ) + ) + ); +} + + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::radiation::solarLoad::Ru() const +{ + return Ru_; +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.H b/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.H new file mode 100644 index 0000000000000000000000000000000000000000..ee24701171dfa4bdc64d25e0955687329b1fcc18 --- /dev/null +++ b/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.H @@ -0,0 +1,255 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 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::radiation::solarLoad + +Description + + The solar load radiation model includes Sun primary hits, their + reflective fluxes and diffusive sky radiative fluxes. + + The primary hit rays are calculated using a face shading algorithm. + The reflected fluxes are considered diffusive and use a view factors method + to deposit the energy on "visible" walls. 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 + the energy Equation (wallCoupled = false). On coupled patches the flux is + by default added to the wall and considered into the solid + (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 + radiation models but only using a single band spectrum. On the + corresponding BC's for these models the flag "solarLoad" must be set to + true. + + +SourceFiles + solarLoad.C + +\*---------------------------------------------------------------------------*/ + +#ifndef radiationModelsolarLoad_H +#define radiationModelsolarLoad_H + +#include "radiationModel.H" +#include "singleCellFvMesh.H" +#include "scalarListIOList.H" +#include "volFields.H" +#include "faceShading.H" +#include "solarCalculator.H" +#include "IOmapDistribute.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ + +/*---------------------------------------------------------------------------*\ + Class solarLoad Declaration +\*---------------------------------------------------------------------------*/ + +class solarLoad +: + public radiationModel +{ +protected: + + // Static data + + //- Static name for view factor walls + static const word viewFactorWalls; + + +private: + + // Private data + + + //- Agglomeration List + labelListIOList finalAgglom_; + + //- Coarse mesh + autoPtr<singleCellFvMesh> coarseMesh_; + + //- Net radiative heat flux [W/m2] + volScalarField Qr_; + + //- Secondary solar radiative heat flux [W/m2] + volScalarField QsecondRad_; + + //- Direct hit faces Ids + autoPtr<faceShading> hitFaces_; + + //- Constant source term + DimensionedField<scalar, volMesh> Ru_; + + //- Solar calculator + solarCalculator solarCalc_; + + //- Vertical direction (Default is g vector) + vector verticalDir_; + + //- Include diffuse reflected heat fluxes from direct heat flux + bool useVFbeamToDiffuse_; + + //- Selected patches to apply solar load + labelList includePatches_; + + //- Chached coarse to fine mapping for coarse mesh + List<labelListList> coarseToFine_; + + //-Number of bands + label nBands_; + + //- Spectral distribution for the integrated solar heat flux + scalarList spectralDistribution_; + + //- Map distribute + autoPtr<IOmapDistribute> map_; + + //- Face-compact map + labelListIOList visibleFaceFaces_; + + //- Couple solids through mapped boundary patch using Qr (default:true) + bool solidCoupled_; + + //- Couple wall patches using Qr (default:false) + bool wallCoupled_; + + //- Absorptivity list + List<List<tmp<scalarField> > > absorptivity_; + + //- Update absorptivity + bool updateAbsorptivity_; + + //- First iteration + bool firstIter_; + + //- Update Sun position index + label updateTimeIndex_; + + + // Private Member Functions + + + //- Initialise + void initialise(const dictionary&); + + //- Update direct hit faces radiation + void updateDirectHitRadiation(const labelList&, const labelHashSet&); + + //- Calculate diffusive heat flux + void calculateQdiff(const labelHashSet&, const labelHashSet&); + + //- Update Sky diffusive radiation + void updateSkyDiffusiveRadiation + ( + const labelHashSet&, + const labelHashSet& + ); + + //- Update hit faces + bool updateHitFaces(); + + //- Update absorptivity + void updateAbsorptivity(const labelHashSet& includePatches); + + //- Disallow default bitwise copy construct + solarLoad(const solarLoad&); + + //- Disallow default bitwise assignment + void operator=(const solarLoad&); + + +public: + + //- Runtime type information + TypeName("solarLoad"); + + + // Constructors + + //- Construct from volScalarField + solarLoad(const volScalarField& T); + + //- Construct from dictionary and volScalarField + 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 + virtual ~solarLoad(); + + + // Member functions + + // Edit + + //- Solve + void calculate(); + + //- Read radiation properties dictionary + bool read(); + + //- Source term component (for power of T^4) + virtual tmp<volScalarField> Rp() const; + + //- Source term component (constant) + virtual tmp<DimensionedField<scalar, volMesh> > Ru() const; + + + // Access + + //- Number of bands + label nBands() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radiation +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C index 286218ee24e8080e92c1cd0e2d1b5e312c562062..9ef90cd5eed4520946ae6aa630e07439f7834249 100644 --- a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C +++ b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C @@ -29,6 +29,7 @@ License #include "greyDiffusiveViewFactorFixedValueFvPatchScalarField.H" #include "typeInfo.H" #include "addToRunTimeSelectionTable.H" +#include "boundaryRadiationProperties.H" using namespace Foam::constant; @@ -43,30 +44,22 @@ namespace Foam } } +const Foam::word Foam::radiation::viewFactor::viewFactorWalls + = "viewFactorWall"; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::radiation::viewFactor::initialise() { const polyBoundaryMesh& coarsePatches = coarseMesh_.boundaryMesh(); - const volScalarField::GeometricBoundaryField& Qrp = Qr_.boundaryField(); - label count = 0; - forAll(Qrp, patchI) + selectedPatches_ = mesh_.boundaryMesh().findIndices(viewFactorWalls); + forAll(selectedPatches_, i) { - //const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const fvPatchScalarField& QrPatchI = Qrp[patchI]; - - if ((isA<fixedValueFvPatchScalarField>(QrPatchI))) - { - selectedPatches_[count] = QrPatchI.patch().index(); - nLocalCoarseFaces_ += coarsePatches[patchI].size(); - count++; - } + const label patchI = selectedPatches_[i]; + nLocalCoarseFaces_ += coarsePatches[patchI].size(); } - selectedPatches_.resize(count--); - if (debug) { Pout<< "radiation::viewFactor::initialise() Selected patches:" @@ -84,52 +77,19 @@ void Foam::radiation::viewFactor::initialise() << "Total number of clusters : " << totalNCoarseFaces_ << endl; } - labelListIOList subMap - ( - IOobject - ( - "subMap", - mesh_.facesInstance(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); - - labelListIOList constructMap - ( - IOobject - ( - "constructMap", - mesh_.facesInstance(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); - - IOList<label> consMapDim - ( - IOobject - ( - "constructMapDim", - mesh_.facesInstance(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); - map_.reset ( - new mapDistribute + new IOmapDistribute ( - consMapDim[0], - Xfer<labelListList>(subMap), - Xfer<labelListList>(constructMap) + IOobject + ( + "mapDist", + mesh_.facesInstance(), + mesh_, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) ) ); @@ -235,6 +195,30 @@ void Foam::radiation::viewFactor::initialise() pivotIndices_.setSize(CLU_().n()); } } + + if (this->found("useSolarLoad")) + { + this->lookup("useSolarLoad") >> useSolarLoad_; + } + + if (useSolarLoad_) + { + const dictionary& solarDict = this->subDict("solarLoarCoeffs"); + solarLoad_.reset + ( + new solarLoad(solarDict, T_, externalRadHeatFieldName_) + ); + + if (solarLoad_->nBands() > 1) + { + FatalErrorInFunction + << "Requested solar radiation with fvDOM. Using " + << "more thant one band for the solar load is not allowed" + << abort(FatalError); + } + + Info<< "Creating Solar Load Model " << nl; + } } @@ -260,7 +244,7 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) ( IOobject ( - mesh_.name(), + "coarse:" + mesh_.name(), mesh_.polyMesh::instance(), mesh_.time(), IOobject::NO_READ, @@ -288,7 +272,9 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) nLocalCoarseFaces_(0), constEmissivity_(false), iterCounter_(0), - pivotIndices_(0) + pivotIndices_(0), + useSolarLoad_(false), + solarLoad_() { initialise(); } @@ -318,7 +304,7 @@ Foam::radiation::viewFactor::viewFactor ( IOobject ( - mesh_.name(), + "coarse:" + mesh_.name(), mesh_.polyMesh::instance(), mesh_.time(), IOobject::NO_READ, @@ -346,7 +332,9 @@ Foam::radiation::viewFactor::viewFactor nLocalCoarseFaces_(0), constEmissivity_(false), iterCounter_(0), - pivotIndices_(0) + pivotIndices_(0), + useSolarLoad_(false), + solarLoad_() { initialise(); } @@ -401,6 +389,11 @@ void Foam::radiation::viewFactor::calculate() // Store previous iteration Qr_.storePrevIter(); + if (useSolarLoad_) + { + solarLoad_->calculate(); + } + scalarField compactCoarseT(map_->constructSize(), 0.0); scalarField compactCoarseE(map_->constructSize(), 0.0); scalarField compactCoarseHo(map_->constructSize(), 0.0); @@ -412,6 +405,9 @@ void Foam::radiation::viewFactor::calculate() DynamicList<scalar> localCoarseEave(nLocalCoarseFaces_); DynamicList<scalar> localCoarseHoave(nLocalCoarseFaces_); + const boundaryRadiationProperties& boundaryRadiation = + boundaryRadiationProperties::New(mesh_); + forAll(selectedPatches_, i) { label patchID = selectedPatches_[i]; @@ -427,9 +423,11 @@ void Foam::radiation::viewFactor::calculate() greyDiffusiveViewFactorFixedValueFvPatchScalarField >(QrPatch); - const scalarList eb = Qrp.emissivity(); + const tmp<scalarField> teb = boundaryRadiation.emissivity(patchID); + const scalarField& eb = teb(); - const scalarList& Hoi = Qrp.Qro(); + const tmp<scalarField> tHoi = Qrp.Qro(); + const scalarField& Hoi = tHoi(); const polyPatch& pp = coarseMesh_.boundaryMesh()[patchID]; const labelList& coarsePatchFace = coarseMesh_.patchFaceMap()[patchID]; diff --git a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.H b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.H index dc6c6125167a87689366a8170076d63506c9fae3..bbeb69b7ed2f2aa1fa1f442188fe8b8a2febbe08 100644 --- a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.H +++ b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.H @@ -50,8 +50,9 @@ SourceFiles #include "scalarMatrices.H" #include "globalIndex.H" #include "scalarListIOList.H" -#include "mapDistribute.H" #include "volFields.H" +#include "IOmapDistribute.H" +#include "solarLoad.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -68,13 +69,21 @@ class viewFactor : public radiationModel { +protected: + +// Static data + + //- Static name for view factor walls + static const word viewFactorWalls; + + // Private data //- Agglomeration List labelListIOList finalAgglom_; //- Map distributed - autoPtr<mapDistribute> map_; + autoPtr<IOmapDistribute> map_; //- Coarse mesh singleCellFvMesh coarseMesh_; @@ -106,6 +115,12 @@ class viewFactor //- Pivot Indices for LU decomposition labelList pivotIndices_; + //- Use Solar Load model + bool useSolarLoad_; + + //- Solar load radiation model + autoPtr<solarLoad> solarLoad_; + // Private Member Functions diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C index 985935df96f6a79795095171664f3431f84a7860..d697bfa91461742278f323c989af6fc91cd03e70 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C @@ -172,7 +172,6 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission << iter.key() << nl << " is not found " << nl << exit(FatalError); - } } } diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C index 14497374c0a31e7cf44c0759f73045a7b58fe4d6..32d5c52114488341299205b58c8935f2bc6bf157 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,8 +26,6 @@ License #include "greyMeanSolidAbsorptionEmission.H" #include "addToRunTimeSelectionTable.H" #include "unitConversion.H" -#include "zeroGradientFvPatchFields.H" - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.H index 09a6df1c99a35336322c3f52e2d4a13202cd3a6a..4ea4d1e5f52be989b557fdd9bfb828031faac1c0 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.H +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,7 @@ Class Description greyMeanSolidAbsorptionEmission radiation absorption and emission - coefficients for continuous phase - - The coefficients for the species in the Look up table have to be specified - for use in moles x P [atm], i.e. (k[i] = species[i]*p*9.869231e-6). - - The coefficients for CO and soot or any other added are multiplied by the - respective mass fraction being solved - - All the species in the dictionary need either to be in the look-up table or - being solved. Conversely, all the species solved do not need to be included - in the calculation of the absorption coefficient - - The names of the species in the absorption dictionary must match exactly the - name in the look-up table or the name of the field being solved + coefficients for solid mixture SourceFiles greyMeanSolidAbsorptionEmission.C @@ -52,6 +39,7 @@ SourceFiles #include "absorptionEmissionModel.H" #include "solidThermo.H" #include "basicSpecieMixture.H" +#include "zeroGradientFvPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.C new file mode 100644 index 0000000000000000000000000000000000000000..31942309d9a0a809ada5f87442102a660a601434 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "multiBandSolidAbsorptionEmission.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiation + { + defineTypeNameAndDebug(multiBandSolidAbsorptionEmission, 0); + + addToRunTimeSelectionTable + ( + absorptionEmissionModel, + multiBandSolidAbsorptionEmission, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiation::multiBandSolidAbsorptionEmission:: +multiBandSolidAbsorptionEmission +( + const dictionary& dict, + const fvMesh& mesh +) +: + absorptionEmissionModel(dict, mesh), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + absCoeffs_(maxBands_), + emiCoeffs_(maxBands_), + nBands_(0) +{ + coeffsDict_.lookup("absorptivity") >> absCoeffs_; + coeffsDict_.lookup("emissivity") >> emiCoeffs_; + nBands_ = absCoeffs_.size(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiation::multiBandSolidAbsorptionEmission:: +~multiBandSolidAbsorptionEmission() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::radiation::multiBandSolidAbsorptionEmission::aCont +( + const label bandI +) const +{ + tmp<volScalarField> ta + ( + new volScalarField + ( + IOobject + ( + "a", + mesh().time().timeName(), + mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh(), + dimensionedScalar("a", dimless/dimLength, absCoeffs_[bandI]) + ) + ); + + return ta; +} + + +Foam::tmp<Foam::volScalarField> +Foam::radiation::multiBandSolidAbsorptionEmission::eCont +( + const label bandI +) const +{ + tmp<volScalarField> te + ( + new volScalarField + ( + IOobject + ( + "e", + mesh().time().timeName(), + mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh(), + dimensionedScalar("e", dimless/dimLength, emiCoeffs_[bandI]) + ) + ); + + return te; +} + + +Foam::tmp<Foam::volScalarField> +Foam::radiation::multiBandSolidAbsorptionEmission::ECont +( + const label bandI +) const +{ + tmp<volScalarField> E + ( + new volScalarField + ( + IOobject + ( + "E", + mesh().time().timeName(), + mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh(), + dimensionedScalar("E", dimMass/dimLength/pow3(dimTime), 0.0) + ) + ); + + return E; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.H new file mode 100644 index 0000000000000000000000000000000000000000..3a439a36b393f291cf5e9f19f97d5bc77d961a42 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.H @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::radiation::multiBandSolidAbsorptionEmission + +Description + + multiBandSolidAbsorptionEmission radiation absorption/emission for solids. + + +SourceFiles + multiBandSolidAbsorptionEmission.C + +\*---------------------------------------------------------------------------*/ + +#ifndef multiBandSolidAbsorptionEmission_H +#define multiBandSolidAbsorptionEmission_H + +#include "absorptionEmissionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ + +/*---------------------------------------------------------------------------*\ + Class multiBandSolidAbsorptionEmission Declaration +\*---------------------------------------------------------------------------*/ + +class multiBandSolidAbsorptionEmission +: + public absorptionEmissionModel +{ +public: + + // Public data + + //- Maximum number of bands + static const int maxBands_ = 5; + + +private: + + // Private data + + //- Absorption model dictionary + dictionary coeffsDict_; + + //- Absorption coefficients + scalarList absCoeffs_; + + //- Emissivity coefficients + scalarList emiCoeffs_; + + //- Bands + label nBands_; + + +public: + + //- Runtime type information + TypeName("multiBandSolidAbsorptionEmission"); + + + // Constructors + + //- Construct from components + multiBandSolidAbsorptionEmission + ( + const dictionary& dict, + const fvMesh& mesh + ); + + + //- Destructor + virtual ~multiBandSolidAbsorptionEmission(); + + + // Member Functions + + // Access + + // Absorption coefficient + + //- Absorption coefficient + tmp<volScalarField> aCont(const label bandI) const; + + + // Emission coefficient + + //- Emission coefficient + tmp<volScalarField> eCont(const label bandI) const; + + + // Emission contribution + + //- Emission contribution + tmp<volScalarField> ECont(const label bandI) const; + + + inline bool isGrey() const + { + return false; + } + + //- Number of bands + inline label nBands() const + { + return nBands_; + } + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radiation +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C new file mode 100644 index 0000000000000000000000000000000000000000..3fd5468da7137185b2eae7ce5e2b7b5a7782e184 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C @@ -0,0 +1,207 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "boundaryRadiationProperties.H" +#include "boundaryRadiationPropertiesFvPatchField.H" +#include "fvPatchField.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiation + { + defineTypeNameAndDebug(boundaryRadiationProperties, 0); + } +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::IOobject Foam::radiation::boundaryRadiationProperties::createIOobject +( + const fvMesh& mesh, const word name +) const +{ + IOobject io + ( + name, + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (io.headerOk()) + { + io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; + return io; + } + else + { + io.readOpt() = IOobject::NO_READ; + return io; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties +( + const fvMesh& mesh +) +: + MeshObject + < + fvMesh, + Foam::GeometricMeshObject, + boundaryRadiationProperties + >(mesh), + radBoundaryProperties_() +{ + const IOobject boundaryIO + ( + createIOobject(mesh, boundaryRadiationProperties::typeName) + ); + + if (boundaryIO.readOpt() == IOobject::MUST_READ_IF_MODIFIED) + { + radBoundaryProperties_.set + ( + new volScalarField(boundaryIO, mesh) + ); + } +} + + +// * * * * * * * * * * * * * * * Member fucntions * * * * * * * * * * * * * // + +const Foam::volScalarField& Foam::radiation::boundaryRadiationProperties:: +radBoundaryProperties() const +{ + return radBoundaryProperties_(); +} + + +Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: +emissivity(const label index, const label bandI) const +{ + if (!radBoundaryProperties_.empty()) + { + return refCast<const boundaryRadiationPropertiesFvPatchField> + ( + radBoundaryProperties_->boundaryField()[index] + ).emissivity(bandI); + } + else + { + FatalErrorInFunction + << "Field 'boundaryRadiationProperties'" + << "is not found in the constant directory." + << "Please add it " + << exit(FatalError); + + return tmp<scalarField>(new scalarField()); + } +} + + +Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: +absorptivity(const label index, const label bandI) const +{ + if (!radBoundaryProperties_.empty()) + { + return refCast<const boundaryRadiationPropertiesFvPatchField> + ( + radBoundaryProperties_->boundaryField()[index] + ).absorptivity(bandI); + } + else + { + FatalErrorInFunction + << "Field 'boundaryRadiationProperties'" + << "is not found in the constant directory." + << "Please add it " + << exit(FatalError); + + return tmp<scalarField>(new scalarField()); + } +} + + +Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: +transmissivity(const label index, const label bandI) const +{ + if (!radBoundaryProperties_.empty()) + { + return refCast<const boundaryRadiationPropertiesFvPatchField> + ( + radBoundaryProperties_->boundaryField()[index] + ).transmissivity(bandI); + } + else + { + FatalErrorInFunction + << "Field 'boundaryRadiationProperties'" + << "is not found in the constant directory." + << "Please add it " + << exit(FatalError); + + return tmp<scalarField>(new scalarField()); + } +} + + +Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: +reflectivity(const label index, const label bandI) const +{ + if (!radBoundaryProperties_.empty()) + { + return refCast<const boundaryRadiationPropertiesFvPatchField> + ( + radBoundaryProperties_->boundaryField()[index] + ).reflectivity(bandI); + } + else + { + FatalErrorInFunction + << "Field 'boundaryRadiationProperties'" + << "is not found in the constant directory." + << "Please add it " + << exit(FatalError); + + return tmp<scalarField>(new scalarField()); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiation::boundaryRadiationProperties::~boundaryRadiationProperties() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.H b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.H new file mode 100644 index 0000000000000000000000000000000000000000..0bb1cc4d8d531bcb344dc764d8661adec9c25fe9 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::fv::boundaryRadiationProperties + +Description + Boundary radiation properties holder + + +SourceFiles + boundaryRadiationProperties.C + +\*---------------------------------------------------------------------------*/ + +#ifndef boundaryRadiationProperties_H +#define boundaryRadiationProperties_H + +#include "MeshObject.H" +#include "GeometricField.H" +#include "volMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class fvMesh; + +namespace radiation +{ + +/*---------------------------------------------------------------------------*\ + Class boundaryRadiationProperties Declaration +\*---------------------------------------------------------------------------*/ + +class boundaryRadiationProperties +: + public MeshObject + < + fvMesh, + Foam::GeometricMeshObject, + boundaryRadiationProperties + > +{ + + // Private data + + //- AutoPtr to volSacalarField properties + autoPtr<volScalarField> radBoundaryProperties_; + + + // Private member functions + + //- Create IO object if dictionary is present + IOobject createIOobject(const fvMesh& mesh, const word) const; + + +public: + + // Declare name of the class and its debug switch + TypeName("boundaryRadiationProperties"); + + + // Constructors + + //- Construct given fvMesh and IOobject + boundaryRadiationProperties(const fvMesh&); + + + // Member Functions + + //- Access boundary emissivity on patch + tmp<scalarField> emissivity + ( + const label patchId, + const label bandI = 0 + ) const; + + + //- Access boundary absorptivity on patch + tmp<scalarField> absorptivity + ( + const label patchId, + const label bandI = 0 + ) const; + + + //- Access boundary transmissivity on patch + tmp<scalarField> transmissivity + ( + const label patchId, + const label bandI = 0 + ) const; + + //- Access boundary reflectivity on patch + tmp<scalarField> reflectivity + ( + const label patchId, + const label bandI = 0 + ) const; + + + //- Access to radBoundaryProperties + const volScalarField& radBoundaryProperties() const; + + + //- Destructor + virtual ~boundaryRadiationProperties(); + +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radiation +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C new file mode 100644 index 0000000000000000000000000000000000000000..08abcf2853a29b8b077694c9e9834f00d55ab1a0 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C @@ -0,0 +1,292 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "solarCalculator.H" +#include "Time.H" +#include "unitConversion.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(solarCalculator, 0); + + template<> + const char* NamedEnum + < + solarCalculator::sunDirModel, + 2 + >::names[] = + { + "sunDirConstant", + "sunDirTraking" + }; + + template<> + const char* NamedEnum + < + solarCalculator::sunLModel, + 3 + >::names[] = + { + "sunLoadConstant", + "sunLoadFairWeatherConditions", + "sunLoadTheoreticalMaximum" + }; +} + +const Foam::NamedEnum<Foam::solarCalculator::sunDirModel, 2> + Foam::solarCalculator::sunDirectionModelTypeNames_; + +const Foam::NamedEnum<Foam::solarCalculator::sunLModel, 3> + Foam::solarCalculator::sunLoadModelTypeNames_; + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::solarCalculator::calculateBetaTetha() +{ + scalar runTime = 0.0; + switch (sunDirectionModel_) + { + case mSunDirTraking: + { + runTime = mesh_.time().value(); + break; + } + case mSunDirConstant: + { + break; + } + } + + scalar LSM = 15.0*(readScalar(dict_.lookup("localStandardMeridian"))); + + scalar D = readScalar(dict_.lookup("startDay")) + runTime/86400.0; + scalar M = 6.24004 + 0.0172*D; + scalar EOT = -7.659*sin(M) + 9.863*sin(2*M + 3.5932); + + startTime_ = readScalar(dict_.lookup("startTime")); + scalar LST = startTime_ + runTime/3600.0; + + scalar LON = readScalar(dict_.lookup("longitude")); + + scalar AST = LST + EOT/60.0 + (LON - LSM)/15; + + scalar delta = 23.45*sin(degToRad((360*(284 + D))/365)); + + scalar H = degToRad(15*(AST - 12)); + + scalar L = degToRad(readScalar(dict_.lookup("latitude"))); + + scalar deltaRad = degToRad(delta); + beta_ = max(asin(cos(L)*cos(deltaRad)*cos(H) + sin(L)*sin(deltaRad)), 1e-3); + tetha_ = acos((sin(beta_)*sin(L) - sin(deltaRad))/(cos(beta_)*cos(L))); + + if (debug) + { + Info << tab << "altitude : " << radToDeg(beta_) << endl; + Info << tab << "azimuth : " << radToDeg(tetha_) << endl; + } +} + + +void Foam::solarCalculator::calculateSunDirection() +{ + + dict_.lookup("gridUp") >> gridUp_; + gridUp_ /= mag(gridUp_); + + dict_.lookup("gridEast") >> eastDir_; + eastDir_ /= mag(eastDir_); + + coord_.reset + ( + new coordinateSystem("grid", vector::zero, gridUp_, eastDir_) + ); + + direction_.z() = -sin(beta_); + direction_.y() = cos(beta_)*cos(tetha_); //North + direction_.x() = cos(beta_)*sin(tetha_); //East + + direction_ /= mag(direction_); + + if (debug) + { + Info<< "Sun direction in absolute coordinates : " << direction_ <<endl; + } + + direction_ = coord_->R().transform(direction_); + + if (debug) + { + Info<< "Sun direction in the Grid coordinates : " << direction_ <<endl; + } +} + + +void Foam::solarCalculator::init() +{ + switch (sunDirectionModel_) + { + case mSunDirConstant: + { + if (dict_.found("sunDirection")) + { + dict_.lookup("sunDirection") >> direction_; + direction_ /= mag(direction_); + } + else + { + calculateBetaTetha(); + calculateSunDirection(); + } + + break; + } + case mSunDirTraking: + { + if (word(mesh_.ddtScheme("default")) == "steadyState") + { + FatalErrorInFunction + << " Sun direction model can not be sunDirtracking if the " + << " case is steady " << nl << exit(FatalError); + } + + dict_.lookup("sunTrackingUpdateInterval") >> + sunTrackingUpdateInterval_; + + calculateBetaTetha(); + calculateSunDirection(); + break; + } + } + + switch (sunLoadModel_) + { + case mSunLoadConstant: + { + dict_.lookup("directSolarRad") >> directSolarRad_; + dict_.lookup("diffuseSolarRad") >> diffuseSolarRad_; + break; + } + case mSunLoadFairWeatherConditions: + { + A_ = readScalar(dict_.lookup("A")); + B_ = readScalar(dict_.lookup("B")); + + if (dict_.found("beta")) + { + dict_.lookup("beta") >> beta_; + } + else + { + calculateBetaTetha(); + } + + directSolarRad_ = A_/exp(B_/sin(beta_)); + + groundReflectivity_ = + readScalar(dict_.lookup("groundReflectivity")); + + break; + } + case mSunLoadTheoreticalMaximum: + { + Setrn_ = readScalar(dict_.lookup("Setrn")); + SunPrime_ = readScalar(dict_.lookup("SunPrime")); + directSolarRad_ = Setrn_*SunPrime_; + + groundReflectivity_ = + readScalar(dict_.lookup("groundReflectivity")); + break; + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solarCalculator::solarCalculator +( + const dictionary& dict, + const fvMesh& mesh +) +: + mesh_(mesh), + dict_(dict), + direction_(vector::zero), + directSolarRad_(0.0), + diffuseSolarRad_(0.0), + groundReflectivity_(0.0), + A_(0.0), + B_(0.0), + beta_(0.0), + tetha_(0.0), + Setrn_(0.0), + SunPrime_(0.0), + C_(readScalar(dict.lookup("C"))), + sunDirectionModel_ + ( + sunDirectionModelTypeNames_.read(dict.lookup("sunDirectionModel")) + ), + sunLoadModel_ + ( + sunLoadModelTypeNames_.read(dict.lookup("sunLoadModel")) + ), + coord_() +{ + init(); +} + + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::solarCalculator::~solarCalculator() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::solarCalculator::correctSunDirection() +{ + switch (sunDirectionModel_) + { + case mSunDirConstant: + { + break; + } + case mSunDirTraking: + { + calculateBetaTetha(); + calculateSunDirection(); + directSolarRad_ = A_/exp(B_/sin(max(beta_, ROOTVSMALL))); + break; + } + } +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H new file mode 100644 index 0000000000000000000000000000000000000000..5c54294d967c71385271050754380ad213a1f4cb --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H @@ -0,0 +1,323 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::solarCalculator + +Description + The solar calculator model provides information about the Sun direction + and Sun load model. The available models are: + + For the Sun direction: + 1) SunDirConstant : the direction is given in 'sunDirection' + 2) SunDirTraking : the direction is calculated from the following + parameters: + localStandardMeridian : GMT (Local Zone Meridian) in hours + startDay : day from 1 to 365) + startTime: in hours + longitude: in degrees + latitude: in degrees + gridUp: grid orientation upwards + gridEast grid orientation eastwards + + This model should be use in transient calculations. + The keyword 'sunTrackingUpdateInterval' (in hours) specifies on which + interval is the Sun direction updated. + + + Solar Load models available: + 1) SunLoadConstant: direct and diffusive heat fluxes are provided by the + entries 'directSolarRad' and 'diffuseSolarRad' + + 2) SunLoadFairWeatherConditions: The solar fluxes are calculated following + the Fair Weather Conditions Method from the ASHRAE Handbook. The entries + are: + A : Apparent solar irradiation at air mass m = 0 + B : Atmospheric extinction coefficient + beta: Solar altitude (in degrees) above the horizontal. This + can be read or calculated providing the respective parameters + for Sun position explained above. + groundReflectivity : ground reflectivity + + In this model the flux is calculated as: + + directSolarRad = A/exp(B/sin(beta)); + + 3) SunLoadTheoreticalMaximum: The entries are: + Setrn + SunPrime: + groundReflectivity : ground reflectivity + + In this model the flux is calculated as: + + directSolarRad = Setrn*SunPrime; + + The diffuse on vertical/horizontal walls and ground-reflected radiation are + calculated following the ASHRAE Handbook. + + +SourceFiles + solarCalculator.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solarCalculator_H +#define solarCalculator_H + +#include "fvMesh.H" +#include "meshTools.H" +#include "DynamicField.H" +#include "HashSet.H" +#include "coordinateSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class solarCalculator Declaration +\*---------------------------------------------------------------------------*/ + +class solarCalculator +{ +public: + + // Public enumeration + + //- Sun direction models + enum sunDirModel + { + mSunDirConstant, + mSunDirTraking + }; + + //- Direct sun load models + enum sunLModel + { + mSunLoadConstant, + mSunLoadFairWeatherConditions, + mSunLoadTheoreticalMaximum + }; + + +protected: + + //- Sun direction models + static const NamedEnum<sunDirModel, 2> sunDirectionModelTypeNames_; + + //- Sun load models + static const NamedEnum<sunLModel, 3> sunLoadModelTypeNames_; + +private: + + // Private data + + + //- Reference to mesh + const fvMesh& mesh_; + + //- Dictionary + dictionary dict_; + + //- Direction + vector direction_; + + //- Direct solar irradiation + scalar directSolarRad_; + + //- Diffuse solar irradiation on vertical surfaces + scalar diffuseSolarRad_; + + //- Ground reflectivity + scalar groundReflectivity_; + + //- Fair weather direct solar load model parameters + scalar A_; + scalar B_; + scalar beta_; + scalar tetha_; + + + //- Maximum theoretical direct solar load model parameters + scalar Setrn_; + scalar SunPrime_; + + + //- Diffusive solar load model parameters + scalar C_; + + //- Sun direction model + sunDirModel sunDirectionModel_; + + //- Sun load model + sunLModel sunLoadModel_; + + //- Grid coordinate system + autoPtr<coordinateSystem> coord_; + + //- East grid orientation + vector eastDir_; + + //- Up grid orientation + vector gridUp_; + + //- Interval in decimal hours to update Sun direction for SunDirTraking + scalar sunTrackingUpdateInterval_; + + //- Start time for the Sun position (decimal hours) + scalar startTime_; + + + //- Disallow default bitwise copy construct + solarCalculator(const solarCalculator&); + + //- Disallow default bitwise assignment + void operator=(const solarCalculator&); + + + // Private members + + //- Init + void init(); + + //- Calculate beta and tetha angles + void calculateBetaTetha(); + + //- Calculate Sun direction + void calculateSunDirection(); + + +public: + + // Declare name of the class and its debug switch + ClassName("solarCalculator"); + + + // Constructors + + //- Construct from dictionary + solarCalculator(const dictionary&, const fvMesh&); + + + //- Destructor + ~solarCalculator(); + + + // Member Functions + + // Access + + //- const acess to direction + const vector direction() const + { + return direction_; + } + + //- Non-const access to direction + vector& direction() + { + return direction_; + } + + //- Return direct solar irradiation + scalar directSolarRad() + { + return directSolarRad_; + } + + //- Return diffuse solar irradiation + scalar diffuseSolarRad() + { + return diffuseSolarRad_; + } + + //- Return C consntant + scalar C() + { + return C_; + } + + //- Return beta + scalar beta() + { + return beta_; + } + + //- Return tetha + scalar tetha() + { + return tetha_; + } + + //- Return Sun direction model + sunDirModel sunDirectionModel() const + { + return sunDirectionModel_; + } + + //- Return Sun load model + sunLModel sunLoadModel() const + { + return sunLoadModel_; + } + + //- Return groundReflectivity + scalar groundReflectivity() + { + return groundReflectivity_; + } + + //- Return coordinateSystem + const coordinateSystem& coord() + { + return coord_(); + } + + //- Return sunTrackingUpdateInterval + scalar sunTrackingUpdateInterval() + { + return sunTrackingUpdateInterval_; + } + + //- Return startTime + scalar startTime() + { + return startTime_; + } + + + //- Recalculate + void correctSunDirection(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/constantTransmissivity/constantTransmissivity.C b/src/thermophysicalModels/radiation/submodels/transmissivityModel/constantTransmissivity/constantTransmissivity.C new file mode 100644 index 0000000000000000000000000000000000000000..a981883006e0ab6f3c478ec5354de52335d40a1d --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/constantTransmissivity/constantTransmissivity.C @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "constantTransmissivity.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiation + { + defineTypeNameAndDebug(constantTransmissivity, 0); + + addToRunTimeSelectionTable + ( + transmissivityModel, + constantTransmissivity, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiation::constantTransmissivity::constantTransmissivity +( + const dictionary& dict, + const fvMesh& mesh +) +: + transmissivityModel(dict, mesh), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + tau_(readScalar(coeffsDict_.lookup("transmissivity"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiation::constantTransmissivity::~constantTransmissivity() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::radiation::constantTransmissivity::tauEff(const label bandI) const +{ + tmp<volScalarField> tt + ( + new volScalarField + ( + IOobject + ( + "tau", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh_, + dimensionedScalar("tau", dimless/dimLength, tau_) + ) + ); + + return tt; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/constantTransmissivity/constantTransmissivity.H b/src/thermophysicalModels/radiation/submodels/transmissivityModel/constantTransmissivity/constantTransmissivity.H new file mode 100644 index 0000000000000000000000000000000000000000..7f2d2bfb87313fc7117d559d983c035645b567fb --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/constantTransmissivity/constantTransmissivity.H @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::radiation::constantTransmissivity + +Description + Constant radiation scatter coefficient + +SourceFiles + constantTransmissivity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef radiationConstantTransmissivity_H +#define radiationConstantTransmissivity_H + +#include "transmissivityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ + +/*---------------------------------------------------------------------------*\ + Class constantTransmissivity Declaration +\*---------------------------------------------------------------------------*/ + +class constantTransmissivity +: + public transmissivityModel +{ + + // Private data + + //- Coefficients dictionary + dictionary coeffsDict_; + + //- Transmissivity coefficient / [] + scalar tau_; + + +public: + + //- Runtime type information + TypeName("constantTransmissivity"); + + + // Constructors + + //- Construct from components + constantTransmissivity(const dictionary& dict, const fvMesh& mesh); + + + //- Destructor + virtual ~constantTransmissivity(); + + + // Member Functions + + //- Return scatter coefficient + tmp<volScalarField> tauEff(const label bandI = 0) const; + + + //- Is Grey + inline bool isGrey() const + { + return true; + } + + + //- Number of bands + inline label nBands() const + { + return 1; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radiation +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/multiBandSolidTransmissivity/multiBandSolidTransmissivity.C b/src/thermophysicalModels/radiation/submodels/transmissivityModel/multiBandSolidTransmissivity/multiBandSolidTransmissivity.C new file mode 100644 index 0000000000000000000000000000000000000000..d39fa2e1d45df4e16d646bf33b2a876f36a84e80 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/multiBandSolidTransmissivity/multiBandSolidTransmissivity.C @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "multiBandSolidTransmissivity.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiation + { + defineTypeNameAndDebug(multiBandSolidTransmissivity, 0); + + addToRunTimeSelectionTable + ( + transmissivityModel, + multiBandSolidTransmissivity, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiation::multiBandSolidTransmissivity::multiBandSolidTransmissivity +( + const dictionary& dict, + const fvMesh& mesh +) +: + transmissivityModel(dict, mesh), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + tauCoeffs_(), + nBands_(0) +{ + coeffsDict_.lookup("transmissivity") >> tauCoeffs_; + nBands_ = tauCoeffs_.size(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiation::multiBandSolidTransmissivity::~multiBandSolidTransmissivity() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::radiation::multiBandSolidTransmissivity::tauEff(const label bandI) const +{ + tmp<volScalarField> tt + ( + new volScalarField + ( + IOobject + ( + "t", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("t", dimless/dimLength, tauCoeffs_[bandI]) + ) + ); + + return tt; +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/multiBandSolidTransmissivity/multiBandSolidTransmissivity.H b/src/thermophysicalModels/radiation/submodels/transmissivityModel/multiBandSolidTransmissivity/multiBandSolidTransmissivity.H new file mode 100644 index 0000000000000000000000000000000000000000..85e0a589e65765e0dcb63064fa8252f0b5f629a9 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/multiBandSolidTransmissivity/multiBandSolidTransmissivity.H @@ -0,0 +1,132 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::radiation::multiBandSolidTransmissivity + +Description + + multiBandSolidTransmissivity radiation transmissivity for solids. + + +SourceFiles + multiBandSolidTransmissivity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef multiBandSolidTransmissivity_H +#define multiBandSolidTransmissivity_H + +#include "transmissivityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ + +/*---------------------------------------------------------------------------*\ + Class multiBandSolidTransmissivity Declaration +\*---------------------------------------------------------------------------*/ + +class multiBandSolidTransmissivity +: + public transmissivityModel +{ +public: + + // Public data + + //- Maximum number of bands + static const label maxBands_ = 5; + + +private: + + // Private data + + //- Absorption model dictionary + dictionary coeffsDict_; + + //- Absorption coefficients + scalarList tauCoeffs_; + + //- Bands + label nBands_; + + +public: + + //- Runtime type information + TypeName("multiBandSolidTransmissivity"); + + + // Constructors + + //- Construct from components + multiBandSolidTransmissivity + ( + const dictionary& dict, + const fvMesh& mesh + ); + + + //- Destructor + virtual ~multiBandSolidTransmissivity(); + + + // Member Functions + + // Access + + //- Transmissivity coefficient + tmp<volScalarField> tauEff(const label bandI) 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 + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/noTransmissivity/noTransmissivity.C b/src/thermophysicalModels/radiation/submodels/transmissivityModel/noTransmissivity/noTransmissivity.C new file mode 100644 index 0000000000000000000000000000000000000000..6d995d89f0263205fe719238aa29bac87e485a54 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/noTransmissivity/noTransmissivity.C @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "noTransmissivity.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiation + { + defineTypeNameAndDebug(noTransmissivity, 0); + addToRunTimeSelectionTable + ( + transmissivityModel, + noTransmissivity, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiation::noTransmissivity::noTransmissivity +( + const dictionary& dict, + const fvMesh& mesh +) +: + transmissivityModel(dict, mesh) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiation::noTransmissivity::~noTransmissivity() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> Foam::radiation::noTransmissivity::tauEff +( + const label bandI +) const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "tau", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh_, + dimensionedScalar("zero", dimless, 0.0) + ) + ); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/noTransmissivity/noTransmissivity.H b/src/thermophysicalModels/radiation/submodels/transmissivityModel/noTransmissivity/noTransmissivity.H new file mode 100644 index 0000000000000000000000000000000000000000..3d0be9b1a7873e9ec8f45f577da998e4b4c3a14d --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/noTransmissivity/noTransmissivity.H @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::radiation::noTransmissivity + +Description + Dummy transmissivity model for 'none' + +SourceFiles + noTransmissivity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef radiationConstantScatter_H +#define radiationConstantScatter_H + +#include "transmissivityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ + +/*---------------------------------------------------------------------------*\ + Class noTransmissivity Declaration +\*---------------------------------------------------------------------------*/ + +class noTransmissivity +: + public transmissivityModel +{ + +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from components + noTransmissivity(const dictionary& dict, const fvMesh& mesh); + + + //- Destructor + virtual ~noTransmissivity(); + + + // Member Functions + + //- Return scatter coefficient + tmp<volScalarField> tauEff(const label bandI = 0) const; + + //- Is Grey + inline bool isGrey() const + { + return true; + } + + + //- Number of bands + inline label nBands() const + { + return 1; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radiation +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModel.C b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModel.C new file mode 100644 index 0000000000000000000000000000000000000000..ddd9226bf514f367dc3dd7332a0fdd57835b7e50 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "transmissivityModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiation + { + defineTypeNameAndDebug(transmissivityModel, 0); + defineRunTimeSelectionTable(transmissivityModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiation::transmissivityModel::transmissivityModel +( + const dictionary&, + const fvMesh& mesh +) +: + mesh_(mesh) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // + +Foam::radiation::transmissivityModel::~transmissivityModel() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModel.H b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModel.H new file mode 100644 index 0000000000000000000000000000000000000000..46e9babc13ee62c19f0117f8bf52aea308f9e6a4 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModel.H @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::radiation::transmissivityModel + +Description + Base class for radiation scattering + +\*---------------------------------------------------------------------------*/ + +#ifndef transmissivityModel_H +#define transmissivityModel_H + +#include "IOdictionary.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiation +{ + +/*---------------------------------------------------------------------------*\ + Class transmissivityModel Declaration +\*---------------------------------------------------------------------------*/ + +class transmissivityModel +{ + +protected: + + // Protected data + + //- Reference to the fvMesh + const fvMesh& mesh_; + +public: + + //- Runtime type information + TypeName("transmissivityModel"); + + // Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + transmissivityModel, + dictionary, + ( + const dictionary& dict, + const fvMesh& mesh + ), + (dict, mesh) + ); + + + // Constructors + + //- Construct from components + transmissivityModel(const dictionary& dict, const fvMesh& mesh); + + + // Selector + + static autoPtr<transmissivityModel> New + ( + const dictionary& dict, + const fvMesh& mesh + ); + + + //- Destructor + virtual ~transmissivityModel(); + + + // Member Functions + + //- Return scatter coefficient + virtual tmp<volScalarField> tauEff(const label bandI = 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 + +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C new file mode 100644 index 0000000000000000000000000000000000000000..d976fc0652eb0b88851dfae94c9f92dd9eb49b61 --- /dev/null +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "transmissivityModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::radiation::transmissivityModel> Foam::radiation:: +transmissivityModel::New +( + const dictionary& dict, + const fvMesh& mesh +) +{ + const word modelType(dict.lookup("transmissivityModel")); + + Info<< "Selecting transmissivityModel " << modelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown transmissivityModel type " + << modelType << nl << nl + << "Valid transmissivityModel types are :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<transmissivityModel>(cstrIter()(dict, mesh)); +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/IDefault b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/IDefault index d7fd348eff729da771d66424160b8b39186ed809..bcbb08c119c91345ff267f3bc23f9566897d9d52 100644 --- a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/IDefault +++ b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/IDefault @@ -24,9 +24,6 @@ boundaryField region0_to_pyrolysisRegion_coupledWall { type greyDiffusiveRadiation; - T T; - emissivityMode solidRadiation; - emissivity uniform 1.0; value uniform 0; } @@ -38,9 +35,6 @@ boundaryField ".*" { type greyDiffusiveRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } } diff --git a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/pyrolysisRegion/radiationProperties b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/pyrolysisRegion/radiationProperties index b4a633c8a93fe41af9bf565c5f74746ed005cd6b..1cc9cd56315b87a269bc7c0bde5ee0b987d112d5 100644 --- a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/pyrolysisRegion/radiationProperties +++ b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/pyrolysisRegion/radiationProperties @@ -37,5 +37,6 @@ greyMeanSolidAbsorptionEmissionCoeffs scatterModel none; +transmissivityModel none; // ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/radiationProperties b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/radiationProperties index f0ea5ac3bffcb5eb54fb5cfb4c615c13e11a4974..e900e1b028ef456ef1e2bf856798ad1fa6626b92 100644 --- a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/radiationProperties +++ b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/radiationProperties @@ -53,5 +53,6 @@ scatterModel none; sootModel none; +transmissivityModel none; // ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/G b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/G index 73b32f9c17270c6a2108d9bf6e4aca3fb3c6a0fd..41fe3640ea39ab74e78027127a9725ab52f0623b 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/G +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/G @@ -23,17 +23,12 @@ boundaryField ".*" { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } "(region0_to.*)" { type MarshakRadiation; - T T; - emissivityMode solidRadiation; value uniform 0; } } diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/IDefault b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/IDefault index 775da2d8a174124601a2bd260268cd7f1967463b..e88f201bf16d9320cac114afd79bd46cda5498e6 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/IDefault +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/IDefault @@ -23,16 +23,11 @@ boundaryField ".*" { type greyDiffusiveRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } "(region0_to.*)" { type greyDiffusiveRadiation; - T T; - emissivityMode solidRadiation; value uniform 0; } } diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/radiationProperties b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/radiationProperties index 31ca22ef22d2dc04b1f3ca291bb4207de81baca5..e7f6e73fccd958c53239bf61bb1e37b588327ad0 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/radiationProperties +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/radiationProperties @@ -39,5 +39,6 @@ greyMeanSolidAbsorptionEmissionCoeffs scatterModel none; +transmissivityModel none; // ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/radiationProperties b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/radiationProperties index ca7201c15cb34de1dd1cd24b49ec8f9efb193b8d..467ff58a8713f68374896b536f28069da50a769b 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/radiationProperties +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/radiationProperties @@ -193,4 +193,6 @@ scatterModel none; sootModel none; +transmissivityModel none; + // ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/G b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/G index 202e69128acfd0f97a9918ad6136dba03bee6991..54a212b4d18767e9741192a9d5f7370432354b21 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/G +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/G @@ -23,9 +23,6 @@ boundaryField ".*" { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/IDefault b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/IDefault index 76f3a7734de1b4729cd0b8de0ca884f198d46399..9c09695b45f9677719fbfe0d2a2bc24dfac6e78e 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/IDefault +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/IDefault @@ -23,9 +23,6 @@ boundaryField ".*" { type greyDiffusiveRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/boundaryRadiationProperties b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/boundaryRadiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..5f6307fa374c3f9b137da7079e0870adce07a9be --- /dev/null +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/boundaryRadiationProperties @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object boundaryRadiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + value uniform 0; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/radiationProperties b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/radiationProperties index c93c444259bc230dd6dbb47a5a52110d964f4e6c..7214856367853be6540a9025cd61563576cfd3aa 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/radiationProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/radiationProperties @@ -197,4 +197,8 @@ mixtureFractionSootCoeffs nuSoot 0.055; Wsoot 12; } + +transmissivityModel none; + + // ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/G b/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/G index dcd3b3a64404b9ac9bdc94a548ebd07c6003500c..fb9c46bdc8dc11c0ca8ce083f686d95a4f6075f7 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/G +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/G @@ -23,9 +23,6 @@ boundaryField ".*" { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/IDefault b/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/IDefault index 7e4afb268a766dceb16b9e411928a5d818b16c26..9cdcf792d2dd5c3dacdfb7c6ff0ac99d7005fcd8 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/IDefault +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/0/IDefault @@ -23,9 +23,6 @@ boundaryField ".*" { type greyDiffusiveRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1; value uniform 0; } } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/boundaryRadiationProperties b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/boundaryRadiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..7008951d9aaa45f393635662896254ceb380761c --- /dev/null +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/boundaryRadiationProperties @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object boundaryRadiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 0.0; + value uniform 0.0; + } +} + +// ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/radiationProperties b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/radiationProperties index 0c400567af87b3461665dfa20dc1f3b0865c35c3..07aa0579dc495d2dafa7e8e2dfc3bc2a2c2c3b90 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/radiationProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/radiationProperties @@ -192,4 +192,7 @@ scatterModel none; sootModel none; +transmissivityModel none; + + // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/G b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/G index 1128a5d3bae3db01b7683f99f0cddbb870679afc..3c6ec4363db6e283ac4ce1c2d226f7afdece97dd 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/G +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/G @@ -23,36 +23,24 @@ boundaryField floor { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } fixedWalls { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } ceiling { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } box { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/boundaryRadiationProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/boundaryRadiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..db985822390f69921b13e609eb48596f936e29ab --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/boundaryRadiationProperties @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object boundaryRadiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + box + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 1.0; + value uniform 0; + } + + floor + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 1.0; + value uniform 0; + } + + ceiling + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 1.0; + value uniform 0; + } + + fixedWalls + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 1.0; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/radiationProperties index 432da6b05e90900f5d000b603de63abbff357220..5881d9769a884b054195ac4a089d74372647bd29 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/radiationProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/radiationProperties @@ -35,5 +35,6 @@ scatterModel none; sootModel none; +transmissivityModel none; // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/IDefault b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/IDefault index f122ced6002a3f2c01d98cc81f056c8ee12b4d78..9cdcf792d2dd5c3dacdfb7c6ff0ac99d7005fcd8 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/IDefault +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/IDefault @@ -23,9 +23,6 @@ boundaryField ".*" { type greyDiffusiveRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/boundaryRadiationProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/boundaryRadiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..30444413e71b5412a731b9af5159562ab941f22c --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/boundaryRadiationProperties @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object boundaryRadiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 1.0; + value uniform 0.0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/radiationProperties index a1fe6aeacade0eff078f7fb656f9d0178156f089..e618063f90ea2ea26f66a146de0123d68264d913 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/radiationProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/radiationProperties @@ -44,4 +44,6 @@ scatterModel none; sootModel none; +transmissivityModel none; + // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/G b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/G new file mode 100644 index 0000000000000000000000000000000000000000..e50c4450ca2d2f4e721d77489d9da23a6f1759c8 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/G @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object G; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + maxY + { + type calculated; + value uniform 0; + } + minX + { + type calculated; + value uniform 0; + } + maxX + { + type calculated; + value uniform 0; + } + minY + { + type calculated; + value uniform 0; + } + maxZ + { + type calculated; + value uniform 0; + } + air_to_floor + { + type calculated; + value uniform 0; + } + air_to_solid + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/IDefault b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/IDefault new file mode 100644 index 0000000000000000000000000000000000000000..90f5a8e2c99dbe4c2b8be5705a3a1ea1c7947128 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/IDefault @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object IDefault; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 0 -3 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + maxY + { + type greyDiffusiveRadiation; + value uniform 0; + } + minX + { + type greyDiffusiveRadiation; + value uniform 0; + } + maxX + { + type greyDiffusiveRadiation; + value uniform 0; + } + minY + { + type greyDiffusiveRadiation; + value uniform 0; + } + maxZ + { + type greyDiffusiveRadiation; + value uniform 0; + } + air_to_floor + { + type greyDiffusiveRadiation; + value uniform 0; + } + air_to_solid + { + type greyDiffusiveRadiation; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/Qr b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/Qr new file mode 100644 index 0000000000000000000000000000000000000000..7964d31308d4705d1a162d004ab301b6da442907 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/Qr @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object Qr; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + maxY + { + type calculated; + value uniform 0; + } + minX + { + type calculated; + value uniform 0; + } + maxX + { + type calculated; + value uniform 0; + } + minY + { + type calculated; + value uniform 0; + } + maxZ + { + type calculated; + value uniform 0; + } + air_to_floor + { + type calculated; + value uniform 0; + } + air_to_solid + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/T b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/T new file mode 100644 index 0000000000000000000000000000000000000000..061bb924d7be7aad67ad9372782cb1ae7888a88a --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/T @@ -0,0 +1,79 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 300; + +boundaryField +{ + maxY + { + type inletOutlet; + value uniform 300; + inletValue uniform 300; + } + minX + { + type inletOutlet; + value uniform 300; + inletValue uniform 300; + } + maxX + { + type inletOutlet; + value uniform 300; + inletValue uniform 300; + } + minY + { + type inletOutlet; + value uniform 300; + inletValue uniform 300; + } + maxZ + { + type inletOutlet; + value uniform 300; + inletValue uniform 300; + } + air_to_floor + { + type compressible::turbulentTemperatureRadCoupledMixed; + value uniform 300; + inletValue uniform 300; + Tnbr T; + kappa fluidThermo; + QrNbr none; + Qr Qr; + kappaName none; + } + air_to_solid + { + type compressible::turbulentTemperatureRadCoupledMixed; + value uniform 300; + inletValue uniform 300; + Tnbr T; + kappa fluidThermo; + QrNbr none; + Qr Qr; + kappaName none; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/U b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/U new file mode 100644 index 0000000000000000000000000000000000000000..3766e4452003ed4bb233d962590554f91081d5a1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/U @@ -0,0 +1,74 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0/air"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 1 -1 0 0 0 0 ]; + +internalField uniform ( 0.1 0 0 ); + +boundaryField +{ + maxY + { + type pressureInletOutletVelocity; + value uniform ( 0 0 0 ); + phi phi; + } + minX + { + type pressureInletOutletVelocity; + value uniform ( 0 0 0 ); + phi phi; + } + maxX + { + type pressureInletOutletVelocity; + value uniform ( 0 0 0 ); + phi phi; + } + minY + { + type pressureInletOutletVelocity; + value uniform ( 0 0 0 ); + phi phi; + } + maxZ + { + type pressureInletOutletVelocity; + value uniform ( 0 0 0 ); + phi phi; + } + air_to_floor + { + type fixedValue; + value uniform ( 0 0 0 ); + phi phi; + } + air_to_solid + { + type fixedValue; + value uniform ( 0 0 0 ); + phi phi; + } + region0_to_floor_floor_zone + { + type fixedValue; + value uniform ( 0 0 0 ); + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/alphat b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/alphat new file mode 100644 index 0000000000000000000000000000000000000000..bfb1180c93991cf31bcc1381b25bba7bebb47b4e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/alphat @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + maxY + { + type calculated; + value uniform 0; + } + minX + { + type calculated; + value uniform 0; + } + maxX + { + type calculated; + value uniform 0; + } + minY + { + type calculated; + value uniform 0; + } + maxZ + { + type calculated; + value uniform 0; + } + air_to_floor + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + air_to_solid + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/epsilon b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..f5fa97e035ff4bb30448b6d02b6df17ec024b326 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/epsilon @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 0.01; + +boundaryField +{ + maxY + { + type inletOutlet; + value uniform 0.01; + inletValue uniform 0.01; + } + minX + { + type inletOutlet; + value uniform 0.01; + inletValue uniform 0.01; + } + maxX + { + type inletOutlet; + value uniform 0.01; + inletValue uniform 0.01; + } + minY + { + type inletOutlet; + value uniform 0.01; + inletValue uniform 0.01; + } + maxZ + { + type inletOutlet; + value uniform 0.01; + inletValue uniform 0.01; + } + air_to_floor + { + type epsilonWallFunction; + value uniform 0.01; + inletValue uniform 0.01; + } + air_to_solid + { + type epsilonWallFunction; + value uniform 0.01; + inletValue uniform 0.01; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/k b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/k new file mode 100644 index 0000000000000000000000000000000000000000..2b3045a9226ea0f41a4597d3b1333fb9a92eb36c --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/k @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0.1; + +boundaryField +{ + maxY + { + type inletOutlet; + value uniform 0.1; + inletValue uniform 0.1; + } + minX + { + type inletOutlet; + value uniform 0.1; + inletValue uniform 0.1; + } + maxX + { + type inletOutlet; + value uniform 0.1; + inletValue uniform 0.1; + } + minY + { + type inletOutlet; + value uniform 0.1; + inletValue uniform 0.1; + } + maxZ + { + type inletOutlet; + value uniform 0.1; + inletValue uniform 0.1; + } + air_to_floor + { + type kqRWallFunction; + value uniform 0.1; + inletValue uniform 0.1; + } + air_to_solid + { + type kqRWallFunction; + value uniform 0.1; + inletValue uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/nut b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/nut new file mode 100644 index 0000000000000000000000000000000000000000..2acdb9f7fda3eaefe41e5847f0589dcfd6c8c1e2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/nut @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + maxY + { + type calculated; + value uniform 0; + } + minX + { + type calculated; + value uniform 0; + } + maxX + { + type calculated; + value uniform 0; + } + minY + { + type calculated; + value uniform 0; + } + maxZ + { + type calculated; + value uniform 0; + } + air_to_floor + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + air_to_solid + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/p b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/p new file mode 100644 index 0000000000000000000000000000000000000000..cb29745bbe936e1466534fa3bef48e8d485ce934 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/p @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform 100000; + +boundaryField +{ + maxY + { + type calculated; + value uniform 100000; + } + minX + { + type calculated; + value uniform 100000; + } + maxX + { + type calculated; + value uniform 100000; + } + minY + { + type calculated; + value uniform 100000; + } + maxZ + { + type calculated; + value uniform 100000; + } + air_to_floor + { + type calculated; + value uniform 100000; + } + air_to_solid + { + type calculated; + value uniform 100000; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/p_rgh b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..cb5bf5aed18ff17f379ba2e15b10358d0da8a435 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/air/p_rgh @@ -0,0 +1,104 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/air"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform 100000; + +boundaryField +{ + maxY + { + type totalPressure; + value $internalField; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + } + minX + { + type totalPressure; + value $internalField; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + } + maxX + { + type totalPressure; + value $internalField; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + } + minY + { + type totalPressure; + value $internalField; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + } + maxZ + { + type totalPressure; + value $internalField; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + } + air_to_floor + { + type fixedFluxPressure; + value uniform 100000; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + } + air_to_solid + { + type fixedFluxPressure; + value uniform 100000; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/floor/T b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/floor/T new file mode 100644 index 0000000000000000000000000000000000000000..1d58b33800259f5d83f917259677ec2aa761bfac --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/floor/T @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/floor"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 300; + +boundaryField +{ + maxY + { + type zeroGradient; + value uniform 300; + } + minX + { + type zeroGradient; + value uniform 300; + } + maxX + { + type zeroGradient; + value uniform 300; + } + minY + { + type zeroGradient; + value uniform 300; + } + minZ + { + type externalWallHeatFluxTemperature; + value uniform 300; + kappa solidThermo; + Ta uniform 313; + h uniform 1000000; + thicknessLayers ( 1 2 ); + kappaLayers ( 100 200 ); + kappaName none; + } + floor_to_domain3 + { + type zeroGradient; + value uniform 300; + } + floor_to_air + { + type compressible::turbulentTemperatureRadCoupledMixed; + value uniform 300; + Tnbr T; + kappa solidThermo; + QrNbr Qr; + Qr none; + kappaName none; + } + floor_to_solid + { + type compressible::turbulentTemperatureRadCoupledMixed; + value uniform 300; + Tnbr T; + kappa solidThermo; + QrNbr none; + Qr none; + kappaName none; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/floor/p b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/floor/p new file mode 100644 index 0000000000000000000000000000000000000000..d8f445014893b6784bfd9b94ddcca9bc4eb056ba --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/floor/p @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/floor"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + maxY + { + type calculated; + value uniform 0; + } + minX + { + type calculated; + value uniform 0; + } + maxX + { + type calculated; + value uniform 0; + } + minY + { + type calculated; + value uniform 0; + } + minZ + { + type calculated; + value uniform 0; + } + floor_to_domain3 + { + type calculated; + value uniform 0; + } + floor_to_air + { + type calculated; + value uniform 0; + } + floor_to_solid + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/solid/T b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/solid/T new file mode 100644 index 0000000000000000000000000000000000000000..fb8448ef2085163571129ed668da0dd392a33cdd --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/solid/T @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/solid"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 300; + +boundaryField +{ + solid_to_domain3 + { + type fixedValue; + value uniform 300; + } + solid_to_air + { + type compressible::turbulentTemperatureRadCoupledMixed; + value uniform 300; + Tnbr T; + kappa solidThermo; + QrNbr Qr; + Qr none; + kappaName none; + } + solid_to_floor + { + type compressible::turbulentTemperatureRadCoupledMixed; + value uniform 300; + Tnbr T; + kappa solidThermo; + QrNbr none; + Qr none; + kappaName none; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/solid/p b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/solid/p new file mode 100644 index 0000000000000000000000000000000000000000..cfca2b8f3b40cf4df8adec8a8357c5072a23b7fb --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/0/solid/p @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/solid"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + solid_to_domain3 + { + type calculated; + value uniform 0; + } + solid_to_air + { + type calculated; + value uniform 0; + } + solid_to_floor + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..c90b8ceb13510e20c3817949ed55f7433c8a2ced --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean @@ -0,0 +1,33 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf VTK +rm -rf constant/cellToRegion constant/polyMesh/sets + +rm -rf constant/air/polyMesh +rm -rf constant/solid/polyMesh +rm -rf constant/floor/polyMesh +rm -rf constant/triSurface + +rm -f constant/air/F +rm -f constant/air/constructMap* +rm -f constant/air/finalAgglom +rm -f constant/air/globalFaceFaces +rm -f constant/air/mapDist +rm -f constant/air/visibleFaceFaces + +rm -f 0/air/facesAgglomeration +rm -f 0/air/viewFactorField +rm -f 0/air/cellToRegion +rm -f 0/floor/cellToRegion +rm -f 0/solid/cellToRegion +rm -f 0/cellToRegion + + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..42f495ac5ff5d4eeaf7101d3825b142704554b01 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun @@ -0,0 +1,34 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + + +# Setup case +./Allrun.pre + +#-- Run on single processor + +# Agglomerate patch faces +for i in air +do + faceAgglomerate -region $i -dict constant/viewFactorsDict > log.faceAgglomerate.$i 2>&1 +done + +# Generate view factors +for i in air +do + viewFactorsGen -region $i > log.viewFactorsGen.$i 2>&1 +done + +runApplication `getApplication` + + +echo +echo "creating files for paraview post-processing" +echo +paraFoam -touchAll + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre new file mode 100755 index 0000000000000000000000000000000000000000..59a0bb8730be7667c71d48164fdeda7da63751fc --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre @@ -0,0 +1,29 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication topoSet +runApplication splitMeshRegions -cellZones -overwrite + +# Remove unwanted region +rm -r 0/domain3 +rm -r constant/domain3 +rm -r system/domain3 + +# remove fluid fields from solid regions (important for post-processing) +for i in solid floor +do + rm -f 0*/$i/{rho,mut,alphat,epsilon,k,U,p_rgh,Qr,G,IDefault} +done + +for i in air solid floor +do + changeDictionary -region $i > log.changeDictionary.$i 2>&1 +done + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/boundaryRadiationProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/boundaryRadiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..ec0ef75859f8117597efca531041b405e61fbe36 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/boundaryRadiationProperties @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object boundaryRadiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 0.0; + transmissivity uniform 1.0; + + value uniform 0.0; + } + + air_to_solid + { + type boundaryRadiation; + mode solidRadiation; + value uniform 0; + } + + air_to_floor + { + type boundaryRadiation; + mode solidRadiation; + value uniform 0; + } + +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/g b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/g new file mode 100644 index 0000000000000000000000000000000000000000..0648d5baf9c4602ae89099f296a0b30cb2efa3be --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 -9.81); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/radiationProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/radiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..3605fbe68e31b48df00aa2d17979d8cd44a4b14d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/radiationProperties @@ -0,0 +1,97 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object radiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +radiation on; + +radiationModel solarLoad; + +solarLoadCoeffs +{ + useVFbeamToDiffuse true; + + sunDirectionModel sunDirTraking;//sunDirConstant; + + // Time interval to update Sun position (sec) + sunTrackingUpdateInterval 800; + + // Sun ray direction. Give the sunDirection or calculated using the + // solar calculator + + //sunDirection (-1 1 -1); + + localStandardMeridian 9; // GMT offset (hours) + startDay 204; // day of the year + startTime 15; // time of the day (hours decimal) + longitude 139.74; // longitude (degrees) + latitude 35.658; // latitude (degrees) + + // Grid orientation + gridUp (0 0 1); + gridEast (1 0 0); + + // Energy spectrum + spectralDistribution (1 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 300; // Apparent solar irradiation at air mass m = 0 + B 0.142; // 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.058; // Model constant + + // Radiative flux coupling flags + solidCoupled true; //Couple through Qr the solid regions (default true) + wallCoupled false; //Couple through Qr wall patches (default false) +} + + +viewFactorCoeffs +{ + smoothing true; //Smooth view factor matrix (use when in a close surface + //to force Sum(Fij = 1) + constantEmissivity true; //constant emissivity on surfaces. +} + +// Number of flow iterations per radiation iteration +solverFreq 1; + +absorptionEmissionModel none; + +scatterModel none; + +sootModel none; + +transmissivityModel none; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..c293c032a338e174fa07a88f393f1fbb643c5e6b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/thermophysicalProperties @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant/bottomAir"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; + } + thermodynamics + { + Cp 1000; + Hf 0; + } + transport + { + mu 1.8e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..4c9278533f31ddcdc5ae885bb74dbd7e5ba4f734 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/turbulenceProperties @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/viewFactorsDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/viewFactorsDict new file mode 100644 index 0000000000000000000000000000000000000000..e2283d0d3705b467033f02c854e246c56b198fa7 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/air/viewFactorsDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object viewFactorsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +writeViewFactorMatrix true; +writeFacesAgglomeration true; +writePatchViewFactors false; + +maxDynListLength 200000; +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/floor/radiationProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/floor/radiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..5b45489c9084b13b1a86172dc409b4264ab7c213 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/floor/radiationProperties @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object radiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +radiation on; + +radiationModel opaqueSolid; + +absorptionEmissionModel multiBandSolidAbsorptionEmission; + +multiBandSolidAbsorptionEmissionCoeffs +{ + absorptivity (0.7 0.7); + emissivity (0.7 0.7); +} + +transmissivityModel multiBandSolidTransmissivity; + +multiBandSolidTransmissivityCoeffs +{ + transmissivity (0 0); +} + +scatterModel none; + +sootModel none; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/floor/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/floor/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..894a9f39be209c8cc007b561a91c9a6a762744d5 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/floor/thermophysicalProperties @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------* \ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heSolidThermo; + mixture pureMixture; + transport constIso; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 12; + } + + transport + { + kappa 80; + } + + thermodynamics + { + Hf 0; + Cp 450; + } + + equationOfState + { + rho 8000; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh.old/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh.old/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..782567fbd42277d1bd090a3e5cf72bed50f2b9d2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh.old/blockMeshDict @@ -0,0 +1,96 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0 0 -1) + ( 40 0 -1) + ( 40 40 -1) + ( 0 40 -1) + ( 0 0 60) + ( 40 0 60) + ( 40 40 60) + ( 0 40 60) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (30 30 45) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + maxY + { + type patch; + faces + ( + (3 7 6 2) + ); + } + minX + { + type patch; + faces + ( + (0 4 7 3) + ); + } + maxX + { + type patch; + faces + ( + (2 6 5 1) + ); + } + minY + { + type patch; + faces + ( + (1 5 4 0) + ); + } + minZ + { + type wall; + faces + ( + (0 3 2 1) + ); + } + maxZ + { + type patch; + faces + ( + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh.old/boundary b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh.old/boundary new file mode 100644 index 0000000000000000000000000000000000000000..b48b28b598747762cf4f38a50aec9f30f004ef97 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh.old/boundary @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + maxY + { + type patch; + nFaces 1350; + startFace 117900; + } + minX + { + type patch; + nFaces 1350; + startFace 119250; + } + maxX + { + type patch; + nFaces 1350; + startFace 120600; + } + minY + { + type patch; + nFaces 1350; + startFace 121950; + } + minZ + { + type wall; + inGroups 1(wall); + nFaces 900; + startFace 123300; + } + maxZ + { + type patch; + nFaces 900; + startFace 124200; + } +) + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh/boundary b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..b48b28b598747762cf4f38a50aec9f30f004ef97 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/polyMesh/boundary @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev-OpenCFD | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + maxY + { + type patch; + nFaces 1350; + startFace 117900; + } + minX + { + type patch; + nFaces 1350; + startFace 119250; + } + maxX + { + type patch; + nFaces 1350; + startFace 120600; + } + minY + { + type patch; + nFaces 1350; + startFace 121950; + } + minZ + { + type wall; + inGroups 1(wall); + nFaces 900; + startFace 123300; + } + maxZ + { + type patch; + nFaces 900; + startFace 124200; + } +) + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/regionProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/regionProperties new file mode 100644 index 0000000000000000000000000000000000000000..817e542e345faf2dfa184532d08c951d645f39c7 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/regionProperties @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object regionProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +regions +( + fluid (air ) + solid (solid floor) +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/solid/radiationProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/solid/radiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..5b45489c9084b13b1a86172dc409b4264ab7c213 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/solid/radiationProperties @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object radiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +radiation on; + +radiationModel opaqueSolid; + +absorptionEmissionModel multiBandSolidAbsorptionEmission; + +multiBandSolidAbsorptionEmissionCoeffs +{ + absorptivity (0.7 0.7); + emissivity (0.7 0.7); +} + +transmissivityModel multiBandSolidTransmissivity; + +multiBandSolidTransmissivityCoeffs +{ + transmissivity (0 0); +} + +scatterModel none; + +sootModel none; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/solid/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/solid/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..fcda1ec61bd9318bfa133d5460d75221af5435be --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/constant/solid/thermophysicalProperties @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------* \ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heSolidThermo; + mixture pureMixture; + transport constIso; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 12; + } + + transport + { + kappa 80; + } + + thermodynamics + { + Hf 0; + Cp 250; + } + + equationOfState + { + rho 5000; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/changeDictionaryDict new file mode 100644 index 0000000000000000000000000000000000000000..3591ea2f5fd446dcc693293ef469ee42f32cae4e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/changeDictionaryDict @@ -0,0 +1,177 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + boundary + { + air_to_floor + { + inGroups 2(wall viewFactorWall); + } + + air_to_solid + { + inGroups 2(wall viewFactorWall); + } + } + U + { + boundaryField + { + ".*" + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + phi phi; + } + + region0_to_floor_floor_zone + { + type fixedValue; + value uniform (0 0 0); + } + "air.*" + { + type fixedValue; + value uniform (0 0 0); + } + } + } + + T + { + internalField uniform 300; + boundaryField + { + ".*" + { + type inletOutlet; + value uniform 300; + inletValue uniform 300; + } + + "air.*" + { + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + kappa fluidThermo; + QrNbr none; + Qr Qr; + kappaName none; + value uniform 300; + } + } + } + + epsilon + { + internalField uniform 0.01; + boundaryField + { + ".*" + { + type inletOutlet; + inletValue uniform 0.01; + value uniform 0.01; + } + + "air.*" + { + type epsilonWallFunction; + value uniform 0.01; + } + + } + } + + k + { + internalField uniform 0.1; + boundaryField + { + ".*" + { + type inletOutlet; + inletValue uniform 0.1; + value uniform 0.1; + } + + "air.*" + { + type kqRWallFunction; + value uniform 0.1; + } + + } + } + + p_rgh + { + internalField uniform 1e5; + boundaryField + { + ".*" + { + type totalPressure; + p0 $internalField; + U U; + phi phi; + rho rho; + psi none; + gamma 0; + value $internalField; + } + + "air.*" + { + type fixedFluxPressure; + value uniform 1e5; + } + + } + } + + p + { + internalField uniform 1e5; + boundaryField + { + ".*" + { + type calculated; + value uniform 1e5; + } + } + } + + IDefault + { + internalField uniform 0; + boundaryField + { + ".*" + { + type greyDiffusiveRadiation; + value uniform 0; + } + } + } + + +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..f051e7b79a6ca676cbc29eb7a4dd07d805d999a0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/decomposeParDict @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..d59dd30808e9307a0968b448072dcc10ec5bf02a --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + div(phi,U) Gauss upwind; + div(phi,K) Gauss upwind; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,K) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(Ji,Ii_h) Gauss linearUpwind grad(U); + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p_rgh; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..3515a9618e243276027673032e28e1d558c9ff69 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/fvSolution @@ -0,0 +1,73 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "rho.*" + { + solver PCG; + preconditioner DIC; + tolerance 0; + relTol 0; + } + + p_rgh + { + solver PCG; + preconditioner DIC; + tolerance 1e-7; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "(U|h|e|k|epsilon|R)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0.1; + } + + "(U|h|e|k|epsilon|R)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nOuterCorrectors 0; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..782567fbd42277d1bd090a3e5cf72bed50f2b9d2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/blockMeshDict @@ -0,0 +1,96 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0 0 -1) + ( 40 0 -1) + ( 40 40 -1) + ( 0 40 -1) + ( 0 0 60) + ( 40 0 60) + ( 40 40 60) + ( 0 40 60) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (30 30 45) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + maxY + { + type patch; + faces + ( + (3 7 6 2) + ); + } + minX + { + type patch; + faces + ( + (0 4 7 3) + ); + } + maxX + { + type patch; + faces + ( + (2 6 5 1) + ); + } + minY + { + type patch; + faces + ( + (1 5 4 0) + ); + } + minZ + { + type wall; + faces + ( + (0 3 2 1) + ); + } + maxZ + { + type patch; + faces + ( + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/controlDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..268b56089977a8a15a70b2654225decd81887c0d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/controlDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application chtMultiRegionFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 18000; + +deltaT 10; + +writeControl adjustableRunTime; + +writeInterval 800; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 7; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep yes; + +maxCo 15; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..c122b39b27a562eff5e4a516e8d33a2bb7091f35 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/decomposeParDict @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; + + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +scotchCoeffs +{ +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/extrudeToRegionMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/extrudeToRegionMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..55ccf9ef406475d6b131a33d7fddf90943807064 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/extrudeToRegionMeshDict @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object extrudeToRegionMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +region floor; + +faceZones (floor_zone); + +oneD false; + +sampleMode nearestPatchFace; + +oneDPolyPatchType empty; //wedge + +extrudeModel linearNormal; + +nLayers 5; + +expansionRatio 1; + +adaptMesh true; // mapped for both + +linearNormalCoeffs +{ + thickness 1; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/changeDictionaryDict new file mode 100644 index 0000000000000000000000000000000000000000..cb68f1fb2da0782826007e3e1c4920a2ed3267c1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/changeDictionaryDict @@ -0,0 +1,81 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + boundary + { + floor_to_domain3 + { + type patch; + } + } + T + { + internalField uniform 300; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 300; + } + + floor_to_solid + { + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + kappa solidThermo; + QrNbr none; + Qr none; + kappaName none; + value uniform 300; + } + + floor_to_air + { + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + kappa solidThermo; + QrNbr Qr; + Qr none; + kappaName none; + value uniform 300; + } + + floor_to_domain3 + { + type zeroGradient; + value uniform 300; + } + + minZ + { + type externalWallHeatFluxTemperature; + kappa solidThermo; + Ta uniform 313.0; + h uniform 10e5; + thicknessLayers (1 2); + kappaLayers (100 200); + value uniform 300.0; + kappaName none; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..f051e7b79a6ca676cbc29eb7a4dd07d805d999a0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/decomposeParDict @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..c83d3738bc84856c291626fef628b68752e9cff6 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/fvSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; + laplacian(alpha,h) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..abf98a73f63e7fc65eb3a5264c5f8e9cd1a722b9 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/fvSolution @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "h.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0; + } +} + +PIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + fields + { + } + equations + { + h 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..e7d321e95943268ef62b4a5e1d25ebbc469551bb --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/fvSchemes @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ +} + +gradSchemes +{ +} + +divSchemes +{ +} + +laplacianSchemes +{ +} + +interpolationSchemes +{ +} + +snGradSchemes +{ +} + +fluxRequired +{ +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..77941ca7b4d8c6a62fa816c894df4fd9db6c1dc0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/fvSolution @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +PIMPLE +{ + +} +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/changeDictionaryDict new file mode 100644 index 0000000000000000000000000000000000000000..c1f17e9603b151b5c413472d8b80ffa5312e25c2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/changeDictionaryDict @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + boundary + { + solid_to_domain3 + { + type patch; + } + } + T + { + internalField uniform 300; + + boundaryField + { + solid_to_air + { + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + kappa solidThermo; + QrNbr Qr; + Qr none; + kappaName none; + value uniform 300; + } + + solid_to_floor + { + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + kappa solidThermo; + QrNbr none; + Qr none; + kappaName none; + value uniform 300; + } + + solid_to_domain3 + { + type fixedValue; + value uniform 300.0; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..f051e7b79a6ca676cbc29eb7a4dd07d805d999a0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/decomposeParDict @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..578a79be7d0fadc6e32002e39394266c2574a1f5 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/fvSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; + laplacian(alpha,h) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..db7d6546e4f7fd57f46aaaadd26a0212d3a9d0b5 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/fvSolution @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "h.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.; + } +} + +PIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + fields + { + } + equations + { + h 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/topoSetDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/topoSetDict new file mode 100644 index 0000000000000000000000000000000000000000..aef6506a1f45bbfecd21a028b26dd7a0484a523d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/topoSetDict @@ -0,0 +1,131 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + + // solid + { + name solid; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (15.5 15.5 0)(24.5 24.5 9); + } + } + + // floor + { + name floor; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (0 0 -2)(41 41 0); + } + } + + { + name floor; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo + { + set floor; + } + } + + //air + { + name solid; + type cellSet; + action invert; + } + + { + name solid; + type cellSet; + action delete; + source cellToCell; + sourceInfo + { + set floor; + } + } + + { + name air; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo + { + set solid; // name of cellSet + } + } + + { + name cavity; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (17 17 0)(23 23 7.5); + } + } + + //- Define again solid + { + name solid; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (15.5 15.5 0)(24.5 24.5 9); + } + } + + { + name solid; + type cellSet; + action delete; + source cellToCell; + sourceInfo + { + set cavity; + } + } + + { + name solid; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo + { + set solid; // name of cellSet + } + } +); + +// ************************************************************************* // diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/G b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/G index 4eaceb02223184f1a9e2af82e973efc9f90b6c48..7480229c54c943042ea8c4c06caa92c9b32647dc 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/G +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/G @@ -24,25 +24,16 @@ boundaryField top { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } bottom { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } walls { type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; value uniform 0; } symmetry diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/boundaryRadiationProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/boundaryRadiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..7f91d4e527cc6d1c33f53cef465a59a8bd6773b4 --- /dev/null +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/boundaryRadiationProperties @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object boundaryRadiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type boundaryRadiation; + mode lookup; + emissivity uniform 1.0; + absorptivity uniform 0.0; + value uniform 0.0; + } + symmetry + { + type symmetryPlane; + } + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties index f65b915627e339665b616724148fc550f3913894..9cdbf524ce05cc8cd71a1fe9496d7893ec298def 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties @@ -63,5 +63,6 @@ cloudScatterCoeffs ); } +transmissivityModel none; // ************************************************************************* //