VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
particles.h
Go to the documentation of this file.
1 /* © 1998 JRM Technologies, Inc.*/
2 
3 
4 
5 /***********************************
6 Copyright JRM Enterprises, Inc. 1998
7 All rights reserved.
8 
9 This code is the intellectual property of JRM Enterprises, Inc.
10 It may not be used or released as source or compiled binary form
11 without the prior written consent of JRM Enterprises, Inc.
12 ***********************************/
13 #ifndef _PARTICLES_H_
14 #define _PARTICLES_H_
15 
16 #include "JRMlibrary.h"
17 #include "atm_common.h"
18 #include "SigSimDefines.h"
19 #include "SourceData.h"
20 #include "sigsim.h"
21 #include "sigsimDLLstub.h"
22 
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29  typedef struct
30  {
31  double fuel_type; // The ratio of H (hydrogen mols) to C (Carbon mols) in the fuel molecules.
32  // If this is not available, then pass a negative number to use C8H18 as a default.
33  double fuel_rate; // [kg/s] Rate of fuel consumption for the engine.
34  double air_inlet_radius; // [m] Radius of the effective air intake.
35  double air_speed; // [m/s] Velocity of plane relative to the surrounding atmosphere (not the ground). Overridden by current state when applicable.
36  double air_pressure; // [mb] Pressure of the surrounding atmosphere. Overridden by current state.
37  double air_temperature; // [degK] Temperature of the surrounding atmosphere. Overridden by current state.
38  double airexhaustmixratio; // [unitless 0-1] Ratio of air to exhaust
39  double exhaust_nozzle_radius; // [m] Radius of the exhaust nozzle
40  double exhaust_temperature; // [degK] Temperature of the exhaust at the nozzle exit.
41  VECTOR exhaust_offset_vector; // [m] Offset of exhaust nozzle from platform center.
42  VECTOR effect_symmetry_axis; // [unitless] Symmetry axis of effect (generally points away from body)
43  } ENGINE_TYPE; // Particle System Engine Type Input Data
44 
45  typedef struct
46  {
47  double fuel_type; // The ratio of H (hydrogen mols) to C (Carbon mols) in the fuel molecules.
48  // If this is not available, then pass a negative number to use C8H18 as a default.
49  double heat_of_combustion; // [J/g] Heat of combustion of bulk fuel type
50  double fuel_density; // [g/m3] Density of fuel in the pellets
51  double flare_volume; // [m3] Flare cartridge or fuel source initial volume
52  double ground_burnrate; // [m3/s] Static volumetric burn rate at standard ground-level atmospheric pressure P0
53  double burnrate_exponent; // [unitless] Exponent of ratio (P/P0) where P is current ambient pressure.
54  double color_temperature; // [degK] Effective color temperature of flare combustion
55  double air_speed; // [m/s] Current velocity of the flare (assumed initialized to aircraft velocity)
56  double drop_rate; // [Hz] Rate at which flares are dropped (meaningless for flames).
57  } FLARE_FLAME; // Particle System Flare/Flame Input Data
58 
59  typedef struct
60  {
61  HEAVY_OBSCURANT_TYPE type; // [enum] Type of obscurant
62  double emission_rate; // [m3/s] Volumetric rate of obscurant emission into atmosphere
63  double initial_concentration; // [kg/m3] Mass concentration of initial obscurant emission in atmosphere (not specific gravity of particles)
64  double total_volume; // [m3] Total volume of obscurant releasable.
65  double initial_temperature; // [degK] Temperature of the obscurant at the nozzle exit.
66  VECTOR offset_vector; // [m] Offset of exhaust nozzle from platform center.
67  VECTOR effect_symmetry_axis; // [unitless] Symmetry axis of effect (generally points away from body)
68  } HEAVY_OBSCURANT; // Particle System Heavy Obscurant Input Data
69 
70  typedef enum
71  {
84 
85 #define NUM_OBSC_TYPES 21
86 #define NUM_FLOW_TYPES 11
87 
88 
89 typedef struct
90 {
91  PARTICLESYSTEM_TYPE flow_type; // [enum] Type of particle system flow
92  HEAVY_OBSCURANT_TYPE obsc_type; // [enum] Type of obscurant present in particle cloud or fuel combustion product
93  double fuelO2toX; // [unitless] Ratio of O2 to fuel molecules in combustion reaction equation
94  double fuelHtoC; // [unitless] Ratio of Hydrogen to Carbon in fuel molecule
95  double burn_rate; // [m3/s] Ground volumetric fuel burn rate
96  double density; // [kg/m3] For fuels, mass density of fuel in unburned state. Otherwise mass density of particle cloud as dispersed in air.
97  double xsec_exposed; // [m2] Total area exposed to emitted radiance release, e.g. flare cylinder cross-sectional area.
98  double tot_volume; // [m3] For fuels, total volume of fuel available. Otherwise total volume of particle cloud boundary.
99  double heat_of_combustion; // [J/kg] Heat of combustion of fuel. Not applicable for non-fuel psystem types.
100  double temperature; // [degK] Effective color temperature of Planckian spectral shape envelope for hot unburned particle cloud.
101  double air_speed; // [m/s] Speed of particle disperser platform through static air, if applicable.
102  double maxburnefficiency; // [unitless0-1] Max burn efficiency even in the presence of an infinite supply of oxygen.
103  VECTOR effect_offset_vector; // [m] Offset of effect from platform body center.
104  VECTOR effect_symmetry_axis; // [unitless] Symmetry axis of effect (generally points away from platform body)
105  int processpath; // 0=model_absolute, 1=vis_relative calculation path. Does not affect units of resultant prediction.
106  double rendered_radius; // [m] Assigned nonphysical "depth" of rendered particles, used to translate (e.g.) extinction per unit pathlength into extinction per particle.
107  char external_spectrum_file[SIGSIM_STRING_SIZE]; // If present, specifies a 2-column file {[um], [1/um]} giving the normalized non-Planckian part of the combustion spectrum.
108 } PARTICLEINPUT;
109 
110 /*
111  typedef struct
112  {
113  PARTICLESYSTEM_TYPE flow_type;
114  ENGINE_TYPE engine_type;
115  FLARE_FLAME flare_flame;
116  HEAVY_OBSCURANT heavy_obscurant;
117  } PARTICLEINPUT; // Particle System Input Parameters Wrapper
118 */
119 
120  typedef struct
121  {
122  double theta[2]; // [rad] low & high range of angle between particle trajectory vector and Z-axis
123  double phi[2]; // [rad] low & high range of angle between particle trajectory vector X-Y-plane projection and X-axis.
124  double linspeed[2]; // [m/s] low & high range of particle trajectory speed
125  double rate[2]; // [Hz] low & high range of particle creation frequency
126  double accelZ; // [m/s2] acceleration along Z-axis (Gravity = -9.98)
127  double vert1[3]; // [m] 1st vertex of line defining trajectory XYZ system, expressed in global system
128  double vert2[3]; // [m] 2nd vertex of line defining trajectory XYZ system, expressed in global system
129  } PARTICLERADIALSHOOTER; // Particle Radial Shooter Parameters
130 
131  typedef struct
132  {
133  double density; // [kg/m3] density of fluid : air=1.2929, water=1.0
134  double viscosity; // [Pa s] = [kg/m/s] dynamic viscosity of fluid : air=1.8E-5, water=1.002E-3
135  } PARTICLECARRIERFLUID; // Particle Carrier Fluid Parameters
136 
137  typedef struct
138  {
139  char sensorName[SIGSIM_STRING_SIZE]; // Sensor (unique) name
140  double alphaRange[2]; // [0-1] Transparency range (alpha=0=transparent and alpha=1=opaque)
141  double colorRange[2]; // [0-1] Color range
142  double reflectRange[2]; // [0-1] Reflectivity range
143  } PARTICLEBANDSIGNATURE; // Particle signature for given waveband
144 
145  typedef struct
146  {
147  double lifeTime; // [s] Lifetime
148  double sizeRange[2]; // [m] Size range
149  double mass; // [kg] Mass
150  double radius; // [m] Radius
151  //PARTICLEBANDSIGNATURE *sig; // Array of particle signatures for different wavebands.
152  //int nsigs; // Number of signatures stored in the sig array.
153  double *emission; // [W/cm2/sr/um] Emission spectral array (over metin.inf.spectrum)
154  double *reflectivity; // [unitless] Reflectivity spectral array (over metin.inf.spectrum)
155  double *alpha; // [unitless] Alpha spectral array (over metin.inf.spectrum)
156  } PARTICLE; // Particle for rendering smoke clouds, plumes, etc.
157 
158  typedef struct
159  {
160  PARTICLESYSTEM_TYPE flow_type; // [enum] particle system type
161  PARTICLE particle; // Characteristics of each particle
162  PARTICLERADIALSHOOTER shooter; // Characteristics of the particle radial shooter (if any)
163  PARTICLECARRIERFLUID fluid; // Characteristics of the particle carrier medium
164  } PARTICLESYSTEM; // Particle system for rendering smoke clouds, plumes, etc.
165 
166  SIGSIM_API int LoadPARTICLEINPUTData(char *filename, PARTICLEINPUT **pinput);
170  SIGSIM_API int AllocateParticleSystemSignatures(PARTICLESYSTEM *psystem, long nlambda);
171  SIGSIM_API int CreateAndProcessParticleSystem(char *sigsim_atm_dir, METIN *metin, PARTICLEINPUT *pinput, PARTICLESYSTEM *psystem, double alt_km, PARTICLESYSTEM_TYPE type);
172  int ProcessATMVolume(char *sigsim_atm_dir, METIN *metin, PARTICLEINPUT *pinput, double alt_km, double *plumelength, double timestep_s, ATM_VOL_PROPS *atm);
173  int CalcATMVolumeProperties(PARTICLEINPUT *pinput, METIN *metin, double alt_km, double mass_burn_rate, ATM_VOL_PROPS *atm, double *plumelength, double *burn_fraction, double *densityinair);
174 
175 
176  //int Fill_ENGINE_TYPE_ATMVolume(char *sigsim_atm_dir, METIN *metin, ENGINE_TYPE *engine, double altitude_km, ATM_VOL_PROPS *atm, double *plumelength);
177  //int Fill_FLARE_FLAME_ATMVolume(char *sigsim_atm_dir, METIN *metin, FLARE_FLAME *ff, double altitude_km, double timestep_s, ATM_VOL_PROPS *atm, double *refdist, PARTICLESYSTEM_TYPE type);
178 
180 
181  double CalcFlareVolumeProperties(ATM_VOL_PROPS *atm, double surfarea, double mass_burn_rate, double air_speed, double maxburnefficiency, double *burn_fraction, double *densityinair);
182  double CalcFlameVolumeProperties(ATM_VOL_PROPS *atm, double surfarea, double fuelO2toX, double fuelHtoC, double mass_burn_rate, double air_speed, double maxburnefficiency, double *burn_fraction, double *densityinair);
183  int GetMgPTFESpectralShape(SPECTRAL_DOMAIN spectrum, double *shape);
184  int GetPropaneSpectralShape(SPECTRAL_DOMAIN spectrum, double *shape);
185  int GetObscurantRefractiveIndex(double RHratio, HEAVY_OBSCURANT_TYPE type, SPECTRAL_DOMAIN spectrum, jrmComplex *refract);
186  SIGSIM_API int CalculateObscurantMassAtmosphericCoefficients(HEAVY_OBSCURANT_TYPE type, double RHratio, SPECTRAL_DOMAIN spectrum, double *massabsorb, double *massscatter);
187 
188  //int Fill_Obscurant_ATMVolume(METIN *metin, HEAVY_OBSCURANT *obscurant, double altitude_km, double timestep_s, ATM_VOL_PROPS *atm);
189  // CreateAndProcessParticleObscurant fills a PARTICLE solid structure with physical data, given an input environment, obscurant type, and altitude.
190  // It calls Fill_Obscurant_ATMVolume, then fills the PARTICLE structure accordingly.
191  //SIGSIM_API int CreateAndProcessParticleObscurant(char *sigsim_atm_dir, METIN *metin, HEAVY_OBSCURANT *obscurant, PARTICLESYSTEM *psystem, double altitude_km, PARTICLESYSTEM_TYPE type);
192 
193  // CreateAndProcessParticlePlume fills a PARTICLE solid structure with physical data, given an input environment, engine type, altitude, and airexhaustmixratio.
194  // It calls Fill_ENGINE_TYPE_ATMVolume, then fills the PARTICLE structure accordingly.
195  //SIGSIM_API int CreateAndProcessParticlePlume(char *sigsim_atm_dir, METIN *metin, ENGINE_TYPE *engine, PARTICLESYSTEM *psystem, double altitude_km, PARTICLESYSTEM_TYPE type);
196 
197  // CreateAndProcessParticleFlareFlame fills a PARTICLE solid structure with physical data, given an input environment, flare/flame type, and altitude.
198  // It calls Fill_FLARE_FLAME_ATMVolume, then fills the PARTICLE structure accordingly.
199  //SIGSIM_API int CreateAndProcessParticleFlareFlame(char *sigsim_atm_dir, METIN *metin, FLARE_FLAME *ff, PARTICLESYSTEM *psystem, double altitude_km, PARTICLESYSTEM_TYPE type);
200 
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif // _PARTICLES_H_
207 
208 
209 


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)