GridFire v0.7.6rc4.0 General Purpose Nuclear Network

Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
gridfire::screening Namespace Reference

## Classes
class | BareScreeningModel
| A screening model that applies no screening effect. More...
class | IntermediateScreeningModel
class | ScreeningModel
| An abstract base class for plasma screening models. More...
class | WeakScreeningModel
| Implements the weak screening model based on the Debye-Hückel approximation. More...

## Typedefs
using | ADDouble = CppAD::AD<double>

## Enumerations
enum class | ScreeningType { BARE , WEAK }
| Enumerates the available plasma screening models. More...

## Functions
std::unique_ptr< ScreeningModel > | selectScreeningModel (ScreeningType type)
| A factory function to select and create a screening model.

## Typedef Documentation

## ◆ ADDouble

typedef CppAD::AD< double > gridfire::screening::ADDouble = CppAD::AD<double>

## Enumeration Type Documentation

## ◆ ScreeningType

enum class gridfire::screening::ScreeningType
| strong

Enumerates the available plasma screening models.

This enum provides a set of identifiers for the different screening prescriptions that can be used in the reaction rate calculations.

Enumerator
BARE | No screening applied. The screening factor is always 1.0.
WEAK | Weak screening model (Salpeter, 1954). This model is suitable for non-degenerate, non-relativistic plasmas where the electrostatic potential energy between ions is small compared to their thermal kinetic energy. The screening enhancement factor is calculated as `exp(H_12)`. Algorithm A composition-dependent term, `ζ = ∑(Z_i^2 + Z_i) * Y_i`, is calculated, where Z_i is the charge and Y_i is the molar abundance of each species. A prefactor is computed: `prefactor = 0.188 * sqrt(ρ / T₇³) * sqrt(ζ)`, where ρ is the density and T₇ is the temperature in 10^7 K. For a reaction between two nuclei with charges Z₁ and Z₂, the enhancement term is `H_12 = prefactor * Z₁ * Z₂`. The final screening factor is `exp(H_12)`. A special calculation is performed for the triple-alpha reaction.

## Function Documentation

## ◆ selectScreeningModel()

std::unique_ptr< ScreeningModel > gridfire::screening::selectScreeningModel | ( | ScreeningType | type | ) |

A factory function to select and create a screening model.

This function returns a `std::unique_ptr` to a concrete implementation of the `ScreeningModel` abstract base class, based on the specified `ScreeningType`. This allows for easy switching between different screening prescriptions at runtime.

Parameters

  type | The `ScreeningType` enum value specifying which model to create.

Returns
  A `std::unique_ptr<ScreeningModel>` holding an instance of the requested screening model.

Algorithm The function uses a `switch` statement to determine which concrete model to instantiate. If the provided `type` does not match a known case, it defaults to creating a `BareScreeningModel` to ensure safe behavior.

Post-conditions

- A non-null `std::unique_ptr<ScreeningModel>` is always returned.

Usage

// Select the weak screening model
auto screening_model = gridfire::screening::selectScreeningModel(gridfire::screening::ScreeningType::WEAK);
// Use the model to calculate screening factors
// (assuming other parameters are initialized)
std::vector<double> factors = screening_model->calculateScreeningFactors(
reactions, species, Y, T9, rho
);
gridfire::screening::selectScreeningModel
std::unique_ptr< ScreeningModel > selectScreeningModel(ScreeningType type)
A factory function to select and create a screening model.
Definition screening_types.cpp:9
gridfire::screening::ScreeningType::WEAK
@ WEAK
Weak screening model (Salpeter, 1954).
Definition screening_types.h:35