CFDValsNodeData

Synopsis

The module CFDValsNodeData computes derived CFD field quantities from base values in the PLOT3D format (density, momentum, and stagnation).


module CFDValsNodeData <src_file="cfdvals.c"> {
  Node_Data+read+notify+req &in <NEportLevels={2,0}> [];
  CFDValsParams &CFDValsParams <NEportLevels={2,0}>;
  double+read+notify+req gamma => CFDValsParams.gamma;
  double+read+notify+req gas_constant => CFDValsParams.gas_constant;
  int+read+notify+req do_energy => CFDValsParams.do_energy;
  int+read+notify+req do_pres => CFDValsParams.do_pres;
  int+read+notify+req do_enthalpy => CFDValsParams.do_enthalpy;
  int+read+notify+req do_mach => CFDValsParams.do_mach;
  int+read+notify+req do_temp => CFDValsParams.do_temp;
  int+read+notify+req do_totpres => CFDValsParams.do_totpres;
  int+read+notify+req do_tottemp => CFDValsParams.do_tottemp;
  int nblocks => array_size(in);
  Node_Data+write+nonotify out[nblocks];
  CFDVals_comb_mesh_and_data CFDVals_comb_mesh_and_data[nblocks] {
    int index => index_of(CFDVals_comb_mesh_and_data);
    in_mesh => <-.in[index];
    in_nd => <-.out[index];
  };
  mlink+OPort2 fields => CFDVals_comb_mesh_and_data.out;
  omethod+notify_val+notify_inst update<status=1> = "cfd_values_update";
};

Description

The module CFDValsNodeData computes derived CFD field quantities from base values in the PLOT3D format. It inputs an array of Structured Fields (5-vector data at nodes)

  • density
  • x-momentum
  • y-momentum
  • z-momentum
  • stagnation

This module takes input in the form produced by the Read PLOT3D module, with an array of fields (multiblock) with 5 scalar components. Based on the toggle parameters, this module computes numerically derived quantities, usefull for flow visualization.

Two scalar parameters, Gamma and Gas Constant may be set in the user interface.

The field that cfd values receives from read plot3D has the following 5 values: density, X momentum, Y momentum, Z momentum, and stagnation.

From these 5 values cfd values computes 7 new values:

  • energy
  • pressure
  • enthalpy
  • mach number
  • temperature
  • total pressure
  • total temp

The gamma constant and the gas constant are user controllable parameters, and the following variables are defined:

       d = density
       xm = x momentum
       ym = y momentum
       zm = z momentum
       st = stagnation

The equations used to derive the new values are as follows:

       energy = stag / d
       pressure = (gamma - 1)(stag - ((0.5/d)(xm^2+ym^2+zm^2))
       enthalpy = (gamma/(gamma - 1))pressure/d
       mach number (M) = square_root(xm^2+ym^2+zm^2)
                         ---------------------------------------
                         (d * square_root(gamma * pressure /d ))
       temperature(T) = pressure / (d * gas constant)
       total pressure = pressure * exp(log(x) * gamma/(gamma - 1)
              where x = 1 - 0.5(gamma - 1) M * M
       total temperature = T(1 + (0.5*(gamma - 1) M * M

Note that, in calculating the 7 derived quantities, cfd values uses the same assumptions about the non-dimensionality, or normalization, of data that the National Aeronautics and Space Administration's PLOT3D, and the read plot3D module themselves use.

The min/max range of data is set on all blocks for consistancy. The module will compile and run in the user or express process.

The reader is written in an "omethod" style in C, with a multi-block (arrays of fields) output data structure. The DVswitch module can be used to select just one of the blocks for visualization with Main-Page modules, otherwise use the ARR modules for multiblock processing.

The low level code module takes a parameter block with default values as input. It only operates on Node_Data, and ignores the mesh. The user interface is in a separate macro and can be removed or replaced.

Inputs

&in

The input Node_Data array.

&CFDValsParams

Reference to the parameter block, which contains real instances of:

gamma

Specifies the gamma value to be used in the equations. A floating point value between 1 and 5, which determines the value of the constant. The formulas assume an ideal gas with a constant ratio of specific heats. The default value is 1.4.

gas_constant

Specifies the gas constant value to be used in the equations. A floating point value between 0 and 5, which determines the value of the gas constant. The default value is 1.

do_energy

Toggle the calculation of the energy.

do_pres

Toggle the calculation of the pressure.

do_enthalpy

Toggle the calculation of the enthalpy.

do_mach

Toggle the calculation of mach number.

do_temp

Toggle the calculation of the temperature.

do_totpres

Toggle the calculation of the total pressure.

do_tottemp

Toggle the calculation of the total temperature.

Outputs

fields

Output field array with modified Node_Data.

Utility Macros

The CFDValsNodeData module is used in conjunction with the CFDVals Functional Macro and the CFDValsUI UI Macro to form the User Macro cfd_values.

Example

An example application CFDValsEg is provided.

Files

iac_proj/cfdvals/cfdvmods.v contains the CFDValsParams group and the CFDValsNodeData module V definitions.

Other Notes

The low-level CFDValsMods library containing the module CFDValsNodeData does not specify a process. By default the express process will be used.

Authors

Ian Curington, AVS Inc. (March 97)

Modifications

Paul G. Lever

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

CFDValsParams, CFDValsUI, cfd_values.