Skip to content

Commit

Permalink
fixed viscos_0 as new datum in solution class.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlparkhurst committed Oct 15, 2024
1 parent bd4e76e commit 89aae60
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 22 deletions.
42 changes: 21 additions & 21 deletions mytest/ex13_impl_101.sel
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@
0.001000156719 0.0000000000
0.001000156719 0.0000000000
0.001000162054 0.0000000000
0.001417432889 0.0000000000
0.001298451747 0.0000000000
0.001183988239 0.0000000000
0.001087195841 0.0000000000
0.001073402530 0.0000000000
0.001059805948 0.0000000000
0.001046369444 0.0000000000
0.001033058137 0.0000000000
0.001019840238 0.0000000000
0.001006695996 0.0000000000
0.001000156719 0.0000000000
0.001000181124 0.0000000000
0.001000189354 0.0000000000
0.001000181279 0.0000000000
0.001000176735 0.0000000000
0.001000172738 0.0000000000
0.001000169192 0.0000000000
0.001000166012 0.0000000000
0.001000163120 0.0000000000
0.001000160448 0.0000000000
0.001000157935 0.0000000000
0.001392195976 0.0000000000
0.001274048320 0.0000000000
0.001160229914 0.0000000000
0.001081559743 0.0000000000
0.001068654959 0.0000000000
0.001055936626 0.0000000000
0.001043369801 0.0000000000
0.001030921415 0.0000000000
0.001018561642 0.0000000000
0.001006271927 0.0000000000
0.001000156719 0.0000000000
0.001000180128 0.0000000000
0.001000186948 0.0000000000
0.001000178797 0.0000000000
0.001000174795 0.0000000000
0.001000171245 0.0000000000
0.001000168071 0.0000000000
0.001000165203 0.0000000000
0.001000162579 0.0000000000
0.001000160141 0.0000000000
0.001000157837 0.0000000000
16 changes: 15 additions & 1 deletion src/Solution.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ cxxSolution::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) con
// new identifier
s_oss << indent1;
s_oss << "-viscosity " << this->viscosity << "\n";
s_oss << indent1;
s_oss << "-viscos_0 " << this->viscos_0 << "\n";

// soln_total conc structures
s_oss << indent1;
Expand Down Expand Up @@ -1088,6 +1090,16 @@ cxxSolution::read_raw(CParser & parser, bool check)
}
opt_save = CParser::OPT_DEFAULT;
break;
case 29: // viscos_0
if (!(parser.get_iss() >> this->viscos_0))
{
this->viscos_0 = 1.0;
parser.incr_input_error();
parser.error_msg("Expected numeric value for viscos_0.",
PHRQ_io::OT_CONTINUE);
}
opt_save = CParser::OPT_DEFAULT;
break;
}
if (opt == CParser::OPT_EOF || opt == CParser::OPT_KEYWORD)
break;
Expand Down Expand Up @@ -1417,6 +1429,7 @@ cxxSolution::add(const cxxSolution & addee, LDBLE extensive)
this->cb += addee.cb * extensive;
this->density = f1 * this->density + f2 * addee.density;
this->viscosity = f1 * this->viscosity + f2 * addee.viscosity;
this->viscos_0 = f1 * this->viscos_0 + f2 * addee.viscos_0;
this->patm = f1 * this->patm + f2 * addee.patm;
// this->potV = f1 * this->potV + f2 * addee.potV; // appt
this->mass_water += addee.mass_water * extensive;
Expand Down Expand Up @@ -1775,6 +1788,7 @@ const std::vector< std::string >::value_type temp_vopts[] = {
std::vector< std::string >::value_type("log_gamma_map"), // 25
std::vector< std::string >::value_type("potential"), // 26
std::vector< std::string >::value_type("log_molalities_map"), // 27
std::vector< std::string >::value_type("viscosity") // 28
std::vector< std::string >::value_type("viscosity"), // 28
std::vector< std::string >::value_type("viscos_0") // 29
};
const std::vector< std::string > cxxSolution::vopts(temp_vopts, temp_vopts + sizeof temp_vopts / sizeof temp_vopts[0]);
2 changes: 2 additions & 0 deletions src/step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ xsolution_zero(void)
mu_x = 0.0;
ah2o_x = 0.0;
viscos = 0.0;
viscos_0 = 0.0;
density_x = 0.0;
total_h_x = 0.0;
total_o_x = 0.0;
Expand Down Expand Up @@ -381,6 +382,7 @@ add_solution(cxxSolution *solution_ptr, LDBLE extensive, LDBLE intensive)
mu_x += solution_ptr->Get_mu() * intensive;
ah2o_x += solution_ptr->Get_ah2o() * intensive;
viscos += solution_ptr->Get_viscosity() * intensive;
viscos_0 += solution_ptr->Get_viscos_0() * intensive;
density_x += solution_ptr->Get_density() * intensive;

total_h_x += solution_ptr->Get_total_h() * extensive;
Expand Down

0 comments on commit 89aae60

Please # to comment.