Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add excitation to the hydrogen radiation sink term - copied from SD1D #43

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/lus/cls01095/work/e281/e281/hm1234/BOUT/dec21/BOUT-dev/**"
],
"defines": [],
"compilerPath": "/opt/gcc/10.1.0/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
Binary file added hermes-2
Binary file not shown.
11 changes: 8 additions & 3 deletions include/hermes-2.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private:
// Equilibrium current
Field2D Jpar0;

BoutReal nelim_floor; // Global density floor
BoutReal nesheath_floor; // Density floor used in sheath boundary conditions

// Evolving variables
Expand Down Expand Up @@ -142,6 +143,7 @@ private:
bool sheath_closure; // Sheath closure sink on vorticity (if sinks = true)
bool drift_wave; // Drift-wave closure (if sinks=true)

bool slab_radial_buffers; // an alternatice radial buffer region for use in slab geometry
bool radial_buffers; // Radial buffer regions
int radial_inner_width; // Number of points in the inner radial buffer
int radial_outer_width; // Number of points in the outer radial buffer
Expand Down Expand Up @@ -181,14 +183,16 @@ private:
BoutReal numdiff, hyper, hyperpar; ///< Numerical dissipation
int low_pass_z; // Fourier filter in Z
BoutReal z_hyper_viscos, x_hyper_viscos, y_hyper_viscos; // 4th-order derivatives
bool low_n_diffuse; // Diffusion in parallel direction at low density
bool low_n_diffuse_perp; // Diffusion in perpendicular direction at low density
BoutReal low_n_diffuse; // Diffusion in parallel direction at low density
BoutReal low_n_diffuse_perp; // Diffusion in perpendicular direction at low density
BoutReal ne_hyper_z, pe_hyper_z; // Hyper-diffusion
BoutReal nvi_hyper_z, vepsi_hyper_z; // hyper-diffusion on ion terms
BoutReal scale_num_cs; // Scale numerical sound speed
BoutReal floor_num_cs; // Apply a floor to the numerical sound speed
bool vepsi_dissipation; // Dissipation term in VePsi equation
bool vort_dissipation; // Dissipation term in Vorticity equation
bool phi_dissipation; // Dissipation term in Vorticity equation, depending on phi
BoutReal phi_dissipation; // Dissipation term in Vorticity equation, depending on phi
BoutReal delp2_dissipation; // Dissipation using delp2

// Sources and profiles

Expand Down Expand Up @@ -222,6 +226,7 @@ private:

// Curvature, Grad-B drift
Vector3D Curlb_B; // Curl(b/B)
bool revCurlb_B; // Reverse direction of Curl(b/B) vector

// Perturbed parallel gradient operators
const Field3D Grad_parP(const Field3D &f);
Expand Down
2 changes: 2 additions & 0 deletions include/mixed.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private:
Field3D Pnlim; // Limited pressure, used to calculate pressure-driven diffusive flows
Field3D Vn;
Field3D Dnn;

Field3D Riz, Rrc, Rcx, Rex;

bool sheath_ydown, sheath_yup;

Expand Down
5 changes: 4 additions & 1 deletion include/neutral-model.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public:

// Options for calculating rates
OPTION(options, Eionize, 30); // Energy loss per ionisation [eV]
OPTION(options, h_excitation, true); // Add to plasma radiation sink
}
virtual ~NeutralModel() {}

Expand Down Expand Up @@ -74,11 +75,13 @@ protected:
UpdatedRadiatedPower hydrogen; // Atomic rates (H.Willett)

BoutReal Eionize; // Energy loss per ionisation [eV]

bool h_excitation; // add excitation energy to the hydrogen radiation energy sink

void neutral_rates(const Field3D &Ne, const Field3D &Te, const Field3D &Ti, const Field3D &Vi, // Plasma quantities
const Field3D &Nn, const Field3D &Tn, const Field3D &Vnpar, // Neutral gas
Field3D &S, Field3D &F, Field3D &Qi, Field3D &R, // Transfer rates
Field3D &Riz, Field3D &Rrc, Field3D &Rcx); // Rates
Field3D &Riz, Field3D &Rrc, Field3D &Rcx, Field3D &Rex); // Rates

private:
NeutralModel();
Expand Down
26 changes: 26 additions & 0 deletions include/revision.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// Information about the version of Hermes
///
/// The build system will update this file on every commit, which may
/// result in files that include it getting rebuilt. Therefore it
/// should be included in as few places as possible

#ifndef HERMES_REVISION_H
#define HERMES_REVISION_H

namespace hermes {
namespace version {
/// The git commit hash
#ifndef HERMES_REVISION
constexpr auto revision = "@HERMES_REVISION@";
#else
// Stringify value passed at compile time
#define BUILDFLAG1_(x) #x
#define BUILDFLAG(x) BUILDFLAG1_(x)
constexpr auto revision = BUILDFLAG(HERMES_REVISION);
#undef BUILDFLAG1
#undef BUILDFLAG
#endif
} // namespace version
} // namespace hermes

#endif // HERMES_REVISION_H
6 changes: 3 additions & 3 deletions src/full-velocity.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ void FullVelocity::update(const Field3D &Ne, const Field3D &Te,
/////////////////////////////////////////////////////
// Atomic processes

Field3D Riz, Rrc, Rcx;
neutral_rates(Ne, Te, Ti, Vi, Nn, Tn, Vnpar, S, F, Qi, Rp, Riz, Rrc, Rcx);
Field3D Riz, Rrc, Rcx, Rex;
neutral_rates(Ne, Te, Ti, Vi, Nn, Tn, Vnpar, S, F, Qi, Rp, Riz, Rrc, Rcx, Rex);

Fperp = Rrc + Rcx; // Friction for vorticity
Fperp = Rrc + Rcx + Rex; // Friction for vorticity

// Loss of momentum in the X and Z directions
ddt(Vn2D).x -= (DC(Rcx) + DC(Riz)) * Vn2D.x / Nn2D_floor;
Expand Down
Loading