GridFire v0.7.1_rc2 General Purpose Nuclear Network

Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
gridfire::screening::IntermediateScreeningModel Class Referencefinal

`#include <screening_intermediate.h>`

Inheritance diagram for gridfire::screening::IntermediateScreeningModel:
[legend]
Collaboration diagram for gridfire::screening::IntermediateScreeningModel:
[legend]

## Public Member Functions
std::vector< double > | calculateScreeningFactors (const reaction::ReactionSet &reactions, const std::vector< fourdst::atomic::Species > &species, const std::vector< double > &Y, double T9, double rho) const override
| Calculates screening factors for a set of reactions.
std::vector< ADDouble > | calculateScreeningFactors (const reaction::ReactionSet &reactions, const std::vector< fourdst::atomic::Species > &species, const std::vector< ADDouble > &Y, ADDouble T9, ADDouble rho) const override
| Calculates screening factors using CppAD types for automatic differentiation.
Public Member Functions inherited from gridfire::screening::ScreeningModel
virtual | ~ScreeningModel ()=default
| Virtual destructor.

## Private Member Functions
template<typename T >
std::vector< T > | calculateFactors_impl (const reaction::ReactionSet &reactions, const std::vector< fourdst::atomic::Species > &species, const std::vector< T > &Y, T T9, T rho) const

## Additional Inherited Members
Public Types inherited from gridfire::screening::ScreeningModel
using | ADDouble = CppAD::AD< double >
| Alias for CppAD Automatic Differentiation type for double precision.

## Member Function Documentation

## ◆ calculateFactors_impl()

template<typename T >

std::vector< T > gridfire::screening::IntermediateScreeningModel::calculateFactors_impl | ( | const reaction::ReactionSet & | reactions,
|  | const std::vector< fourdst::atomic::Species > & | species,
|  | const std::vector< T > & | Y,
|  | T | T9,
|  | T | rho
| ) |  | const
| private

## ◆ calculateScreeningFactors() [1/2]

std::vector< ADDouble > gridfire::screening::IntermediateScreeningModel::calculateScreeningFactors | ( | const reaction::ReactionSet & | reactions,
|  | const std::vector< fourdst::atomic::Species > & | species,
|  | const std::vector< ADDouble > & | Y,
|  | ADDouble | T9,
|  | ADDouble | rho
| ) |  | const
| override virtual

Calculates screening factors using CppAD types for automatic differentiation.

This is a pure virtual function that provides an overload of `calculateScreeningFactors` for use with CppAD. It allows the derivatives of the screening factors with respect to abundances, temperature, and density to be computed automatically.

Parameters

  reactions | The set of logical reactions in the network.
  species | A vector of all atomic species involved in the network.
  Y | The current composition, providing molar abundances (mol/g) for each species.
  T9 | The temperature in units of 10^9 K, as an AD type.
  rho | The plasma density in g/cm^3, as an AD type.

Returns
  A vector of screening factors (dimensionless), as AD types.

Note This method is essential for including the effects of screening in the Jacobian matrix of the reaction network.

Implements gridfire::screening::ScreeningModel.

## ◆ calculateScreeningFactors() [2/2]

std::vector< double > gridfire::screening::IntermediateScreeningModel::calculateScreeningFactors | ( | const reaction::ReactionSet & | reactions,
|  | const std::vector< fourdst::atomic::Species > & | species,
|  | const std::vector< double > & | Y,
|  | double | T9,
|  | double | rho
| ) |  | const
| override virtual

Calculates screening factors for a set of reactions.

This is a pure virtual function that must be implemented by derived classes. It computes the screening enhancement factor for each reaction in the provided set based on the given plasma conditions.

Parameters

  reactions | The set of logical reactions in the network.
  species | A vector of all atomic species involved in the network.
  Y | The current composition, providing molar abundances (mol/g) for each species.
  T9 | The temperature in units of 10^9 K.
  rho | The plasma density in g/cm^3.

Returns
  A vector of screening factors (dimensionless), one for each reaction in the `reactions` set, in the same order.

Pre-conditions

- The size of the `Y` vector must match the size of the `species` vector.
- `T9` and `rho` must be positive.

Post-conditions

- The returned vector will have the same size as the `reactions` set.
- Each element in the returned vector will be >= 1.0.

Usage

// Assume 'model' is a std::unique_ptr<ScreeningModel> to a concrete implementation
// and other parameters (reactions, species, Y, T9, rho) are initialized.
std::vector<double> screening_factors = model->calculateScreeningFactors(
reactions, species, Y, T9, rho
);
for (size_t i = 0; i < reactions.size(); ++i) {
// ... use screening_factors[i] ...
}

Implements gridfire::screening::ScreeningModel.

The documentation for this class was generated from the following file:

- src/include/gridfire/screening/screening_intermediate.h