Commit f53803f5 authored by Jacob Kegerreis 's avatar Jacob Kegerreis
Browse files

Add Tillotson basalt eos

parent b525c566
......@@ -80,6 +80,10 @@ enum eos_planetary_material_id {
/*! Tillotson water */
eos_planetary_id_Til_water =
eos_planetary_type_Til * eos_planetary_type_factor + 2,
/*! Tillotson basalt */
eos_planetary_id_Til_basalt =
eos_planetary_type_Til * eos_planetary_type_factor + 3,
/* Hubbard & MacFarlane (1980) Uranus/Neptune */
......@@ -123,7 +127,7 @@ enum eos_planetary_material_id {
* @brief The parameters of the equation of state.
*/
struct eos_parameters {
struct Til_params Til_iron, Til_granite, Til_water;
struct Til_params Til_iron, Til_granite, Til_water, Til_basalt;
struct HM80_params HM80_HHe, HM80_ice, HM80_rock;
struct SESAME_params SESAME_iron, SESAME_basalt, SESAME_water, SS08_water;
};
......@@ -164,6 +168,11 @@ gas_internal_energy_from_entropy(float density, float entropy,
&eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_internal_energy_from_entropy(density, entropy,
&eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -265,6 +274,10 @@ __attribute__((always_inline)) INLINE static float gas_pressure_from_entropy(
return Til_pressure_from_entropy(density, entropy, &eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_pressure_from_entropy(density, entropy, &eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -364,6 +377,10 @@ __attribute__((always_inline)) INLINE static float gas_entropy_from_pressure(
return Til_entropy_from_pressure(density, P, &eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_entropy_from_pressure(density, P, &eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -459,6 +476,10 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_entropy(
return Til_soundspeed_from_entropy(density, entropy, &eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_soundspeed_from_entropy(density, entropy, &eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -557,6 +578,10 @@ gas_entropy_from_internal_energy(float density, float u,
return Til_entropy_from_internal_energy(density, u, &eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_entropy_from_internal_energy(density, u, &eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -657,6 +682,10 @@ gas_pressure_from_internal_energy(float density, float u,
return Til_pressure_from_internal_energy(density, u, &eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_pressure_from_internal_energy(density, u, &eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -760,6 +789,10 @@ gas_internal_energy_from_pressure(float density, float P,
return Til_internal_energy_from_pressure(density, P, &eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_internal_energy_from_pressure(density, P, &eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -861,6 +894,11 @@ gas_soundspeed_from_internal_energy(float density, float u,
&eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_soundspeed_from_internal_energy(density, u,
&eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -962,6 +1000,10 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_pressure(
return Til_soundspeed_from_pressure(density, P, &eos.Til_water);
break;
case eos_planetary_id_Til_basalt:
return Til_soundspeed_from_pressure(density, P, &eos.Til_basalt);
break;
default:
error("Unknown material ID! mat_id = %d", mat_id);
return 0.f;
......@@ -1051,10 +1093,12 @@ __attribute__((always_inline)) INLINE static void eos_init(
set_Til_iron(&e->Til_iron, eos_planetary_id_Til_iron);
set_Til_granite(&e->Til_granite, eos_planetary_id_Til_granite);
set_Til_water(&e->Til_water, eos_planetary_id_Til_water);
set_Til_basalt(&e->Til_basalt, eos_planetary_id_Til_basalt);
convert_units_Til(&e->Til_iron, us);
convert_units_Til(&e->Til_granite, us);
convert_units_Til(&e->Til_water, us);
convert_units_Til(&e->Til_basalt, us);
}
// Hubbard & MacFarlane (1980)
......
......@@ -81,6 +81,23 @@ INLINE static void set_Til_granite(struct Til_params *mat,
mat->eta_zero = 0.0f;
mat->P_min = 0.0f;
}
INLINE static void set_Til_basalt(struct Til_params *mat,
enum eos_planetary_material_id mat_id) {
mat->mat_id = mat_id;
mat->rho_0 = 2700.0f;
mat->a = 0.5f;
mat->b = 1.5f;
mat->A = 2.67e10f;
mat->B = 2.67e10f;
mat->u_0 = 4.87e8f;
mat->u_iv = 4.72e6f;
mat->u_cv = 1.82e7f;
mat->alpha = 5.0f;
mat->beta = 5.0f;
mat->eta_min = 0.0f;
mat->eta_zero = 0.0f;
mat->P_min = 0.0f;
}
INLINE static void set_Til_water(struct Til_params *mat,
enum eos_planetary_material_id mat_id) {
mat->mat_id = mat_id;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment