From f9ab284faabeb1fec71c38b42b6c6ba296d61cda Mon Sep 17 00:00:00 2001 From: Enting Tang <101427283+EntingTang@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:13:39 +0100 Subject: [PATCH 1/4] Add reference and explanation on Soil_Inertia1.m --- src/+equations/Soil_Inertia1.m | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/+equations/Soil_Inertia1.m b/src/+equations/Soil_Inertia1.m index ce3499f7..d1367661 100644 --- a/src/+equations/Soil_Inertia1.m +++ b/src/+equations/Soil_Inertia1.m @@ -1,34 +1,34 @@ function [GAM] = Soil_Inertia1(SMC, theta_s0) - % soil inertia method by Murray and Verhoef ( + % soil inertia method by Murray and Verhoef (2007), and the soil inertial (GAM) is used to calculate the soil heat flux % % parameters - theta_s = theta_s0; % (saturated water content, m3/m3) + theta_s = theta_s0; %(saturated water content, m3/m3) Sr = SMC / theta_s; % fss = 0.58; %(sand fraction) - gamma_s = 0.27; % (soil texture dependent parameter) - dels = 1.33; % (shape parameter) + gamma_s = 0.27; %(soil texture dependent parameter; if fss>0.4, gamma_s=0.96 while fss=<0.4, gamma_s=0.27) + dels = 1.33; %(shape parameter, constant) - ke = exp(gamma_s * (1 - power(Sr, gamma_s - dels))); + ke = exp(gamma_s * (1 - power(Sr, gamma_s - dels))); %(Kersten number, Eq.(15)) - phis = theta_s0; % (phis == theta_s) - lambda_d = -0.56 * phis + 0.51; + phis = theta_s0; %(porosity, phis == theta_s = theta_s0) + lambda_d = -0.56 * phis + 0.51; %(thermal conductivity for air-dry soil, Eq.(16)) - QC = 0.20; % (quartz content) - lambda_qc = 7.7; % (thermal conductivity of quartz, constant) + QC = 0.20; %(quartz content, ≈fss if no measured data) + lambda_qc = 7.7; %(thermal conductivity of quartz, W/m.K, constant) - lambda_s = (lambda_qc^(QC)) * lambda_d^(1 - QC); - lambda_wtr = 0.57; % (thermal conductivity of water, W/m.K, constant) + lambda_s = (lambda_qc^(QC)) * lambda_d^(1 - QC); %(thermal conductivity of the soil solids, Eq.(18)) + lambda_wtr = 0.57; %(thermal conductivity of water, W/m.K, constant) - lambda_w = (lambda_s^(1 - phis)) * lambda_wtr^(phis); + lambda_w = (lambda_s^(1 - phis)) * lambda_wtr^(phis); %(thermal conductivity for saturated soil, Eq.(17)) - lambdas = ke * (lambda_w - lambda_d) + lambda_d; + lambdas = ke * (lambda_w - lambda_d) + lambda_d; %Eq.(14) - Hcs = 2.0 * 10^6; - Hcw = 4.2 * 10^6; + Hcs = 2.0 * 10^6; %(heat capacity of solid soil minerals, J/m3.K) + Hcw = 4.2 * 10^6; %(heat capacity of water, J/m3.K) - Hc = (Hcw * SMC) + (1 - theta_s) * Hcs; + Hc = (Hcw * SMC) + (1 - theta_s) * Hcs; %Eq.(13) - GAM = sqrt(lambdas .* Hc); + GAM = sqrt(lambdas .* Hc); %Eq.(10) end From dc396d20ad04305f9e8360011a2d2f5ac7b94e45 Mon Sep 17 00:00:00 2001 From: Enting Tang <101427283+EntingTang@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:23:40 +0100 Subject: [PATCH 2/4] Change the comment style of Soil_Inertia1.m to follow the best practice --- src/+equations/Soil_Inertia1.m | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/+equations/Soil_Inertia1.m b/src/+equations/Soil_Inertia1.m index d1367661..73e43b96 100644 --- a/src/+equations/Soil_Inertia1.m +++ b/src/+equations/Soil_Inertia1.m @@ -3,32 +3,32 @@ % % parameters - theta_s = theta_s0; %(saturated water content, m3/m3) + theta_s = theta_s0; % (saturated water content, m3/m3) Sr = SMC / theta_s; - % fss = 0.58; %(sand fraction) - gamma_s = 0.27; %(soil texture dependent parameter; if fss>0.4, gamma_s=0.96 while fss=<0.4, gamma_s=0.27) - dels = 1.33; %(shape parameter, constant) + % fss = 0.58; % (sand fraction) + gamma_s = 0.27; % (soil texture dependent parameter; if fss>0.4, gamma_s=0.96 while fss=<0.4, gamma_s=0.27) + dels = 1.33; % (shape parameter, constant) - ke = exp(gamma_s * (1 - power(Sr, gamma_s - dels))); %(Kersten number, Eq.(15)) + ke = exp(gamma_s * (1 - power(Sr, gamma_s - dels))); % (Kersten number, Eq.(15)) - phis = theta_s0; %(porosity, phis == theta_s = theta_s0) - lambda_d = -0.56 * phis + 0.51; %(thermal conductivity for air-dry soil, Eq.(16)) + phis = theta_s0; % (porosity, phis == theta_s = theta_s0) + lambda_d = -0.56 * phis + 0.51; % (thermal conductivity for air-dry soil, Eq.(16)) - QC = 0.20; %(quartz content, ≈fss if no measured data) - lambda_qc = 7.7; %(thermal conductivity of quartz, W/m.K, constant) + QC = 0.20; % (quartz content, ≈fss if no measured data) + lambda_qc = 7.7; % (thermal conductivity of quartz, W/m.K, constant) - lambda_s = (lambda_qc^(QC)) * lambda_d^(1 - QC); %(thermal conductivity of the soil solids, Eq.(18)) - lambda_wtr = 0.57; %(thermal conductivity of water, W/m.K, constant) + lambda_s = (lambda_qc^(QC)) * lambda_d^(1 - QC); % (thermal conductivity of the soil solids, Eq.(18)) + lambda_wtr = 0.57; % (thermal conductivity of water, W/m.K, constant) - lambda_w = (lambda_s^(1 - phis)) * lambda_wtr^(phis); %(thermal conductivity for saturated soil, Eq.(17)) + lambda_w = (lambda_s^(1 - phis)) * lambda_wtr^(phis); % (thermal conductivity for saturated soil, Eq.(17)) - lambdas = ke * (lambda_w - lambda_d) + lambda_d; %Eq.(14) + lambdas = ke * (lambda_w - lambda_d) + lambda_d; % Eq.(14) - Hcs = 2.0 * 10^6; %(heat capacity of solid soil minerals, J/m3.K) - Hcw = 4.2 * 10^6; %(heat capacity of water, J/m3.K) + Hcs = 2.0 * 10^6; % (heat capacity of solid soil minerals, J/m3.K) + Hcw = 4.2 * 10^6; % (heat capacity of water, J/m3.K) - Hc = (Hcw * SMC) + (1 - theta_s) * Hcs; %Eq.(13) + Hc = (Hcw * SMC) + (1 - theta_s) * Hcs; % Eq.(13) - GAM = sqrt(lambdas .* Hc); %Eq.(10) + GAM = sqrt(lambdas .* Hc); % Eq.(10) end From 22a31db9f216a247e5eb65b0bcd97d05d3a3ae79 Mon Sep 17 00:00:00 2001 From: Enting Tang <101427283+EntingTang@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:31:12 +0100 Subject: [PATCH 3/4] Change the comment of Soil_inertial1.m to follow the best practice --- src/+equations/Soil_Inertia1.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/+equations/Soil_Inertia1.m b/src/+equations/Soil_Inertia1.m index 73e43b96..6e882dec 100644 --- a/src/+equations/Soil_Inertia1.m +++ b/src/+equations/Soil_Inertia1.m @@ -12,10 +12,10 @@ ke = exp(gamma_s * (1 - power(Sr, gamma_s - dels))); % (Kersten number, Eq.(15)) - phis = theta_s0; % (porosity, phis == theta_s = theta_s0) + phis = theta_s0; % (porosity, phis=theta_s=theta_s0) lambda_d = -0.56 * phis + 0.51; % (thermal conductivity for air-dry soil, Eq.(16)) - QC = 0.20; % (quartz content, ≈fss if no measured data) + QC = 0.20; % (quartz content, approximate to fss if no measured QC) lambda_qc = 7.7; % (thermal conductivity of quartz, W/m.K, constant) lambda_s = (lambda_qc^(QC)) * lambda_d^(1 - QC); % (thermal conductivity of the soil solids, Eq.(18)) From 2f8237652da01ca20321ee910f7b6a7315935207 Mon Sep 17 00:00:00 2001 From: Enting Tang <101427283+EntingTang@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:35:47 +0100 Subject: [PATCH 4/4] Change the comment style of Soil_Inertia1.m to follow the best practice Delete the trailing whitespace problem at Line 15 --- src/+equations/Soil_Inertia1.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/+equations/Soil_Inertia1.m b/src/+equations/Soil_Inertia1.m index 6e882dec..ab79cba9 100644 --- a/src/+equations/Soil_Inertia1.m +++ b/src/+equations/Soil_Inertia1.m @@ -12,7 +12,7 @@ ke = exp(gamma_s * (1 - power(Sr, gamma_s - dels))); % (Kersten number, Eq.(15)) - phis = theta_s0; % (porosity, phis=theta_s=theta_s0) + phis = theta_s0; % (porosity, phis=theta_s=theta_s0) lambda_d = -0.56 * phis + 0.51; % (thermal conductivity for air-dry soil, Eq.(16)) QC = 0.20; % (quartz content, approximate to fss if no measured QC)