3.7.1. Spatially Resolved Panel

Use this panel to specify spatially resolved species of the model. Check the Spatially Resolved Output Control box to activate the options. The major options are to output based on Time Steps, based on Crank Angles (for engine simulations), or based on Temporal (time) values (for other types of simulations). Once this is determined, the following options are available under the selected sub-panel:

  • Crank Angle Output Control

    • Interval Based Outputs. Output Every: This allows specification of the frequency for saving spatially resolved solution data in terms of selected units.

    • User Defined Crank Angle Output: In addition to the above or instead of regular intervals, you can enter a series of discrete points at which spatially resolved data will be saved, using the Profile Manager. You can select the Repeat Profile Each Cycle option to convert the CA values in the range of [0, 720) °CA (for 4-stroke engines) or [0, 360) °CA (for 2-stroke engines), and they will be treated as cyclic and repeated on a 720-degree schedule (4-stroke) or 360-degree schedule (2-stroke). You may choose to Use Global Crank Angle Limits to impose a global crank angle range for the cyclic repetition of these CA values. If the Repeat Profile Each Cycle option is not selected, then the CA values will not be converted to cyclic. Note that in a multi-cylinder engine simulation, the user-defined CA values will be checked in all cylinders' local time frames to determine when to output solutions.

  • Temporal Output Control

    • Interval Based Outputs. Output Every: This allows specification of the frequency for saving spatially resolved solution data in terms of selected time-related units.

    • User Defined Output (Time): In addition to the above or instead of regular time intervals, you can enter a series of discrete times at which spatially resolved data will be saved, using the Profile Manager. For these "profiles" the first column is simply the index of the entry.


Note:  A Forte .ftind index file is created during the Forte run and is an ASCII file that is a list of all the spatially resolved solutions generated throughout the run. This file is used to post-process these solutions. See Workflows: Preparing and Executing Runs for information about the .ftind file and how it is used.


3.7.1.1. Configuring the Solution Files

In addition to controlling the timing of the output, you can also control the content, specifically for selecting which chemical species will be reported in the saved solution and how many files are written for the output. Use the File Size Control to determine whether 1 solution (the default) or more solutions are written per file, all solutions are written to a single file, or file size is the parameter controlling the number of solution files. Select among Mass Fractions, Mole Fractions, and Species Densities for the values of solution data.

In the Spatially Resolved Species sub-panel, select which species data will be saved in the solution file. Move species from the Choices list to the Selection list to include them as a Spatially Resolved Species. You can type into the Filter box to limit the species presented in the Choices list. If the Method of Moments soot model is selected (under Models on the Workflow tree, see Soot Model), additional variables are output to the solution file, as listed in Table 3.5: Spatially resolved variables that are output to the solution file when the Method of Moments soot model is used for spatially resolved variables and Table 3.7: Spatially averaged variables that are output to the .csv files when the Method of Moments soot model is used for spatially averaged variables. If the simulation type is Eulerian two-phase flow (Gas-Phase and Eulerian Two-Phase Flow Simulations), all the liquid species data will be saved in the solution file.

You can also control how many files are used to store the spatially resolved results using the File Size Control option. By default, 1 solution is written per .ftres file, but you can have all solutions written to a single large .ftres file or distribute them across several files if you prefer dealing with smaller files, using the following options:

  • One File: All solutions are written to a single large .ftres file.

  • File Size: Set the target file size in megabytes of each .ftres file. If the current .ftres file size exceeds this value, then a new .ftres is created.

  • Solution Count: Use to control how many solutions are stored in each .ftres file. Set to n to store n solutions per .ftres file. This is the default, with n=1.

  • By Crank Angles: Use to store solutions in separate .ftres files that cover ranges of crank angles. Select Create new from the list and click the Pencil  icon to define a list of crank angle values for which a new .ftres file must be used. For example, if -50, 0, 50 is used, then four .ftres files will be created – one for solutions up to CA -50, one for solutions between -50 and 0, one for solutions between 0 and +50, and a fourth .ftres for all solutions from 50 CA onwards.

  • By Time Points: Define how the results are split into separate .ftres files for ranges of time points. Similar to crank angles, but for time points.

In addition to any selected output species, Ansys Forte allows selective output of spatially resolved data from the variables listed in Table 3.3: Spatially resolved variables that are eligible output to the solution file. Ansys Forte always outputs the spatially averaged variables listed in Table 3.6: Spatially averaged variables that are always output to the .csv files. Spatially resolved variables that are used with the Method of Moments soot model are listed in Table 3.5: Spatially resolved variables that are output to the solution file when the Method of Moments soot model is used.

Ansys Forte also allows selective output of statistics solutions (mean and standard deviation) of spatially resolved data from both species and the variables listed in Table 3.3: Spatially resolved variables that are eligible output to the solution file. Click the New Statistical Solution   icon at the top of the Spatially Resolved panel to add the Statistical Solution control. You can control when to start and/or stop the statistics solution based on time or global crank angle. You can also select Never from Statistics Time Option to turn OFF statistics solution completely.

Table 3.3: Spatially resolved variables that are eligible output to the solution file

Variable

Description

Variables defined at cell center

Pressure

Static pressure of gas-phase mixture. Unit: dyne/cm2.

Temperature

Temperature of gas-phase mixture. Unit: K.

Density

Density of gas-phase mixture. Unit: g/cm3.

Viscosity

Effective dynamic viscosity of gas-phase mixture. Calculated as the sum of the laminar and turbulent contributions: . Unit: g/cm-s.

CellVolume

Volume of the computational cells. Unit: cm3.

InternalEnergy

Specific internal energy of gas-phase mixture. Unit: erg/g.

Enthalpy

Specific enthalpy of gas-phase mixture. Unit: erg/g.

ThermalConductivity

Effective heat conductivity of gas-phase mixture. Unit: erg/cm-s-K.

TurbulentKineticEnergy

Turbulent kinetic energy per unit mass, defined as where u' is turbulence velocity. Unit: cm2/s2.

TKEDissipationRate

Dissipation rate of the turbulent kinetic energy per unit mass. Unit: cm2/s3.

TurbulenceVelocity

Turbulence velocity, defined as where TKE is turbulent kinetic energy. Unit: cm/s.

IntegralLengthScale

Largest length scale of the turbulent flow which possesses most of the turbulent kinetic energy, computed as: , where is a turbulent constant, k is turbulent kinetic energy and ε is the dissipation rate of the turbulent kinetic energy.

TurbulentViscosity

Turbulent contribution to the effective dynamic viscosity of gas-phase mixture. Calculated as: . Unit: g/cm-s.

HeatCapacityConstV

Heat capacity of gas-phase mixture at constant volume. Unit: erg/g-K.

HeatCapacityConstP

Heat capacity of gas-phase mixture at constant pressure. Unit: erg/g-K.

FuelVaporMassFraction

Sum of mass fractions of gas-phase fuel species.

EquivalenceRatio

The ratio of oxygen needed to convert carbon and hydrogen to CO2 and H2O to the oxygen available in the mixture. Where [C], [H], and [O] are the sum concentrations of carbon, hydrogen, and oxygen atoms in the mixture, respectively:

This definition of equivalence ratio is essentially an element ratio that considers all the species in the mixture. It measures the equivalence ratio of a mixture in its unburned state. Using this definition, a mixture’s equivalence ratio remains constant as it changes from unburned to completely combusted in the combustion process.

Note:  To avoid overly large values, if the denominator of the calculation is very small, the variable upper bound is fixed at 15

ProgressEquivalenceRatio

The progress equivalence ratio is calculated as:

where [C], [H], and [O] are the sum concentrations of carbon, hydrogen, and oxygen atoms in species excluding CO2, H2O, and O2, and [O] from O2 is the concentration of oxygen atoms from O2. Using this variation definition, the φ value varies as a combustible mixture changes from its unburned state to completely burned state in the combustion process.

Note: When Equivalence Ratio is selected from the Spatially Resolved setup panel, both Equivalence Ratio and Progress Equivalence Ratio will be written in the solution.

Note:  To avoid overly large values, if the denominator of the calculation is very small, the variable upper bound is fixed at 15

MeanMolecularWeight

Mean molecular weight of the gas-phase mixture. Unit: g/mol.

ChemHeatReleaseRate

Rate of heat released per unit mass in the gas phase due to chemical reaction. Unit: cm2/s3 or erg/s-g.

PartitionIndex

Integer flags used to mark the indices of domain partitions for a parallel simulation.

SprayApparentDensityCell-based parameter useful for tracking the spatial distribution of liquid spray parcels. It is calculated as the total mass of liquid parcels contained in a CFD cell divided by the cell volume. Unit: g/cm3.

Variables defined at vertex when body-fitted and at cell center when auto-mesh

HeatTransferCoefficient

Convective heat transfer coefficient on the wall. Unit: erg/(cm2-K).

HeatFlux

Convective heat transfer flux on the wall. Unit: erg/(s-cm2).

WallShearStress

Wall shear stress. Unit: dynes/cm2.

Yplus

y+ value, which is a dimensionless distance used in the law-of-the-wall model. At each location along a wall, y+ is defined as

where is a turbulence model constant, k is turbulent kinetic energy, y is half of the distance from the first off-wall grid point to the wall, ν is the kinematic viscosity of the local fluid. Unit: dimensionless.

WallFilmThickness

Thickness of the oil film deposit on the wall surface as a result of spray-wall impingement. Unit: cm.

Variables defined at vertex

VelocityX

The x-component of gas velocity. Unit: cm/s.

VelocityY

The y-component of gas velocity. Unit: cm/s.

VelocityZ

The z-component of gas velocity. Unit: cm/s.

VelocityMagnitude

Root-mean-square of the x-,y-, and z-components of gas velocity. Unit: cm/s.

VertexFlag

Integer flags used to mark different types of vertices following KIVA-3V's convention.

RegionFlag

Integer flags used to mark the indices of initialization regions. Initialization regions are used to define initial condition (see Initial Conditions Node).

G

Non-reactive scalar used in the chemistry solver flame propagation model for tracking the mean flame front surface. The G value at a vertex is defined as the signed normal distance from the vertex to the mean flame front surface. Unit: cm.

LaminarFlameSpeed

Laminar flame speed defined by Equation 7–18 in the Ansys Forte Theory Manual. Unit: cm/s.

TurbulentFlameSpeed

Flame defined by Equation 7–27 in the Ansys Forte Theory Manual. Unit: cm/s.

FlameStretchFactor

Flame stretch factor due to curvature and turbulence effect, defined by Equation 7–4 in the Ansys Forte Theory Manual. Unit: dimensionless.

FlameBrushThickness

Turbulent flame brush thickness, defined by Equation 7–35 in the Ansys Forte Theory Manual. Unit: cm.


Table 3.4: Spatially resolved variables that are eligible output to the solution file when the Eulerian two-phase flow simulation is performed

Variable

Description

Variables defined at cell center

LiquidVolumeFraction

Volume fraction of the liquid phase in the Eulerian two-phase fluid mixture.

VaporVolumeFraction

Volume fraction of the gas phase in the Eulerian two-phase fluid mixture.


Table 3.5: Spatially resolved variables that are output to the solution file when the Method of Moments soot model is used

Variable

Description

Variables defined at cell center

 

PMAreaDensity

Surface area of soot particles per volume of gas. Unit: cm2/cm3.

PMAvgDiameter

Average soot particle diameter. Unit: nm.

PMMassDensity

Mass of soot particles per volume of gas. Unit: g/cm3.

PMVolumeFraction

Volume of soot particles per volume of gas. Unit: cm3/cm3.

SiteFraction

In the soot surface mechanism, one or more sites are specified where surface reactions can occur. This variable provides the fraction of overall sites occupied by each of the sites.

psdf_number_density_0th_moment, psdf_number_density_1st_moment, psdf_number_density_2nd_moment, ... up to a maximum of psdf_number_density_5th_moment

The values of the particle-size distribution function (psdf) that are solved for. The number of moments is user-defined, and can vary from 3-6, with 3 moments typically being sufficient. Unit: #/cm3.

The zero-th moment (psdf_number_density_0th_moment) provides the total particle number density.


3.7.1.2. Output User Routine Option

An option for an output user defined function is available on the Spatially Resolved Editor panel. Check the Use User Defined Functions for Output box to activate this option. The timing of the output user defined function option is the same as the timing of the Ansys Forte CGNS output. The output UDFs will be compiled into a dynamic link library, libForteUDF_output.dll, on Windows, or a shared object, libForteUDF_output.so, on Linux. Do not change the names for the .dll or .so files because this naming convention is used by the Forte executable. For the language used in writing the UDFs, we support both Fortran and C/C++.

See the Ansys Forte installation’s user_defined_functions directory for assistance with creating and configuring user defined functions:

  • The README.txt file repeats these instructions on how to build the shared object and set the necessary path to use it in Ansys Forte simulations.

  • Refer to the template files in the output subdirectory as examples for the output user defined functions. The template user defined functions demonstrate how to write heat-transfer solution data on both hexahedral grid and surface grid to .csv files in comma-delimited format.

  • There are detailed in-line comments inside the template files for both C/C++ user routines and Fortran user defined functions. Read the comments for descriptions of how each UDF can be used.

  • Make files (described next).

You can use the make files provided in the user_defined_functions directory to build the output user defined functions’ shared objects after you have set up the necessary Intel compiler environment. For compiler support, see the For detailed and current information on Ansys compiler compatibility, see the "Platform Details" chapter in the Ansys, Inc. Linux Installation Guide or Ansys, Inc. Windows Installation Guide in the Ansys, Inc. Installation and Licensing Set. Although the Intel compiler is recommended, other compilers may work as well, such as the compiler included in Microsoft Visual Studio. The template make files are customized for Intel compilers. Therefore, if you use a different compiler, adjust the compiler and linker names (FOR, CPP, CXX) accordingly. You may also need to remove the libraries specified in macro F77_SYSTEM_LIBS because some of them are specific to Intel compilers.


Tip:  No matter what compiler you use, make sure to choose the 64-bit (x64) version. Shared objects built using a 32-bit (x86) compiler are incompatible with the Forte executable and cannot be loaded correctly.


To build the shared objects, select the appropriate command for your environment from this list.

  • C user-defined functions DLL on Windows systems:

    %nmake MODULE=output COMP=c -f user_defined_functions_win64.mak all

  • C++ user-defined functions DLL on Windows systems:

    %nmake MODULE=output COMP=cpp -f user_defined_functions_win64.mak all

  • Fortran user-defined functions DLL on Windows systems:

    %nmake MODULE=output COMP=for -f user_defined_functions_win64.mak all

  • C user-defined functions shared object on Linux systems:

    %make MODULE=output COMP=c -f user_defined_functions_linuxx8664.mak all

  • C++ user-defined functions shared object on Linux systems:

    %make MODULE=output COMP=cpp -f user_defined_functions_linuxx8664.mak all

  • Fortran user-defined functions shared object on Linux systems:

    %make MODULE=output COMP=for -f user_defined_functions_linuxx8664.mak all

If you plan to use your own make file or build script or if you plan to change the provided make files, follow these naming conventions for the final shared object:

libForteUDF_output.dll on Windows systems

libForteUDF_output.so on Linux systems

Such naming conventions are used inside the Ansys Forte executable to load the shared object.

Once the shared object is created, it will be copied to the \user_defined_functions\bin directory automatically. There are two approaches to providing the location of the shared object to the Ansys Forte executable for dynamic loading during run time. The first approach is recommended.

  1. Define an Ansys Forte specific environment variable FORTE_UDF_LIBRARY_PATH and let it point to the location where the .dll or .so files are stored. When a Forte project is set up in the Forte UI, the UI will define this environment variable automatically and display it on the "Run Settings" > "Windows Settings" or "Linux Settings" panels. The default values of FORTE_UDF_LIBRARY_PATH are:

    Windows: FORTE_UDF_LIBRARY_PATH=%REACTION_DIR%\forte.win64\user_defined_functions\bin

    Linux: FORTE_UDF_LIBRARY_PATH=${REACTION_DIR}/forte.linuxx8664/user_defined_functions/bin

    REACTION_DIR is the path of the reaction folder under the Ansys installation. If you need to put the UDF .dll or .so files at a different location, modify FORTE_UDF_LIBRARY_PATH to point to that location. At run time, the path specified by FORTE_UDF_LIBRARY_PATH will be temporarily appended to the system PATH (Windows) or LD_LIBRARY_PATH (Linux) for dynamic loading of the UDF libraries. The system PATH or LD_LIBRARY_PATH will not be altered outside the Ansys Forte application.

  2. Manually modify the system environment variables PATH on Windows or LD_LIBRARY_PATH on Linux systems to append the location of the UDF libraries (.dll or .so files) to the system path. This operation is done outside the Ansys Forte application, and these system environment variables will be modified permanently.


Note:  If you choose to modify the system PATH or LD_LIBRARY_PATH environment variables manually but are not sure how to do so, contact your system administrator. These environment variables are vital to the proper functioning of many programs, so be very careful when updating them.