GridFire 0.0.1a
General Purpose Nuclear Network
Loading...
Searching...
No Matches
gridfire::screening::ScreeningModel Class Referenceabstract

An abstract base class for plasma screening models. More...

#include <screening_abstract.h>

Inheritance diagram for gridfire::screening::ScreeningModel:
gridfire::screening::BareScreeningModel gridfire::screening::WeakScreeningModel

Public Types

using ADDouble = CppAD::AD<double>
 Alias for CppAD Automatic Differentiation type for double precision.
 

Public Member Functions

virtual ~ScreeningModel ()=default
 Virtual destructor.
 
virtual std::vector< double > calculateScreeningFactors (const reaction::LogicalReactionSet &reactions, const std::vector< fourdst::atomic::Species > &species, const std::vector< double > &Y, const double T9, const double rho) const =0
 Calculates screening factors for a set of reactions.
 
virtual std::vector< ADDoublecalculateScreeningFactors (const reaction::LogicalReactionSet &reactions, const std::vector< fourdst::atomic::Species > &species, const std::vector< ADDouble > &Y, const ADDouble T9, const ADDouble rho) const =0
 Calculates screening factors using CppAD types for automatic differentiation.
 

Detailed Description

An abstract base class for plasma screening models.

This class defines the interface for models that calculate the enhancement factor for nuclear reaction rates due to the electrostatic screening of interacting nuclei by the surrounding plasma. Concrete implementations of this class will provide specific screening prescriptions (e.g., WEAK, BARE, STRONG, etc.).

The interface provides methods for calculating screening factors for both standard double-precision inputs and for CppAD's automatic differentiation types, allowing the screening contributions to be included in Jacobian calculations.

Definition at line 27 of file screening_abstract.h.

Member Typedef Documentation

◆ ADDouble

Alias for CppAD Automatic Differentiation type for double precision.

Definition at line 30 of file screening_abstract.h.

Constructor & Destructor Documentation

◆ ~ScreeningModel()

virtual gridfire::screening::ScreeningModel::~ScreeningModel ( )
virtualdefault

Virtual destructor.

Ensures that derived class destructors are called correctly.

Member Function Documentation

◆ calculateScreeningFactors() [1/2]

virtual std::vector< ADDouble > gridfire::screening::ScreeningModel::calculateScreeningFactors ( const reaction::LogicalReactionSet & reactions,
const std::vector< fourdst::atomic::Species > & species,
const std::vector< ADDouble > & Y,
const ADDouble T9,
const ADDouble rho ) const
pure 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
reactionsThe set of logical reactions in the network.
speciesA vector of all atomic species involved in the network.
YA vector of the molar abundances (mol/g) for each species, as AD types.
T9The temperature in units of 10^9 K, as an AD type.
rhoThe 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.

Implemented in gridfire::screening::BareScreeningModel, and gridfire::screening::WeakScreeningModel.

◆ calculateScreeningFactors() [2/2]

virtual std::vector< double > gridfire::screening::ScreeningModel::calculateScreeningFactors ( const reaction::LogicalReactionSet & reactions,
const std::vector< fourdst::atomic::Species > & species,
const std::vector< double > & Y,
const double T9,
const double rho ) const
pure 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
reactionsThe set of logical reactions in the network.
speciesA vector of all atomic species involved in the network.
YA vector of the molar abundances (mol/g) for each species.
T9The temperature in units of 10^9 K.
rhoThe 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] ...
}

Implemented in gridfire::screening::BareScreeningModel, and gridfire::screening::WeakScreeningModel.


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