Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set ch2o to 0 for premelt reference visc calculation #97

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/_pages/vbrmethods/visc/xfit_premelt.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ Output is stored in `VBR.out.viscous.xfit_premelt`. Unlike the other viscous met
[2,1] = eta_meltfree
}
```

Note that `eta_meltfree` is both the melt-free **and** volatile-free viscosity: the pre-melting method
incorprates weakening from volatiles in the solidus depression. To incorporate effects of volatiles,
should calculate a volatile-dependent solidus.
73 changes: 73 additions & 0 deletions vbr/testing/test_vbrcore_010_premelt_volatiles.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
function TestResult = test_vbrcore_010_premelt_volatiles()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TestResult = test_vbrcore_010_premelt_volatiles()
%
% test for volatile behavior
%
% Parameters
% ----------
% none
%
% Output
% ------
% TestResult struct with fields:
% .passed True if passed, False otherwise.
% .fail_message Message to display if false
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

TestResult.passed=true;
TestResult.fail_message = '';

% the melt-free viscosity should match between the two cases (one with water,
% one without) because the solidus is not being changed between them. This is
% a math check more than a physical check.
VBR = get_VBR(0.0);
[VBR] = VBR_spine(VBR);
VBR_1 = get_VBR(1.0);
[VBR_1] = VBR_spine(VBR_1);

eta = VBR.out.viscous.xfit_premelt.diff.eta_meltfree;
eta_1 = VBR_1.out.viscous.xfit_premelt.diff.eta_meltfree;

if sum(abs(eta -eta_1)) > 0
TestResult.passed=false;
TestResult.fail_message = 'the viscosity values do not match!';
end

Q = VBR.out.anelastic.xfit_premelt.Q;
Q_1 = VBR_1.out.anelastic.xfit_premelt.Q;
if sum(abs(Q - Q_1)) > 0
TestResult.passed=false;
TestResult.fail_message = 'the Q values do not match!';
end

etaHK = VBR.out.viscous.HK2003.diff.eta;
etaHK_1 = VBR_1.out.viscous.HK2003.diff.eta;
if sum(etaHK > etaHK_1) > 0
% note: etaHK_1 (the case with water) should be < etaHK in all cases
TestResult.passed=false;
TestResult.fail_message = 'HK2003 eta with water should be weaker.';
end
end

function VBR = get_VBR(water_val)

VBR = struct();
VBR.in.elastic.methods_list={'anharmonic'};
VBR.in.viscous.methods_list={'xfit_premelt'; 'HK2003'};
VBR.in.anelastic.methods_list={'xfit_premelt'};

VBR.in.viscous.xfit_premelt = Params_Viscous('xfit_premelt');
VBR.in.viscous.xfit_premelt.eta_melt_free_method = 'HK2003';

sz = [5, 1];
VBR.in.SV.phi = full_nd(0.01, sz);
VBR.in.SV.Ch2o = full_nd(water_val, sz);
VBR.in.SV.T_K = full_nd(1350+273, sz);
VBR.in.SV.Tsolidus_K = full_nd(1300+273., sz);
VBR.in.SV.P_GPa = full_nd(2.5, sz); % pressure [GPa]
VBR.in.SV.dg_um=full_nd(0.01 * 1e6, sz); % grain size [um]
VBR.in.SV.rho = full_nd(3300, sz); % density [kg m^-3]
VBR.in.SV.sig_MPa = full_nd(.1, sz); % differential stress [MPa]
VBR.in.SV.f = 10.; % 1 Hz
end
4 changes: 4 additions & 0 deletions vbr/vbrCore/functions/visc_calc_xfit_premelt.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
VBRtemp=VBR;
VBRtemp.in.viscous.methods_list={visc_method}; % only use one method
VBRtemp.in.SV.phi=0; % need melt-free viscosity
% additionally, water effects are accounted for by the homologous temperature
% scaling in the A_n factor, so **also** need to set the water content to 0
% for getting the reference viscosity. see https://github.com/vbr-calc/vbr/issues/96
VBRtemp.in.SV.Ch2o=0;
VBRtemp=spineGeneralized(VBRtemp,'viscous');
eta_meltfree = VBRtemp.out.viscous.(visc_method).diff.eta ;
end
Expand Down
Loading