Environment Error

[INFO] : [8.56(s)] [Action] 8.56(s), Environment Action : Change Environmental Conditions
SurroundingType: NullSurrounding
Air Velocity: 0.1(m/s)
Ambient Temperature: 22(degC)
Atmospheric Pressure: Not Set
Clothing Resistance: 0.5(clo)
Emissivity: 0.95
Mean Radiant Temperature: 22(degC)
Relative Humidity: 0.6
Respiration Ambient Temperature: 22(degC)
Substance : Nitrogen Fraction Amount 0.7896
Substance : Oxygen Fraction Amount 0.21
Substance : CarbonDioxide Fraction Amount 0.0004
Substance : CarbonMonoxide Fraction Amount 0
[ERROR] : [8.56(s)] Environment Ambient Substance fractions do not sum to 1

[INFO] : [102.62(s)] [Action] 102.62(s), Environment Action : Change Environmental Conditions
SurroundingType: NullSurrounding
Air Velocity: 0.1(m/s)
Ambient Temperature: 22(degC)
Atmospheric Pressure: Not Set
Clothing Resistance: 0.5(clo)
Emissivity: 0.95
Mean Radiant Temperature: 22(degC)
Relative Humidity: 0.6
Respiration Ambient Temperature: 22(degC)
Substance : Nitrogen Fraction Amount 0.7896
Substance : Oxygen Fraction Amount 0.21
Substance : CarbonDioxide Fraction Amount 0.0003
Substance : CarbonMonoxide Fraction Amount 0.0001
[ERROR] : [102.62(s)] Environment Ambient Substance fractions do not sum to 1

conditions.GetAmbientGas(*N2).GetFractionAmount().SetValue(0.7896);
conditions.GetAmbientGas(*O2).GetFractionAmount().SetValue(0.21);
conditions.GetAmbientGas(*CO2).GetFractionAmount().SetValue( 0.0003);
conditions.GetAmbientGas(*CO).GetFractionAmount().SetValue( 0.0001);

after that

In another thread
pe->ProcessAction(env);

Cause error

I ran the HowTo-EvironmentChange and modified these lines to match your numbers

I did not get the error.

You can test the specific method by doing

double n2 = 0.7896;
double o2 = 0.21;
double co2 = 0.0003;
double co = 0.0001;
double total = n2 + o2 + co2 + co;
if (!SEScalar::IsValue(1, total))
std::cout << “Not One” << std::endl;

On my machine total = 0.99999999999999989;
But this is with in the 1e-10 epsilon used by IsValue

Privacy Notice