Skip to content

Commit

Permalink
Add 2CLJF model (no polar term)
Browse files Browse the repository at this point in the history
See #120
  • Loading branch information
ianhbell committed Jul 21, 2024
1 parent b045154 commit 69a4c63
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
25 changes: 23 additions & 2 deletions include/teqp/models/model_potentials/2center_ljf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,10 @@ 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 alphar_3 = Pole.alphar(tau, delta, mu_sq);
auto val = alphar_1 + alphar_2 + alphar_3;
auto val = alphar_1 + alphar_2;
if (mu_sq != 0.0){
val += Pole.alphar(tau, delta, mu_sq);
}
return forceeval(val);
}

Expand Down Expand Up @@ -404,6 +406,25 @@ namespace teqp {
return eos;
}

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

// Get reducing for temperature and density
auto DC_funcs = get_density_reducing(model_version);
auto TC_func = get_temperature_reducing(model_version);

//// Get contributions to EOS ( Attractive and regular part)
auto EOS_hard = get_HardSphere_contribution();
auto EOS_att = get_Attractive_contribution(model_version);
auto EOS_dipolar = get_Dipolar_contribution(model_version);
double mu_sq = 0.0;

// Build the 2-center Lennard-Jones model
auto model = Twocenterljf(std::move(DC_funcs), std::move(TC_func), std::move(EOS_hard), std::move(EOS_att), std::move(EOS_dipolar), L, mu_sq);

return model;
}

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

Expand Down
3 changes: 3 additions & 0 deletions interface/CPP/model_factory_model_potentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace teqp{
std::unique_ptr<teqp::cppinterface::AbstractModel> make_Mie_Chaparro2023(const nlohmann::json &spec){
return make_owned(FEANN::ChaparroJCP2023(spec.at("lambda_r"), spec.at("lambda_a")));
}
std::unique_ptr<teqp::cppinterface::AbstractModel> make_2CLJF(const nlohmann::json &spec){
return make_owned(twocenterljf::build_two_center_model(spec.at("author"), spec.at("L^*")));
}
std::unique_ptr<teqp::cppinterface::AbstractModel> make_2CLJF_Dipole(const nlohmann::json &spec){
return make_owned(twocenterljf::build_two_center_model_dipole(spec.at("author"), spec.at("L^*"), spec.at("(mu^*)^2")));
}
Expand Down
2 changes: 2 additions & 0 deletions interface/CPP/teqp_impl_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace teqp {
std::unique_ptr<teqp::cppinterface::AbstractModel> make_EXP6_Kataoka1992(const nlohmann::json &);
std::unique_ptr<teqp::cppinterface::AbstractModel> make_Mie_Pohl2023(const nlohmann::json &);
std::unique_ptr<teqp::cppinterface::AbstractModel> make_Mie_Chaparro2023(const nlohmann::json &);
std::unique_ptr<teqp::cppinterface::AbstractModel> make_2CLJF(const nlohmann::json &);
std::unique_ptr<teqp::cppinterface::AbstractModel> make_2CLJF_Dipole(const nlohmann::json &);
std::unique_ptr<teqp::cppinterface::AbstractModel> make_2CLJF_Quadrupole(const nlohmann::json &);

Expand Down Expand Up @@ -84,6 +85,7 @@ namespace teqp {
{"EXP6_Kataoka1992", [](const nlohmann::json& spec){ return make_EXP6_Kataoka1992(spec); }},
{"Mie_Pohl2023", [](const nlohmann::json& spec){ return make_Mie_Pohl2023(spec); }},
{"Mie_Chaparro2023", [](const nlohmann::json& spec){ return make_Mie_Chaparro2023(spec); }},
{"2CLJF", [](const nlohmann::json& spec){ return make_2CLJF(spec); }},
{"2CLJF-Dipole", [](const nlohmann::json& spec){ return make_2CLJF_Dipole(spec); }},
{"2CLJF-Quadrupole", [](const nlohmann::json& spec){ return make_2CLJF_Quadrupole(spec); }},

Expand Down

0 comments on commit 69a4c63

Please sign in to comment.