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

Allow different ANEOS EoS #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion src/EoS.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,14 @@ namespace EoS{
};
}

// These are hard-coded equations of state of certain materials. They
// are useful for benchmarking purposes, or if you need exactly these EoS.
static const EoS::IdealGas<PS::F64> Monoatomic(5./3.);
static const EoS::IdealGas<PS::F64> Diatomic (1.4);
static const EoS::Tillotson<PS::F64> Granite (2680.0, 16.0e+6, 3.5e+6, 18.00e+6, 18.0e+9, 18.0e+9, 0.5, 1.3, 5.0, 5.0);
static const EoS::Tillotson<PS::F64> Iron (7800.0, 9.5e+6, 2.4e+6 , 8.67e+6, 128.0e+9, 105.0e+9, 0.5, 1.5, 5.0, 5.0);
static const EoS::ANEOS<PS::F64> AGranite ("eos/granite.rho_u.txt");

// This vector can hold any number of ANEOS equations of state.
// The actual equations of state are later read from files by the specific problem setup.
static std::vector<EoS::ANEOS<PS::F64>> ANEOS_EoS;

8 changes: 5 additions & 3 deletions src/GI.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ template <class Ptcl> class GI : public Problem<Ptcl>{
end_time = parameter_file.getValueOf("end_time",1.0e+4);
damping = parameter_file.getValueOf("damping",1.);

ANEOS_EoS.push_back(EoS::ANEOS<PS::F64>("eos/granite.rho_u.txt"));

const PS::F64 Expand = 1.1;
const PS::F64 tarMass = UnitMass;
const PS::F64 tarRadi = UnitRadi;
Expand Down Expand Up @@ -190,7 +192,7 @@ template <class Ptcl> class GI : public Problem<Ptcl>{
ith.eng = 0.1 * Grav * tarMass / tarRadi;
ith.id = id++;
// TODO: Modify this line for all particles that need new EoS
ith.setPressure(&AGranite);
ith.setPressure(&ANEOS_EoS[0]);
ith.tag = 0;
if(ith.id / NptclIn1Node == PS::Comm::getRank()) tar.push_back(ith);
}
Expand Down Expand Up @@ -240,7 +242,7 @@ template <class Ptcl> class GI : public Problem<Ptcl>{
ith.eng = 0.1 * Grav * tarMass / tarRadi;
ith.id = id++;
// TODO: Modify this line for all particles that need new EoS
ith.setPressure(&AGranite);
ith.setPressure(&ANEOS_EoS[0]);
ith.tag = 2;
if(ith.id / NptclIn1Node == PS::Comm::getRank()) imp.push_back(ith);
}
Expand Down Expand Up @@ -289,7 +291,7 @@ template <class Ptcl> class GI : public Problem<Ptcl>{
for(PS::U64 i = 0 ; i < sph_system.getNumberOfParticleLocal() ; ++ i){
// TODO: Modify the lines below for all particles that need new EoS
if(sph_system[i].tag % 2 == 0){
sph_system[i].setPressure(&AGranite);
sph_system[i].setPressure(&ANEOS_EoS[0]);
}else{
sph_system[i].setPressure(&Iron);
}
Expand Down