Go to the documentation of this file.
55 "sunLoadFairWeatherConditions",
56 "sunLoadTheoreticalMaximum"
87 scalar
M = 6.24004 + 0.0172*D;
88 scalar EOT = -7.659*
sin(
M) + 9.863*
sin(2*
M + 3.5932);
95 scalar AST = LST + EOT/60.0 + (LON - LSM)/15;
121 Info <<
"当前太阳时角H的角度degree is " << 15*(AST-12) <<
endl;
123 Info <<
"当前太阳时角H的弧度值是: " << H <<
endl;
126 Info <<
"deltaRad is : " << deltaRad <<
endl;
142 dict_.lookup(
"gridUp") >> gridUp_;
143 gridUp_ /=
mag(gridUp_);
145 dict_.lookup(
"gridEast") >> eastDir_;
146 eastDir_ /=
mag(eastDir_);
153 direction_.z() = -
sin(beta_);
154 direction_.y() =
cos(beta_)*
cos(tetha_);
155 direction_.x() =
cos(beta_)*
sin(tetha_);
157 direction_ /=
mag(direction_);
161 Info<<
"Sun direction in absolute coordinates : " << direction_ <<
endl;
164 direction_ = coord_->R().transform(direction_);
168 Info<<
"Sun direction in the Grid coordinates : " << direction_ <<
endl;
175 switch (sunDirectionModel_)
177 case mSunDirConstant:
179 if (dict_.found(
"sunDirection"))
181 dict_.lookup(
"sunDirection") >> direction_;
182 direction_ /=
mag(direction_);
186 calculateBetaTetha();
187 calculateSunDirection();
194 if (
word(mesh_.ddtScheme(
"default")) ==
"steadyState")
197 <<
" Sun direction model can not be sunDirtracking if the "
201 dict_.lookup(
"sunTrackingUpdateInterval") >>
202 sunTrackingUpdateInterval_;
204 calculateBetaTetha();
205 calculateSunDirection();
210 switch (sunLoadModel_)
212 case mSunLoadConstant:
215 dict_.lookup(
"directSolarRad") >> directSolarRad_;
216 dict_.lookup(
"diffuseSolarRad") >> diffuseSolarRad_;
219 case mSunLoadFairWeatherConditions:
224 if (dict_.found(
"beta"))
226 dict_.lookup(
"beta") >> beta_;
230 calculateBetaTetha();
233 directSolarRad_ = A_/
exp(B_/
sin(beta_));
235 groundReflectivity_ =
236 readScalar(dict_.lookup(
"groundReflectivity"));
240 case mSunLoadTheoreticalMaximum:
243 SunPrime_ =
readScalar(dict_.lookup(
"SunPrime"));
244 directSolarRad_ = Setrn_*SunPrime_;
246 groundReflectivity_ =
247 readScalar(dict_.lookup(
"groundReflectivity"));
265 directSolarRad_(0.0),
266 diffuseSolarRad_(0.0),
267 groundReflectivity_(0.0),
277 sunDirectionModelTypeNames_.read(
dict.
lookup(
"sunDirectionModel"))
281 sunLoadModelTypeNames_.read(
dict.
lookup(
"sunLoadModel"))
300 switch (sunDirectionModel_)
302 case mSunDirConstant:
309 calculateBetaTetha();
310 calculateSunDirection();
311 directSolarRad_ = A_/
exp(B_/
sin(
max(beta_, ROOTVSMALL)));
dictionary dict_
Dictionary.
static const NamedEnum< sunDirModel, 2 > sunDirectionModelTypeNames_
Sun direction models.
A class for handling words, derived from string.
dimensionedScalar sin(const dimensionedScalar &ds)
void calculateBetaTetha()
Calculate beta and tetha angles.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Unit conversion functions.
void calculateSunDirection()
Calculate Sun direction.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
dimensionedScalar exp(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
sunLModel
Direct sun load models.
const fvMesh & mesh_
Reference to mesh.
sunDirModel sunDirectionModel_
Sun direction model.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Mesh data needed to do the Finite Volume discretisation.
const double e
Elementary charge.
~solarCalculator()
Destructor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void correctSunDirection()
Recalculate.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
dimensionedScalar acos(const dimensionedScalar &ds)
static const NamedEnum< sunLModel, 3 > sunLoadModelTypeNames_
Sun load models.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
const Time & time() const
Return the top-level database.
scalar startTime_
Start time for the Sun position (decimal hours)
solarCalculator(const solarCalculator &)
Disallow default bitwise copy construct.
defineTypeNameAndDebug(combustionModel, 0)
sunDirModel
Sun direction models.
dimensionedScalar asin(const dimensionedScalar &ds)
Initialise the NamedEnum HashTable from the static list of names.
Base class for other coordinate system specifications.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
dimensionedScalar cos(const dimensionedScalar &ds)