Skip to content

Commit

Permalink
add comments; no need to rerun tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chongchonghe committed Sep 7, 2024
1 parent a3aca75 commit 4a79b63
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/radiation/radiation_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ struct RadPressureResult {
double S; // maximum wavespeed for the radiation system
};

// A struct to hold the results of the Newton-Raphson iteration for energy update, containing the following elements:
// Egas, T_gas, T_d, EradVec, kappaPVec, kappaEVec, kappaFVec, work, delta_nu_kappa_B_at_edge
template <typename problem_t> struct NewtonIterationResult {
double Egas; // gas internal energy
double T_gas; // gas temperature
Expand All @@ -101,7 +103,8 @@ template <typename problem_t> struct NewtonIterationResult {
amrex::GpuArray<double, Physics_Traits<problem_t>::nGroups> delta_nu_kappa_B_at_edge; // Delta (nu * kappa_B * B)
};

// A struct to hold the results of ComputeJacobianForPureGas or ComputeJacobianForGasAndDust
// A struct to hold the results of ComputeJacobian functions, containing the following elements:
// J00, F0, Fg_abs_sum, J0g, Jg0, Jgg, Fg
template <typename problem_t> struct JacobianResult {
double J00; // (0, 0) component of the Jacobian matrix
double F0; // (0) component of the residual
Expand Down
16 changes: 16 additions & 0 deletions src/radiation/source_terms_multi_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

#include "radiation/radiation_system.hpp" // IWYU pragma: keep

// Compute the Jacobian of energy update equations for the gas-radiation system. The result is a struct containing the following elements:
// J00: (0, 0) component of the Jacobian matrix. = d F0 / d Egas
// F0: (0) component of the residual. = Egas residual
// Fg_abs_sum: sum of the absolute values of the each component of Fg that has tau(g) > 0
// J0g: (0, g) components of the Jacobian matrix, g = 1, 2, ..., nGroups. = d F0 / d R_g
// Jg0: (g, 0) components of the Jacobian matrix, g = 1, 2, ..., nGroups. = d Fg / d Egas
// Jgg: (g, g) components of the Jacobian matrix, g = 1, 2, ..., nGroups. = d Fg / d R_g
// Fg: (g) components of the residual, g = 1, 2, ..., nGroups. = Erad residual
template <typename problem_t>
AMREX_GPU_DEVICE auto
RadSystem<problem_t>::ComputeJacobianForGas(double /*T_gas*/, double /*T_d*/, double Egas_diff, quokka::valarray<double, nGroups_> const &Erad_diff,
Expand Down Expand Up @@ -48,6 +56,14 @@ RadSystem<problem_t>::ComputeJacobianForGas(double /*T_gas*/, double /*T_d*/, do
return result;
}

// Compute the Jacobian of energy update equations for the gas-dust-radiation system. The result is a struct containing the following elements:
// J00: (0, 0) component of the Jacobian matrix. = d F0 / d Egas
// F0: (0) component of the residual. = Egas residual
// Fg_abs_sum: sum of the absolute values of the each component of Fg that has tau(g) > 0
// J0g: (0, g) components of the Jacobian matrix, g = 1, 2, ..., nGroups. = d F0 / d R_g
// Jg0: (g, 0) components of the Jacobian matrix, g = 1, 2, ..., nGroups. = d Fg / d Egas
// Jgg: (g, g) components of the Jacobian matrix, g = 1, 2, ..., nGroups. = d Fg / d R_g
// Fg: (g) components of the residual, g = 1, 2, ..., nGroups. = Erad residual
template <typename problem_t>
AMREX_GPU_DEVICE auto RadSystem<problem_t>::ComputeJacobianForGasAndDust(
double T_gas, double T_d, double Egas_diff, quokka::valarray<double, nGroups_> const &Erad_diff, quokka::valarray<double, nGroups_> const &Rvec,
Expand Down

0 comments on commit 4a79b63

Please # to comment.