Skip to content

Commit e53561e

Browse files
authored
Merge branch 'next' into next-update
2 parents 0b4dc16 + 99f0f1e commit e53561e

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

diffusion2d.cxx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ Diffusion2D::Diffusion2D(Solver *solver, Mesh*, Options &options) : NeutralModel
2323
inv = 0;
2424
}
2525

26-
Diffusion2D::~Diffusion2D() {
27-
if(inv) {
28-
delete inv;
29-
}
30-
}
31-
3226
void Diffusion2D::update(const Field3D &Ne, const Field3D &Te, const Field3D &UNUSED(Ti), const Field3D &UNUSED(Vi)) {
3327

3428
mesh->communicate(Nn, Pn);

diffusion2d.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Diffusion2D : public NeutralModel {
99
public:
1010
Diffusion2D(Solver *solver, Mesh *mesh, Options &options);
11-
~Diffusion2D();
11+
~Diffusion2D() {}
1212

1313
void update(const Field3D &Ne, const Field3D &Te, const Field3D &Ti, const Field3D &Vi);
1414

@@ -20,7 +20,7 @@ private:
2020

2121
BoutReal Lmax; // Maximum mean free path [m]
2222

23-
Laplacian *inv; // Laplacian inversion used for preconditioning
23+
std::unique_ptr<Laplacian> inv; // Laplacian inversion used for preconditioning
2424
};
2525

2626
#endif // __NEUTRAL_DIFFUSION2D_H__

hermes-2.cxx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ int Hermes::init(bool restarting) {
359359

360360
OPTION(optsc, ne_hyper_z, -1.0);
361361
OPTION(optsc, pe_hyper_z, -1.0);
362+
OPTION(optsc, pi_hyper_z, -1.0);
362363

363364
OPTION(optsc, low_n_diffuse, false);
364365
OPTION(optsc, low_n_diffuse_perp, false);
@@ -701,7 +702,6 @@ int Hermes::init(bool restarting) {
701702
.doc("Include a fixed fraction carbon impurity. < 0 means none.")
702703
.withDefault(-1.);
703704
if (carbon_fraction > 0.0) {
704-
SAVE_REPEAT(Rzrad);
705705
SAVE_ONCE(carbon_fraction);
706706
carbon_rad = new HutchinsonCarbonRadiation();
707707
}
@@ -1870,6 +1870,7 @@ int Hermes::rhs(BoutReal t) {
18701870
Vi(r.ind, jy, jz) = -Vi(r.ind, mesh->ystart, jz);
18711871
NVi(r.ind, jy, jz) = -NVi(r.ind, mesh->ystart, jz);
18721872
Ve(r.ind, jy, jz) = -Ve(r.ind, mesh->ystart, jz);
1873+
VePsi(r.ind, jy, jz) = -VePsi(r.ind, mesh->ystart, jz);
18731874
Jpar(r.ind, jy, jz) = -Jpar(r.ind, mesh->ystart, jz);
18741875
}
18751876
}
@@ -3428,6 +3429,10 @@ int Hermes::rhs(BoutReal t) {
34283429
(2. / 3) * FV::Div_a_Laplace_perp(anomalous_chi * DC(Ne), DC(Ti));
34293430
}
34303431

3432+
if (pi_hyper_z > 0.0) {
3433+
ddt(Pi) -= pi_hyper_z * SQ(SQ(coord->dz)) * D4DZ4(Pi);
3434+
}
3435+
34313436
///////////////////////////////////
34323437
// Heat transmission through sheath
34333438

@@ -4007,7 +4012,7 @@ int Hermes::rhs(BoutReal t) {
40074012
* @param[in] delta Not used here
40084013
*/
40094014
int Hermes::precon(BoutReal t, BoutReal gamma, BoutReal delta) {
4010-
static InvertPar *inv = NULL;
4015+
static std::unique_ptr<InvertPar> inv;
40114016
if (!inv) {
40124017
// Initialise parallel inversion class
40134018
auto inv = InvertPar::create();

hermes-2.hxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ private:
183183
BoutReal z_hyper_viscos, x_hyper_viscos, y_hyper_viscos; // 4th-order derivatives
184184
bool low_n_diffuse; // Diffusion in parallel direction at low density
185185
bool low_n_diffuse_perp; // Diffusion in perpendicular direction at low density
186-
BoutReal ne_hyper_z, pe_hyper_z; // Hyper-diffusion
186+
BoutReal ne_hyper_z, pe_hyper_z, pi_hyper_z; // Hyper-diffusion
187187
BoutReal scale_num_cs; // Scale numerical sound speed
188188
BoutReal floor_num_cs; // Apply a floor to the numerical sound speed
189189
bool vepsi_dissipation; // Dissipation term in VePsi equation
@@ -230,8 +230,8 @@ private:
230230
// Electromagnetic solver for finite electron mass case
231231
bool split_n0_psi; // Split the n=0 component of Apar (psi)?
232232
//Laplacian *aparSolver;
233-
std::unique_ptr<LaplaceXZ> aparSolver{nullptr};
234233

234+
std::unique_ptr<LaplaceXZ> aparSolver{nullptr};
235235
LaplaceXY *aparXY; // Solves n=0 component
236236
Field2D psi2D; // Axisymmetric Psi
237237

@@ -246,6 +246,7 @@ private:
246246
BoutReal phi_boundary_last_update; ///< The last time the boundary was updated
247247

248248
bool newXZsolver;
249+
249250
std::unique_ptr<Laplacian> phiSolver{nullptr}; // Old Laplacian in X-Z
250251
std::unique_ptr<LaplaceXZ> newSolver{nullptr}; // New Laplacian in X-Z
251252

0 commit comments

Comments
 (0)