1.1 KiB
1.1 KiB
FUNCTION "CO2 Solubility" : Real
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : 'Function'
NAME : 'Name'
VERSION : 1.0
VAR_INPUT
i_Temp : Real;
END_VAR
VAR_TEMP
mT_Cub : Real;
mT_Quad : Real;
END_VAR
BEGIN
(* This FUNCTION calculates the CO2 absorption FOR a complete saturation *)
#mT_Cub := SQR(#i_Temp) * #i_Temp ;
#mT_Quad := SQR(#i_Temp);
IF "Blender_Constants".gCO2_Density <> 0 THEN
(* classic code: #"CO2 Solubility" := (-1.41118E-06 * #mT_Cub + 0.000202893 * #mT_Quad - 0.011685848 * #i_Temp + 0.331474668) / "Blender_Constants".gCO2_Density * 10;*)
#"CO2 Solubility" := (REAL#-1.41118E-06 * #mT_Cub + REAL#0.000202893 * #mT_Quad - REAL#0.011685848 * #i_Temp + REAL#0.331474668) / "Blender_Constants".gCO2_Density * 10;
(* classic code: ELSIF "Blender_Constants".gCO2_Density = 0.0 THEN*)
ELSIF "Blender_Constants".gCO2_Density = REAL#0.0 THEN
(* classic code: #"CO2 Solubility" := 0.0;*)
#"CO2 Solubility" := REAL#0.0;
ELSE
(* classic code: #"CO2 Solubility" := 0.0;*)
#"CO2 Solubility" := REAL#0.0;
END_IF;
END_FUNCTION