solarCalculator Class Reference

A solar calculator model providing models for the solar direction and solar loads. More...

Collaboration diagram for solarCalculator:
[legend]

Public Types

enum  sunDirModel { mSunDirConstant, mSunDirTracking }
 Options for the Sun direction models. More...
 
enum  sunLModel { mSunLoadConstant, mSunLoadTimeDependent, mSunLoadFairWeatherConditions, mSunLoadTheoreticalMaximum }
 Options for the Sun load models. More...
 

Public Member Functions

 ClassName ("solarCalculator")
 
 solarCalculator (const dictionary &, const fvMesh &)
 Construct from dictionary. More...
 
 ~solarCalculator ()=default
 Destructor. More...
 
void correctSunDirection ()
 Correct the Sun direction. More...
 
void correctDirectSolarRad ()
 Correct direct solar irradiation. More...
 
void correctDiffuseSolarRad ()
 Correct diffuse solar irradiation. More...
 
const sunDirModelsunDirectionModel () const noexcept
 Return const access to the Sun direction model. More...
 
const sunLModelsunLoadModel () const noexcept
 Return const access to the Sun load model. More...
 
vectordirection ()
 Return non-const access to the Sun direction. More...
 
const vectordirection () const noexcept
 Return const access to the Sun direction. More...
 
scalar & directSolarRad ()
 Return non-const access to the direct solar irradiation. More...
 
const scalar & directSolarRad () const noexcept
 Return const access to the direct solar irradiation. More...
 
scalar & diffuseSolarRad ()
 Return non-const access to the diffuse solar irradiation. More...
 
const scalar & diffuseSolarRad () const noexcept
 Return const access to the diffuse solar irradiation. More...
 
scalar C () const noexcept
 Return const access to the C constant. More...
 
scalar beta () const noexcept
 Return const access to beta. More...
 
scalar theta () const noexcept
 Return const access to theta. More...
 
scalar groundReflectivity () const noexcept
 Return const access to the ground reflectivity. More...
 
const coordinateSystemcoord () const noexcept
 Return const access to the coordinate system. More...
 
scalar sunTrackingUpdateInterval () const noexcept
 Return const access to sunTrackingUpdateInterval. More...
 
scalar startTime () const noexcept
 Return const access to startTime. More...
 

Static Public Attributes

static const Enum< sunDirModelsunDirectionModelTypeNames_
 Names for sunDirModel. More...
 
static const Enum< sunLModelsunLModelTypeNames_
 Names for sunLModel. More...
 

Detailed Description

A solar calculator model providing models for the solar direction and solar loads.

Available models for the solar direction:

  • constant: Constant sunbeam direction.
  • tracking: Transient model calculating sunbeam direction based on a given set of parameters.

Available models for the solar load:

  • constant: Constant solar load.
  • timeDependent: Time-dependent solar load.
  • fairWeather: Solar fluxes are calculated following the "Fair Weather Conditions Method from the ASHRAE Handbook".
  • theoreticalMaximum: Theoretically maximum solar load.
Usage
Minimal examples by using constant/radiationProperties:

sunDirectionModel - Option-1:

solarLoadCoeffs
{
    sunDirectionModel           constant;
    sunDirection                (1 0 -1);
}

where the entries mean:

Property Description Type Reqd Deflt
sunDirection Sunbeam direction vector no calculated

sunDirectionModel - Option-2:

    solarLoadCoeffs
    {
        sunDirectionModel           tracking;
        sunTrackingUpdateInterval   800;
        localStandardMeridian       9;
        startDay                    204;
        startTime                   15;
        longitude                   139.74;
        latitude                    35.658;
        gridUp                      (0 0 1);
        gridEast                    (1 0 0);
    }

where the entries mean:

Property Description Type Reqd Deflt
sunTrackingUpdateInterval Interval to update the Sun direction [decimal hours] scalar yes -
localStandardMeridian GMT (Local Zone Meridian) [decimal hours] scalar yes -
startDay Day from 1 to 365 scalar yes -
startTime Start time for the Sun position [decimal hours] scalar yes -
longitude Geographic coordinate specifying the east–west position of a point on the surface of a planetary body [degree] scalar yes -
latitude Geographic coordinate specifying the north–south position of a point on the surface of a planetary body [degree] scalar yes -
gridUp Grid orientation upwards vector yes -
gridEast Grid orientation eastwards vector yes -

sunLoadModel - Option-1:

    solarLoadCoeffs
    {
        sunLoadModel                constant;
        directSolarRad              100;
        diffuseSolarRad             0;
    }

where the entries mean:

Property Description Type Reqd Deflt
directSolarRad Direct solar irradiation [W/m2] scalar yes -
diffuseSolarRad Diffuse solar irradiation on vertical surfaces [W/m2] scalar yes -

sunLoadModel - Option-2:

    solarLoadCoeffs
    {
        sunLoadModel                timeDependent;
        directSolarRad              <Function1<scalar>>;
        diffuseSolarRad             <Function1<scalar>>;
    }

where the entries mean:

Property Description Type Reqd Deflt
directSolarRad Time-series of direct solar irradiation [W/m2] Function1<scalar> yes -
diffuseSolarRad Time-series of diffuse solar irradiation on vertical surfaces [W/m2] Function1<scalar> yes -

sunLoadModel - Option-3:

    solarLoadCoeffs
    {
        sunLoadModel                fairWeather;
        skyCloudCoverFraction       0.25;
        groundReflectivity          1.0;
        A                           0.1;
        B                           0.2;
        C                           0.058;
        beta                        0.15;
    }

where the entries mean:

Property Description Type Reqd Deflt
A Apparent solar irradiation at air mass m = 0 scalar yes -
B Atmospheric extinction coefficient scalar yes -
C Solar diffusivity constant scalar yes -
groundReflectivity Ground reflectivity scalar yes -
skyCloudCoverFraction Fraction of sky covered by clouds [0,1] scalar no 0
beta Solar altitude (in degrees) above the horizontal scalar no calculated

In this model the flux is calculated as:

    directSolarRad = (1 - 0.75*skyCloudCoverFraction^3)*A/exp(B/sin(beta));

sunLoadModel - Option-4:

    solarLoadCoeffs
    {
        sunLoadModel                theoreticalMaximum;
        Setrn                       1.0;
        SunPrime                    4.0;
        groundReflectivity          1.0;
        C                           0.058;
    }

where the entries mean:

Property Description Type Reqd Deflt
Setrn Parameter in maximum theoretical direct solar model scalar yes -
SunPrime Parameter in maximum theoretical direct solar model scalar yes -
groundReflectivity Ground reflectivity scalar yes -
C Solar diffusivity constant scalar yes -

In this model the flux is calculated as:

    directSolarRad = Setrn*SunPrime;
Note
  • The sunDirectionModel:tracking can only be used in transient calculations.
  • The keyword sunTrackingUpdateInterval (in hours) specifies on which interval is the Sun direction updated.
  • The diffuse on vertical/horizontal walls and ground-reflected radiation are calculated following the ASHRAE Handbook.
  • The range of skyCloudCoverFraction is [0,1].
Source files

Definition at line 444 of file solarCalculator.H.

Member Enumeration Documentation

◆ sunDirModel

Options for the Sun direction models.

Enumerator
mSunDirConstant 
mSunDirTracking 

Definition at line 451 of file solarCalculator.H.

◆ sunLModel

enum sunLModel

Options for the Sun load models.

Enumerator
mSunLoadConstant 
mSunLoadTimeDependent 
mSunLoadFairWeatherConditions 
mSunLoadTheoreticalMaximum 

Definition at line 461 of file solarCalculator.H.

Constructor & Destructor Documentation

◆ solarCalculator()

solarCalculator ( const dictionary dict,
const fvMesh mesh 
)

Construct from dictionary.

Definition at line 269 of file solarCalculator.C.

◆ ~solarCalculator()

~solarCalculator ( )
default

Destructor.

Member Function Documentation

◆ ClassName()

ClassName ( "solarCalculator"  )

◆ correctSunDirection()

void correctSunDirection ( )

Correct the Sun direction.

Definition at line 307 of file solarCalculator.C.

References Foam::exp(), Foam::max(), and Foam::sin().

Here is the call graph for this function:

◆ correctDirectSolarRad()

void correctDirectSolarRad ( )

Correct direct solar irradiation.

Definition at line 318 of file solarCalculator.C.

◆ correctDiffuseSolarRad()

void correctDiffuseSolarRad ( )

Correct diffuse solar irradiation.

Definition at line 327 of file solarCalculator.C.

◆ sunDirectionModel()

const sunDirModel& sunDirectionModel ( ) const
inlinenoexcept

Return const access to the Sun direction model.

Definition at line 609 of file solarCalculator.H.

◆ sunLoadModel()

const sunLModel& sunLoadModel ( ) const
inlinenoexcept

Return const access to the Sun load model.

Definition at line 615 of file solarCalculator.H.

◆ direction() [1/2]

vector& direction ( )
inline

Return non-const access to the Sun direction.

Definition at line 621 of file solarCalculator.H.

◆ direction() [2/2]

const vector& direction ( ) const
inlinenoexcept

Return const access to the Sun direction.

Definition at line 627 of file solarCalculator.H.

◆ directSolarRad() [1/2]

scalar& directSolarRad ( )
inline

Return non-const access to the direct solar irradiation.

Definition at line 633 of file solarCalculator.H.

◆ directSolarRad() [2/2]

const scalar& directSolarRad ( ) const
inlinenoexcept

Return const access to the direct solar irradiation.

Definition at line 639 of file solarCalculator.H.

◆ diffuseSolarRad() [1/2]

scalar& diffuseSolarRad ( )
inline

Return non-const access to the diffuse solar irradiation.

Definition at line 645 of file solarCalculator.H.

◆ diffuseSolarRad() [2/2]

const scalar& diffuseSolarRad ( ) const
inlinenoexcept

Return const access to the diffuse solar irradiation.

Definition at line 651 of file solarCalculator.H.

◆ C()

scalar C ( ) const
inlinenoexcept

Return const access to the C constant.

Definition at line 657 of file solarCalculator.H.

◆ beta()

scalar beta ( ) const
inlinenoexcept

Return const access to beta.

Definition at line 663 of file solarCalculator.H.

◆ theta()

scalar theta ( ) const
inlinenoexcept

Return const access to theta.

Definition at line 669 of file solarCalculator.H.

◆ groundReflectivity()

scalar groundReflectivity ( ) const
inlinenoexcept

Return const access to the ground reflectivity.

Definition at line 675 of file solarCalculator.H.

◆ coord()

const coordinateSystem& coord ( ) const
inlinenoexcept

Return const access to the coordinate system.

Definition at line 681 of file solarCalculator.H.

◆ sunTrackingUpdateInterval()

scalar sunTrackingUpdateInterval ( ) const
inlinenoexcept

Return const access to sunTrackingUpdateInterval.

Definition at line 687 of file solarCalculator.H.

◆ startTime()

scalar startTime ( ) const
inlinenoexcept

Return const access to startTime.

Definition at line 693 of file solarCalculator.H.

Member Data Documentation

◆ sunDirectionModelTypeNames_

const Foam::Enum< Foam::solarCalculator::sunDirModel > sunDirectionModelTypeNames_
static

Names for sunDirModel.

Definition at line 458 of file solarCalculator.H.

◆ sunLModelTypeNames_

const Foam::Enum< Foam::solarCalculator::sunLModel > sunLModelTypeNames_
static

Names for sunLModel.

Definition at line 470 of file solarCalculator.H.


The documentation for this class was generated from the following files: