EcoExtreML / STEMMUS_SCOPE

Integrated code of SCOPE and STEMMUS
GNU General Public License v3.0
14 stars 6 forks source link

A problem in the calculations of `QVT` during saturation conditions #230

Closed MostafaGomaa93 closed 3 months ago

MostafaGomaa93 commented 4 months ago

The vapour flux due to temperature gradient (QVT) is one component of the total vapour flux QV in the calculateEnergyParameters (lines 69-73). Specifically the QVT is that term (DEhBAR * EtaBAR + GasDispersivity.D_Vg(i)) * DRHOVTDz(i) * DTDZ(i) of the QV calculations.

The QVT has extremely high values (e.g. 10^23) when there is a saturation condition (in the code -> these saturation conditions are when Theta_UU ~= Theta_S and Theta_g ~= 0). This saturation condition occurs for:

After debugging, it turns out that the main issue comes for the enhancement factor for thermal vapour transfer (ETa) calculated in the calcualteVporVariables at line 43. So, when we have saturation conditions (from one of the two cases above (a, b)) -> Theta_g ~= 0, then the variables EnhnLiqIsland and f0 at lines (lines 36-39) have too low values (e.g. 10^-15) -> leading to extreme large value of Eta (e.g. 10^30).

Physically, when the gas content is zero (Theta_g ~= 0) -> there is no vapor transfer (so QVT should be ~= 0) , so we can shut down the Eta

A proposed solution (which I tested and worked fine) is to add an IF condition like below: if Theta_g(i, j) <= 1e-2 Eta(i, j) = 0; end

MostafaGomaa93 commented 3 months ago

I discussed this issue with @yijianzeng already. In the meantime, we came up with a solution and implemented it in the branch SSM_v.0.3.2 (here)