2.3.30.  DEFINE_SOLAR_INTENSITY

2.3.30.1. Description

You can use the DEFINE_SOLAR_INTENSITY macro to define direct solar intensity or diffuse solar intensity UDFs for the solar load model. See Modeling Heat Transfer in the User’s Guide for more information on the solar load model.


Important:  Note that solar intensity UDFs are used with the Solar Model, which is available only for the 3D geometries in ANSYS Fluent.


2.3.30.2. Usage

DEFINE_SOLAR_INTENSITY (name, sum_x, sun_y, sun_z, S_hour, S_minute)

Argument Type

Description

symbol name

UDF name.

real sun_x

x component of the sun direction vector.

real sun_y

y component of the sun direction vector.

real sun_z

z component of the sun direction vector.

real S_hour

Time in hours.

real S_minute

Time in minutes.

Function returns

real

There are six arguments to DEFINE_SOLAR_INTENSITY: name, sun_x, sun_y, sun_z, S_hour, and S_minute. You provide the name of your user-defined function. The variables sun_x, sun_y, sun_z, S_hour, and S_minute are passed by the ANSYS Fluent solver to your UDF. Your UDF will need to compute the direct or diffuse solar irradiation and return the real value (in ) to the solver.

2.3.30.3. Example

The following source code contains two UDFs: sol_direct_intensity computes the direct solar irradiation and returns it to the ANSYS Fluent solver, and sol_diffuse_intensity computes the diffuse solar irradiation.

#include "udf.h"
 
 DEFINE_SOLAR_INTENSITY(sol_direct_intensity,sun_x,sun_y,sun_z,hour,minute)
 {
    real intensity;
    intensity = 1019;
    printf("solar-time=%f intensity=%e\n", minute, intensity);
    return intensity;
 }
 
 DEFINE_SOLAR_INTENSITY(sol_diffuse_intensity,sun_x,sun_y,sun_z,hour,minute)
 {
    real intensity;
    intensity = 275;
    printf("solar-time=%f intensity-diff=%e\n", minute, intensity);
    return intensity;
 } 

2.3.30.4. Hooking a Solar Intensity UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_SOLAR_INTENSITY is interpreted (Interpreting UDFs) or compiled (Compiling UDFs), the name that you specified (for example, sol_direct_intensity) in the DEFINE macro argument will become visible and selectable for Direct Solar Irradiation and Diffuse Solar Irradiation in the Radiation Model dialog box in ANSYS Fluent. Note that the solar load model must be enabled. See Hooking DEFINE_SOLAR_INTENSITY UDFs for details.


Release 18.2 - © ANSYS, Inc. All rights reserved.