Skip to content

Commit

Permalink
store Tdust as an aux variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyush Sharda authored and Piyush Sharda committed Aug 23, 2024
1 parent b7875cd commit 1f09cb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions networks/metal_chem/pynucastro.net
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ co CO 4.0 2.0
o2p O2p 4.0 2.0
o2 O2 4.0 2.0
co2 CO2 4.0 2.0
__aux_Tdust
9 changes: 8 additions & 1 deletion unit_test/burn_cell_metal_chem/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ auto burn_cell_c() -> int {
}

state.T = temperature;
// set initial Tdust to CMB
state.aux[0] = 2.73*(1.0 + network_rp::redshift);

// find the density in g/cm^3
amrex::Real rhotot = 0.0_rt;
Expand Down Expand Up @@ -193,7 +195,8 @@ auto burn_cell_c() -> int {
state_over_time << std::setw(10) << "# Time";
state_over_time << std::setw(15) << "NumberDensity";
state_over_time << std::setw(15) << "Density";
state_over_time << std::setw(15) << "Temperature";
state_over_time << std::setw(15) << "Tgas";
state_over_time << std::setw(15) << "Tdust";
for (x = 0; x < NumSpec; ++x) {
const std::string &element = short_spec_names_cxx[x];
state_over_time << std::setw(15) << element;
Expand All @@ -206,6 +209,7 @@ auto burn_cell_c() -> int {
state_over_time << std::setw(15) << sum_numdens;
state_over_time << std::setw(15) << state.rho;
state_over_time << std::setw(15) << state.T;
state_over_time << std::setw(15) << state.aux[0];
for (x = 0; x < NumSpec; ++x) {
state_over_time << std::setw(15) << state.xn[x];
}
Expand Down Expand Up @@ -313,6 +317,7 @@ auto burn_cell_c() -> int {
state_over_time << std::setw(15) << sum_numdens;
state_over_time << std::setw(15) << state.rho;
state_over_time << std::setw(12) << state.T;
state_over_time << std::setw(12) << state.aux[0];
for (x = 0; x < NumSpec; ++x) {
state_over_time << std::setw(15) << state.xn[x];
}
Expand All @@ -329,6 +334,8 @@ auto burn_cell_c() -> int {
std::cout << "------------------------------------" << std::endl;
std::cout << "T initial = " << state_in.T << std::endl;
std::cout << "T final = " << state.T << std::endl;
std::cout << "Tdust initial = " << state_in.aux[0] << std::endl;
std::cout << "Tdust final = " << state.aux[0] << std::endl;
std::cout << "Eint initial = " << state_in.e << std::endl;
std::cout << "Eint final = " << state.e << std::endl;
std::cout << "rho initial = " << state_in.rho << std::endl;
Expand Down

0 comments on commit 1f09cb8

Please sign in to comment.