Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed Aug 11, 2024
1 parent 066becb commit ada9989
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 85 deletions.
6 changes: 3 additions & 3 deletions tests/composite_viscous_outputs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
strain_rate[2][1] = 0.;
strain_rate[2][2] = 0.;

std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl;
std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, kel, max)" << std::endl;

// Loop through strain rates, tracking whether there is a discrepancy in
// the decomposed strain rates.
Expand All @@ -120,7 +120,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
double disl_stress;
double prls_stress;
double drpr_stress;
std::vector<double> partial_strain_rates(5, 0.);
std::vector<double> partial_strain_rates(6, 0.);

for (unsigned int i=0; i <= 10; i++)
{
Expand All @@ -134,7 +134,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
// of the max viscosity dashpot from the total strain rate
// The creep stress is then calculated by subtracting the stress running
// through the strain rate limiter from the total stress
creep_strain_rate = total_strain_rate - partial_strain_rates[4];
creep_strain_rate = total_strain_rate - partial_strain_rates[4] - partial_strain_rates[5];
creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate);

// Print the output
Expand Down
24 changes: 12 additions & 12 deletions tests/composite_viscous_outputs/screen-output
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
Loading shared library <./libcomposite_viscous_outputs.debug.so>

* Connecting signals
temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)
1000 3.45602e+19 6.89205e+08 1e-11 1.29846e-06 0.00363514 0.0654305 0.930933 3.45602e-09
1100 2.98863e+19 5.95725e+08 1e-11 7.23285e-05 0.835897 0.163395 0.0006365 2.98863e-09
1200 7.70568e+18 1.52114e+08 1e-11 0.000594407 0.999399 6.44893e-06 1.44515e-33 7.70568e-10
1300 2.39282e+18 4.58564e+07 1e-11 0.00338081 0.996619 3.19443e-09 1.32277e-59 2.39282e-10
1400 9.18168e+17 1.63634e+07 1e-11 0.0149609 0.985039 1.26589e-11 5.56077e-82 9.18169e-11
1500 4.32083e+17 6.64167e+06 1e-11 0.0538305 0.94617 2.09885e-13 1.4634e-101 4.32084e-11
1600 2.47246e+17 2.94493e+06 1e-11 0.161077 0.838923 8.74429e-15 3.2006e-119 2.47246e-11
1700 1.67379e+17 1.34758e+06 1e-11 0.397345 0.602655 5.42942e-16 3.38184e-136 1.67378e-11
1800 1.28447e+17 568948 1e-11 0.749975 0.250025 2.2682e-17 6.38432e-155 1.28447e-11
1900 1.09563e+17 191256 1e-11 0.962698 0.0373021 2.59166e-19 1.35594e-178 1.09563e-11
2000 1.02964e+17 59280.1 1e-11 0.99654 0.00345962 2.26225e-21 4.97674e-204 1.02965e-11
temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, kel, max)
1000 3.45602e+19 6.89205e+08 1e-11 1.29846e-06 0.00363514 0.0654305 0.930933 0 3.45602e-09
1100 2.98863e+19 5.95725e+08 1e-11 7.23285e-05 0.835897 0.163395 0.0006365 0 2.98863e-09
1200 7.70568e+18 1.52114e+08 1e-11 0.000594407 0.999399 6.44893e-06 1.44515e-33 0 7.70568e-10
1300 2.39282e+18 4.58564e+07 1e-11 0.00338081 0.996619 3.19443e-09 1.32277e-59 0 2.39282e-10
1400 9.18168e+17 1.63634e+07 1e-11 0.0149609 0.985039 1.26589e-11 5.56077e-82 0 9.18169e-11
1500 4.32083e+17 6.64167e+06 1e-11 0.0538305 0.94617 2.09885e-13 1.4634e-101 0 4.32084e-11
1600 2.47246e+17 2.94493e+06 1e-11 0.161077 0.838923 8.74429e-15 3.2006e-119 0 2.47246e-11
1700 1.67379e+17 1.34758e+06 1e-11 0.397345 0.602655 5.42942e-16 3.38184e-136 0 1.67378e-11
1800 1.28447e+17 568948 1e-11 0.749975 0.250025 2.2682e-17 6.38432e-155 0 1.28447e-11
1900 1.09563e+17 191256 1e-11 0.962698 0.0373021 2.59166e-19 1.35594e-178 0 1.09563e-11
2000 1.02964e+17 59280.1 1e-11 0.99654 0.00345962 2.26225e-21 4.97674e-204 0 1.02965e-11
OK
Number of active cells: 100 (on 1 levels)
Number of degrees of freedom: 5,534 (3,969+242+1,323)
Expand Down
2 changes: 1 addition & 1 deletion tests/composite_viscous_outputs_isostress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
// of the max viscosity dashpot from the total strain rate
// The creep stress is then calculated by subtracting the stress running
// through the strain rate limiter from the total stress
creep_strain_rate = total_strain_rate - partial_strain_rates[5];
creep_strain_rate = total_strain_rate - partial_strain_rates[4] - partial_strain_rates[5];
creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate);

// Print the output
Expand Down
9 changes: 5 additions & 4 deletions tests/composite_viscous_outputs_limited.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
double temperature;
const double pressure = 1.e9;
const double grain_size = 1.e-3;
const double inverse_kelvin_viscosity = 0.;
SymmetricTensor<2,dim> strain_rate;
strain_rate[0][0] = -1e-11;
strain_rate[0][1] = 0.;
Expand All @@ -117,7 +118,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
strain_rate[2][1] = 0.;
strain_rate[2][2] = 0.;

std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl;
std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, kel, max)" << std::endl;

// Loop through strain rates, tracking whether there is a discrepancy in
// the decomposed strain rates.
Expand All @@ -130,21 +131,21 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
double disl_stress;
double prls_stress;
double drpr_stress;
std::vector<double> partial_strain_rates(5, 0.);
std::vector<double> partial_strain_rates(6, 0.);

for (unsigned int i=0; i <= 10; i++)
{
temperature = 1000. + i*100.;

// Compute the viscosity
viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates);
viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, inverse_kelvin_viscosity, partial_strain_rates);
total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.);

// The creep strain rate is calculated by subtracting the strain rate
// of the max viscosity dashpot from the total strain rate
// The creep stress is then calculated by subtracting the stress running
// through the strain rate limiter from the total stress
creep_strain_rate = total_strain_rate - partial_strain_rates[4];
creep_strain_rate = total_strain_rate - partial_strain_rates[4] - partial_strain_rates[5];
creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate);

// Print the output
Expand Down
24 changes: 12 additions & 12 deletions tests/composite_viscous_outputs_limited/screen-output
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
Loading shared library <./libcomposite_viscous_outputs_limited.debug.so>

* Connecting signals
temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)
1000 3.99999e+18 7.99998e+07 1e-11 1.5072e-07 1.93692e-06 1.58471e-11 1.60671e-47 0.999998
1100 3.997e+18 7.99201e+07 1e-11 9.7033e-06 0.000739244 7.95399e-10 1.52864e-47 0.999251
1200 3.70523e+18 7.21395e+07 1e-11 0.000281896 0.0734102 8.42438e-09 9.12346e-50 0.926308
1300 2.33707e+18 3.56552e+07 1e-11 0.00262872 0.413104 3.88781e-10 4.546e-65 0.584267
1400 1.5335e+18 1.42267e+07 1e-11 0.0130073 0.603618 4.18203e-12 5.08959e-85 0.383375
1500 1.22332e+18 5.95532e+06 1e-11 0.0482676 0.645901 9.24051e-14 6.26253e-104 0.305831
1600 1.09939e+18 2.65043e+06 1e-11 0.144969 0.580183 4.10546e-15 1.64922e-121 0.274848
1700 1.04457e+18 1.1886e+06 1e-11 0.350471 0.388386 2.29166e-16 6.35863e-139 0.261143
1800 1.01759e+18 469097 1e-11 0.618354 0.127248 6.34559e-18 4.11763e-159 0.254398
1900 1.00547e+18 145858 1e-11 0.734184 0.0144489 4.62654e-20 1.77001e-184 0.251367
2000 1.00167e+18 44514.1 1e-11 0.748313 0.00126937 3.89551e-22 2.99484e-210 0.250417
temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, kel, max)
1000 3.99999e+18 7.99998e+07 1e-11 1.5072e-07 1.93692e-06 1.58471e-11 1.60671e-47 0 0.999998
1100 3.997e+18 7.99201e+07 1e-11 9.7033e-06 0.000739244 7.95399e-10 1.52864e-47 0 0.999251
1200 3.70523e+18 7.21395e+07 1e-11 0.000281896 0.0734102 8.42438e-09 9.12346e-50 0 0.926308
1300 2.33707e+18 3.56552e+07 1e-11 0.00262872 0.413104 3.88781e-10 4.546e-65 0 0.584267
1400 1.5335e+18 1.42267e+07 1e-11 0.0130073 0.603618 4.18203e-12 5.08959e-85 0 0.383375
1500 1.22332e+18 5.95532e+06 1e-11 0.0482676 0.645901 9.24051e-14 6.26253e-104 0 0.305831
1600 1.09939e+18 2.65043e+06 1e-11 0.144969 0.580183 4.10546e-15 1.64922e-121 0 0.274848
1700 1.04457e+18 1.1886e+06 1e-11 0.350471 0.388386 2.29166e-16 6.35863e-139 0 0.261143
1800 1.01759e+18 469097 1e-11 0.618354 0.127248 6.34559e-18 4.11763e-159 0 0.254398
1900 1.00547e+18 145858 1e-11 0.734184 0.0144489 4.62654e-20 1.77001e-184 0 0.251367
2000 1.00167e+18 44514.1 1e-11 0.748313 0.00126937 3.89551e-22 2.99484e-210 0 0.250417
OK
Number of active cells: 100 (on 1 levels)
Number of degrees of freedom: 5,534 (3,969+242+1,323)
Expand Down
6 changes: 3 additions & 3 deletions tests/composite_viscous_outputs_no_peierls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
strain_rate[2][1] = 0.;
strain_rate[2][2] = 0.;

std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl;
std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, kel, max)" << std::endl;

// Loop through strain rates, tracking whether there is a discrepancy in
// the decomposed strain rates.
Expand All @@ -113,7 +113,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
double diff_stress;
double disl_stress;
double drpr_stress;
std::vector<double> partial_strain_rates(5, 0.);
std::vector<double> partial_strain_rates(6, 0.);

for (unsigned int i=0; i <= 10; i++)
{
Expand All @@ -127,7 +127,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
// of the max viscosity dashpot from the total strain rate
// The creep stress is then calculated by subtracting the stress running
// through the strain rate limiter from the total stress
creep_strain_rate = total_strain_rate - partial_strain_rates[4];
creep_strain_rate = total_strain_rate - partial_strain_rates[4] - partial_strain_rates[5];
creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate);

// Print the output
Expand Down
24 changes: 12 additions & 12 deletions tests/composite_viscous_outputs_no_peierls/screen-output
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
Loading shared library <./libcomposite_viscous_outputs_no_peierls.debug.so>

* Connecting signals
temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)
1000 3.46071e+19 6.90142e+08 1e-11 1.30023e-06 0.00365246 0 0.996346 3.46071e-09
1100 3.13843e+19 6.25686e+08 1e-11 7.59662e-05 0.992522 0 0.00740179 3.13843e-09
1200 7.7057e+18 1.52114e+08 1e-11 0.000594408 0.999406 0 1.44528e-33 7.7057e-10
1300 2.39282e+18 4.58564e+07 1e-11 0.00338081 0.996619 0 1.32277e-59 2.39282e-10
1400 9.18168e+17 1.63634e+07 1e-11 0.0149609 0.985039 0 5.56077e-82 9.18169e-11
1500 4.32083e+17 6.64167e+06 1e-11 0.0538305 0.94617 0 1.4634e-101 4.32084e-11
1600 2.47246e+17 2.94493e+06 1e-11 0.161077 0.838923 0 3.2006e-119 2.47246e-11
1700 1.67379e+17 1.34758e+06 1e-11 0.397345 0.602655 0 3.38184e-136 1.67378e-11
1800 1.28447e+17 568948 1e-11 0.749975 0.250025 0 6.38432e-155 1.28447e-11
1900 1.09563e+17 191256 1e-11 0.962698 0.0373021 0 1.35594e-178 1.09563e-11
2000 1.02964e+17 59280.1 1e-11 0.99654 0.00345962 0 4.97674e-204 1.02965e-11
temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, kel, max)
1000 3.46071e+19 6.90142e+08 1e-11 1.30023e-06 0.00365246 0 0.996346 0 3.46071e-09
1100 3.13843e+19 6.25686e+08 1e-11 7.59662e-05 0.992522 0 0.00740179 0 3.13843e-09
1200 7.7057e+18 1.52114e+08 1e-11 0.000594408 0.999406 0 1.44528e-33 0 7.7057e-10
1300 2.39282e+18 4.58564e+07 1e-11 0.00338081 0.996619 0 1.32277e-59 0 2.39282e-10
1400 9.18168e+17 1.63634e+07 1e-11 0.0149609 0.985039 0 5.56077e-82 0 9.18169e-11
1500 4.32083e+17 6.64167e+06 1e-11 0.0538305 0.94617 0 1.4634e-101 0 4.32084e-11
1600 2.47246e+17 2.94493e+06 1e-11 0.161077 0.838923 0 3.2006e-119 0 2.47246e-11
1700 1.67379e+17 1.34758e+06 1e-11 0.397345 0.602655 0 3.38184e-136 0 1.67378e-11
1800 1.28447e+17 568948 1e-11 0.749975 0.250025 0 6.38432e-155 0 1.28447e-11
1900 1.09563e+17 191256 1e-11 0.962698 0.0373021 0 1.35594e-178 0 1.09563e-11
2000 1.02964e+17 59280.1 1e-11 0.99654 0.00345962 0 4.97674e-204 0 1.02965e-11
OK
Number of active cells: 100 (on 1 levels)
Number of degrees of freedom: 5,534 (3,969+242+1,323)
Expand Down
9 changes: 5 additions & 4 deletions tests/composite_viscous_outputs_phases.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
double temperature;
double pressure;
const double grain_size = 1.e-3;
const double inverse_kelvin_viscosity = 0.;
SymmetricTensor<2,dim> strain_rate;
strain_rate[0][0] = -1e-11;
strain_rate[0][1] = 0.;
Expand All @@ -133,7 +134,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
strain_rate[2][1] = 0.;
strain_rate[2][2] = 0.;

std::cout << "temperature (K) phase transition progress eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl;
std::cout << "temperature (K) phase transition progress eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, kel, max)" << std::endl;

// Loop through strain rates, tracking whether there is a discrepancy in
// the decomposed strain rates.
Expand All @@ -146,7 +147,7 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
double disl_stress;
double prls_stress;
double drpr_stress;
std::vector<double> partial_strain_rates(5, 0.);
std::vector<double> partial_strain_rates(6, 0.);

for (unsigned int i=0; i <= 2; i++)
{
Expand Down Expand Up @@ -176,14 +177,14 @@ void f(const aspect::SimulatorAccess<dim> &simulator_access,
Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition);

// Compute the viscosity
viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates, phase_function_values, n_phase_transitions_per_composition);
viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, inverse_kelvin_viscosity, partial_strain_rates, phase_function_values, n_phase_transitions_per_composition);
total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.);

// The creep strain rate is calculated by subtracting the strain rate
// of the max viscosity dashpot from the total strain rate
// The creep stress is then calculated by subtracting the stress running
// through the strain rate limiter from the total stress
creep_strain_rate = total_strain_rate - partial_strain_rates[4];
creep_strain_rate = total_strain_rate - partial_strain_rates[4] - partial_strain_rates[5];
creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate);

// Print the output
Expand Down
Loading

0 comments on commit ada9989

Please sign in to comment.