diff Discovery/Src/buehlmann.c @ 1049:d91345e9c009 GasConsumption

Added GF for surface: The GF for the surface will now be shown in the lowerleft corner as well as in the customer summary view.
author Ideenmodellierer
date Tue, 18 Nov 2025 18:53:21 +0100
parents 7891160acde3
children 88b6ab90c55a
line wrap: on
line diff
--- a/Discovery/Src/buehlmann.c	Sat Nov 15 19:29:44 2025 +0100
+++ b/Discovery/Src/buehlmann.c	Tue Nov 18 18:53:21 2025 +0100
@@ -320,11 +320,14 @@
 	float inertgas_a;
 	float inertgas_b;
 	float ceiling;
+	float M_surf,gf_surf;
 	float super_saturation;
 	float pres_respiration = pLifeData->pressure_ambient_bar;
+	float pres_surface = pLifeData->pressure_surface_bar;
 	int ci;
 
 	pDecoInfo->super_saturation = 0;
+	pDecoInfo->gf_surf = 0;
 
 	for (ci = 0; ci < 16; ci++)
 	{
@@ -341,6 +344,16 @@
 			inertgas_b = ( ( buehlmann_N2_b[ci] *  gTissue_nitrogen_bar[ci]) + ( buehlmann_He_b[ci] * gTissue_helium_bar[ci]) ) / tissue_inertgas_saturation;
 		}
 
+		M_surf = inertgas_a + inertgas_b * pres_surface;
+		if (M_surf > pres_surface)
+		{
+			gf_surf = (tissue_inertgas_saturation - pres_surface) / (M_surf - pres_surface);
+			if(gf_surf > pDecoInfo->gf_surf)
+			{
+				pDecoInfo->gf_surf = gf_surf;
+			}
+		}
+
 		ceiling = pres_respiration / inertgas_b + inertgas_a;
 		if(tissue_inertgas_saturation > pres_respiration)
 		{