File snb.hxx#

namespace bout

Provides access to the Hypre library, handling initialisation and finalisation.

Usage

#include <bout/hyprelib.hxx>

class MyClass { public:

private: HypreLib lib; };

This will then automatically initialise Hypre the first time an object is created, and finalise it when the last object is destroyed.

Copyright 2012 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu

Contact: Ben Dudson, bd512@york.ac.uk

This file is part of BOUT++.

BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.

Explicit inversion of a 3x3 matrix a

If the matrix is singular (ill conditioned), the determinant is return. Otherwise, an empty std::optional is return

SNB model

class HeatFluxSNB#
#include <snb.hxx>

Calculate heat flux using the Shurtz-Nicolai-Busquet (SNB) model

Useful references:

Braginskii equations by R.Fitzpatrick: http://farside.ph.utexas.edu/teaching/plasma/Plasmahtml/node35.html

J.P.Brodrick et al 2017: https://doi.org/10.1063/1.5001079 and https://arxiv.org/abs/1704.08963

Shurtz, Nicolai and Busquet 2000: https://doi.org/10.1063/1.1289512

Public Functions

inline HeatFluxSNB()#

Construct using the options in the “snb” section.

inline explicit HeatFluxSNB(Options &options)#

Construct using options in given section.

~HeatFluxSNB() = default#
HeatFluxSNB(HeatFluxSNB&&) = default#
HeatFluxSNB &operator=(HeatFluxSNB&&) = default#
HeatFluxSNB(const HeatFluxSNB&) = delete#
HeatFluxSNB &operator=(const HeatFluxSNB&) = delete#
Field3D divHeatFlux(const Field3D &Te, const Field3D &Ne, Field3D *Div_Q_SH_out = nullptr)#

Calculate divergence of heat flux Te: Electron temperature in eV Ne: Electron density in m^-3

Div_Q_SH_out : An optional output field to store the Spitzer-Harm heat flux

Returns the divergence of heat flux in units of eV per cubic meter per second -> multiply by e=1.602e-19 to get Watts per cubic meter.

Private Functions

inline BoutReal int_beta4_exp(BoutReal beta)#

Indefinite integral of beta^4 * exp(-beta) with constant set to zero

inline BoutReal groupWeight(BoutReal beta_min, BoutReal beta_max)#

(1/24) * Integral of beta^4 * exp(-beta) from beta_min to beta_max

Private Members

std::unique_ptr<InvertParDiv> invertpardiv = {nullptr}#

Parallel inversion of tridiagonal matrices.

BoutReal Z = {1}#

Average ion charge (1 = Hydrogen)

BoutReal r = {2}#

Electron-electron mean free path scaling factor.

BoutReal beta_max = {10.0}#

Maximum energy group to consider (multiple of eT)

int ngroups = {40}#

Number of energy groups.