Skip to content

Commit

Permalink
Fix 2CLJ virials and test
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhbell committed Jul 21, 2024
1 parent 091884c commit f32b669
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/teqp/models/model_potentials/2center_ljf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ namespace teqp {
auto alphar(const TauType& tau, const DeltaType& delta, const double& alpha) const {

auto eta = forceeval((delta / (a + (1.0 - a) * pow(tau, g))));
auto r = (pow(alpha, 2) - 1.0) * log(1.0 - eta) + ((pow(alpha, 2) + 3 * alpha) * eta - 3 * alpha * pow(eta, 2)) / (pow(1.0 - eta, 2));
auto r = (pow(alpha, 2) - 1.0) * log(1.0 - eta) + ((pow(alpha, 2) + 3 * alpha) * eta - 3 * alpha * powi(eta, 2)) / (pow(1.0 - eta, 2));
return forceeval(r);
}
};
Expand Down Expand Up @@ -337,7 +337,7 @@ namespace teqp {
auto delta_eta = forceeval(rho_dimer_star * eta_red);
auto alphar_1 = Hard.alphar(tau, delta_eta, alpha);
auto alphar_2 = Attr.alphar(tau, delta, alpha);
auto val = alphar_1 + alphar_2;
auto val = forceeval(alphar_1 + alphar_2);
if (mu_sq != 0.0){
val += Pole.alphar(tau, delta, mu_sq);
}
Expand Down Expand Up @@ -406,7 +406,7 @@ namespace teqp {
return eos;
}

// build the 2-center Lennard-Jones model with dipole
// build the 2-center Lennard-Jones model without dipole
inline auto build_two_center_model(const std::string& model_version, const double& L = 0.0) {

// Get reducing for temperature and density
Expand Down
10 changes: 10 additions & 0 deletions src/tests/catch_test_modelset.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ auto LKPmethane = [](){
};
return spec;
};
auto TwoLJF = [](){
return R"({
"kind": "2CLJF",
"model": {
"author": "2CLJF_Mecke",
"L^*": 0.5
}
})"_json;
};
auto TwoLJFDip = [](){
return R"({
"kind": "2CLJF-Dipole",
Expand Down Expand Up @@ -106,6 +115,7 @@ std::map<std::string, std::pair<nlohmann::json, std::vector<evalpoint>>> PureFlu
{"SW_EspindolaHeredia2009",{ { {"kind", "SW_EspindolaHeredia2009"}, {"model", {{"lambda", 1.3}}} }, {VirialReference{1.3, 1e-10} } }},
{"EXP6_Kataoka1992",{ { {"kind", "EXP6_Kataoka1992"}, {"model", {{"alpha", 12}}} }, {VirialReference{1.3, 1e-10} } }},

{"2CLJF",{ TwoLJF(), {VirialReference{1.3, 1e-10}} }},
{"2CLJF_Dipole",{ TwoLJFDip(), {} }}, // Virials are not valid because non-integer density exponents
{"2CLJF_Quad",{ TwoLJFQuad(), {} }}, // Virials are not valid because non-integer density exponents

Expand Down

0 comments on commit f32b669

Please sign in to comment.