ENH: Adding reflection capability to solar load radiation model

ENH: Several modifycations to avoid erroneuos rays to be shot
from wrong faces.

ENH: Updating tutorials and avoiding registration of the
coarse singleCellFvMesh

Adding solarLoad tutorial case simpleCarSolarPanel

ENH: Changes needed for the merge
This commit is contained in:
sergio
2019-01-21 16:29:58 -08:00
committed by Andrew Heather
parent 9893e62386
commit 659526101a
35 changed files with 23142 additions and 97 deletions

View File

@ -21,10 +21,10 @@ radiationModel fvDOM;
fvDOMCoeffs
{
nPhi 3; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 5; // polar angles in PI (from Z to X-Y plane)
maxIter 10; // maximum number of iterations
tolerance 1e-3; // convergence criteria for radiation iteration
nPhi 3;
nTheta 5;
tolerance 1e-3;
maxIter 10;
}
// Number of flow iterations per radiation iteration

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
"(solarpanel.*|ref_wall|ZMin)"
{
type zeroGradient;
value $internalField;
}
"(YMax|YMin|XMax|XMin|ZMax)"
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0.1 0 0);
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(solarpanel.*|ref_wall|YMax|YMin|XMax|XMin|ZMin)"
{
type fixedValue;
value $internalField;
}
ZMax
{
type pressureInletOutletVelocity;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 101325;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 101325;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(solarpanel.*|ref_wall|YMax|YMin|XMax|XMin|ZMin)"
{
type fixedFluxPressure;
value $internalField;
}
ZMax
{
type prghTotalPressure;
p0 $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase0
rm -rf constant/extendedFeatureEdgeMesh
#------------------------------------------------------------------------------

View File

@ -0,0 +1,15 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
runApplication blockMesh
restore0Dir
runApplication surfaceFeatureExtract
runApplication snappyHexMesh -overwrite
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,75 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object boundaryRadiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
".*"
{
type transparent;
wallAbsorptionEmissionModel
{
type multiBandAbsorption;
emissivity (1 1);
absorptivity (0 0);
};
}
body_bottom
{
type opaqueDiffusive;
wallAbsorptionEmissionModel
{
type multiBandAbsorption;
absorptivity (0.3 0.7);
emissivity (0.3 0.7);
};
}
"(solarpanel.*)"
{
type opaqueDiffusive;
wallAbsorptionEmissionModel
{
type multiBandAbsorption;
absorptivity (0.3 0.7);
emissivity (0.3 0.7);
};
}
ref_wall
{
type opaqueReflective;
// Fraction of the reflected is diffussive
fd 0.0; // 0: all specular 1: all diffusive
wallAbsorptionEmissionModel
{
type multiBandAbsorption;
absorptivity (0.03 0.07);
emissivity (0.03 0.07);
};
}
ZMin
{
type opaqueDiffusive;
wallAbsorptionEmissionModel
{
type multiBandAbsorption;
absorptivity (0.3 0.7);
emissivity (0.3 0.7);
};
}

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 0 -9.81);

View File

@ -0,0 +1,97 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation on;
radiationModel solarLoad;
solarLoadCoeffs
{
sunDirectionModel sunDirConstant;
skyCloudCoverFraction 0;
sunDirection (-1 0.7 -1.5);
localStandardMeridian -8; // GMT offset (hours)
startDay 22; // day of the year
startTime 10; // time of the day (hours decimal)
longitude -118.243683; // longitude (degrees)
latitude 34.052235; // latitude (degrees)
// Grid orientation
gridUp (0 0 1);
gridEast (0 1 0);
// Energy spectrum
spectralDistribution (2 1);
// Solar model:
// sunLoadConstant-sunLoadFairWeatherConditions-SunLoadTheoreticalMaximum;
sunLoadModel sunLoadFairWeatherConditions;
// Sun load constant model
//directSolarRad 500;
//diffuseSolarRad 40;
// Fair Weather Conditions Model Constants.
// Calculate beta from the Solar calculator or input
A 2229.78119355; // Apparent solar irradiation at air mass m = 0
B 0.142064516129; // Atmospheric extinction coefficient
//beta 45; // Solar altitude (in degrees) above the horizontal
// Theoretical maximum model constants
//Setrn 10;
//SunPrime 1;
// Ground reflectivity
groundReflectivity 0.2;
// Solar diffusivity constants
C 0.058064516129; // Model constant
// Radiative flux coupling flags
solidCoupled false; // Couple through Qr the solid regions (default true)
wallCoupled true; // Couple through Qr wall patches (default false)
// Reflecting rays
useReflectedRays true;
reflecting
{
nPhi 10;
nTheta 10;
}
absorptionEmissionModel none;
scatterModel none;
sootModel none;
}
// Number of flow iterations per radiation iteration
solverFreq 1;
absorptionEmissionModel none;
scatterModel none;
sootModel none;
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
molWeight 28.966;
}
thermodynamics
{
Cp 1006.43;
Hf 0;
}
transport
{
mu 1.846e-05;
Pr 0.706414;
}
}

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
X_MIN_TUNNEL -1.84;
Y_MIN_TUNNEL -2.1;
Z_MIN_TUNNEL -3.0616171e-17;
X_MAX_TUNNEL 1.085;
Y_MAX_TUNNEL 2.4;
Z_MAX_TUNNEL 3.25;
NCELLS_X 11;
NCELLS_Y 17;
NCELLS_Z 12;
vertices
(
( $X_MIN_TUNNEL $Y_MIN_TUNNEL $Z_MIN_TUNNEL ) //Node 0
( $X_MAX_TUNNEL $Y_MIN_TUNNEL $Z_MIN_TUNNEL ) //Node 1
( $X_MAX_TUNNEL $Y_MAX_TUNNEL $Z_MIN_TUNNEL ) //Node 2
( $X_MIN_TUNNEL $Y_MAX_TUNNEL $Z_MIN_TUNNEL ) //Node 3
( $X_MIN_TUNNEL $Y_MIN_TUNNEL $Z_MAX_TUNNEL ) //Node 4
( $X_MAX_TUNNEL $Y_MIN_TUNNEL $Z_MAX_TUNNEL ) //Node 5
( $X_MAX_TUNNEL $Y_MAX_TUNNEL $Z_MAX_TUNNEL ) //Node 6
( $X_MIN_TUNNEL $Y_MAX_TUNNEL $Z_MAX_TUNNEL ) //Node 7
);
blocks
(
hex (0 1 2 3 4 5 6 7) ( $NCELLS_X $NCELLS_Y $NCELLS_Z)
simpleGrading (1 1 1)
);
edges
(
);
boundary
(
XMin
{
type patch;
faces
(
(0 4 7 3)
);
}
XMax
{
type patch;
faces
(
(1 2 6 5)
);
}
YMin
{
type patch;
faces
(
(0 1 5 4)
);
}
YMax
{
type patch;
faces
(
(3 7 6 2)
);
}
ZMin
{
type wall;
faces
(
(0 3 2 1)
);
}
ZMax
{
type patch;
faces
(
(4 5 6 7)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application buoyantSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 50;
deltaT 1;
writeControl timeStep;
writeInterval 5;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -0,0 +1,62 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear limited corrected 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited corrected 0.333;
}
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p_rgh
{
solver GAMG;
tolerance 1e-8;
relTol 0.01;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
"(U|h|k|epsilon)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-7;
relTol 0.05;
}
}
SIMPLE
{
momentumPredictor no;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
fields
{
rho 1;
p_rgh 0.7;
}
equations
{
U 0.01;
h 0.3;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include defaults parameters from master dictionary
#includeEtc "caseDicts/meshQualityDict"
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;
// ************************************************************************* //

View File

@ -0,0 +1,156 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
castellatedMesh true;
snap true;
addLayers false;
geometry
{
simpleCar.stl
{
type triSurfaceMesh;
name simpleCar ;
regions
{
body_bottom
{
name body_bottom;
}
solarpanel_body_left
{
name solarpanel_body_left;
}
solarpanel_body_right
{
name solarpanel_body_right;
}
solarpanel_body_top
{
name solarpanel_body_top;
}
solarpanel_body_back
{
name solarpanel_body_back;
}
ref_wall
{
name ref_wall;
}
}
}
};
castellatedMeshControls
{
maxLocalCells 200000000;
maxGlobalCells 300000000;
minRefinementCells 20;
nCellsBetweenLevels 2;
maxLoadUnbalance 0.2;
allowFreeStandingZoneFaces true;
resolveFeatureAngle 30;
features
(
{
file "simpleCar.eMesh" ;
level 0 ;
}
);
refinementSurfaces
{
simpleCar
{
level (2 2);
regions
{
body_bottom
{
level (2 2);
status 1 ;
}
solarpanel_body_left
{
level (3 3);
status 1 ;
}
solarpanel_body_right
{
level (3 3);
status 1 ;
}
solarpanel_body_top
{
level (3 3);
status 1 ;
}
solarpanel_body_back
{
level (3 3);
status 1 ;
}
ref_wall
{
level (2 2);
status 1 ;
}
}
}
}
refinementRegions
{
}
locationInMesh ( 0.695 1.95 2.875 ) ;
}
snapControls
{
tolerance 2;
implicitFeatureSnap false;
explicitFeatureSnap true;
multiRegionFeatureSnap true;
detectNearSurfacesSnap true;
nSmoothPatch 3;
nSolveIter 100;
nRelaxIter 5;
nFeatureSnapIter 20;
}
addLayersControls
{
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
#include "meshQualityDict"
// Advanced
//- Number of error distribution iterations
nSmoothScale 4;
//- Amount to scale back displacement at error points
errorReduction 0.75;
}
mergeTolerance 1e-06;

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simpleCar.stl
{
extractionMethod extractFromSurface;
writeObj yes;
extractFromSurfaceCoeffs
{
includedAngle 150;
}
}

View File

@ -36,10 +36,9 @@ air_to_solid
wallAbsorptionEmissionModel
{
type solidAbsorption;
//multiBandAbsorption;
//absorptivity (0.1 0.1);
//emissivity (0.1 0.1);
type multiBandAbsorption;
absorptivity (0.1 0.1);
emissivity (0.1 0.1);
};
}

View File

@ -17,7 +17,7 @@ FoamFile
radiation on;
radiationModel viewFactor;//solarLoad;
radiationModel viewFactor;
solarLoadCoeffs
{

View File

@ -16,11 +16,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation on;
radiation off;
radiationModel opaqueSolid;
radiationModel none;//opaqueSolid;
absorptionEmissionModel multiBandSolidAbsorptionEmission;
absorptionEmissionModel none;
multiBandSolidAbsorptionEmissionCoeffs
{

View File

@ -16,11 +16,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation on;
radiation off;
radiationModel opaqueSolid;
radiationModel none;//opaqueSolid;
absorptionEmissionModel multiBandSolidAbsorptionEmission;
absorptionEmissionModel none;//multiBandSolidAbsorptionEmission;
multiBandSolidAbsorptionEmissionCoeffs
{

View File

@ -29,14 +29,7 @@ viewFactorCoeffs
// Number of flow iterations per radiation iteration
solverFreq 3;
absorptionEmissionModel constantAbsorptionEmission;
constantAbsorptionEmissionCoeffs
{
absorptivity absorptivity [0 -1 0 0 0 0 0] 0.01;
emissivity emissivity [0 -1 0 0 0 0 0] 0.01;
E E [1 -1 -3 0 0 0 0] 0;
}
absorptionEmissionModel none;
scatterModel none;