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

Scale kappa_par in core rings #12

Open
wants to merge 1 commit 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
2 changes: 2 additions & 0 deletions include/evolve_pressure.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ private:
bool low_p_diffuse_perp; ///< Add artificial cross-field diffusion at low electron pressure?

Field3D kappa_par; ///< Parallel heat conduction coefficient
BoutReal core_kappa_factor; ///< Scaling factor on first core ring conduction
int core_kappa_scale_rings; ///< Number of rings to scale conduction by core_kappa_factor

Field3D source, final_source; ///< External pressure source
Field3D Sp; ///< Total pressure source
Expand Down
22 changes: 22 additions & 0 deletions src/evolve_pressure.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ EvolvePressure::EvolvePressure(std::string name, Options& alloptions, Solver* so
.doc("Flux limiter factor. < 0 means no limit. Typical is 0.2 for electrons, 1 for ions.")
.withDefault(-1.0);

core_kappa_factor = options["core_kappa_factor"]
.doc("Multiply kappa by this factor in the first core ring. Helpful in avoiding mesh seam fluctuations at low rtol.")
.withDefault(1.0);

core_kappa_scale_rings = options["core_kappa_scale_rings"]
.doc("Number of rings to scale kappa by core_kappa_factor. Default is 1.")
.withDefault<int>(1);


p_div_v = options["p_div_v"]
.doc("Use p*Div(v) form? Default, false => v * Grad(p) form")
.withDefault<bool>(false);
Expand Down Expand Up @@ -343,6 +352,19 @@ void EvolvePressure::finally(const Options& state) {
}
}


// Loop over first core ring and multiply kappa by core_kappa_factor
for (int ix = mesh->firstX(); ix < mesh->firstX() + core_kappa_scale_rings + 1; ix++) {
for (int iy = 0; iy < mesh->LocalNy ; iy++) {
for (int iz = 0; iz < mesh->LocalNz; iz++) {

if (mesh->periodicY(ix)) { // select only periodic, i.e. core region
kappa_par(ix, iy, iz) *= core_kappa_factor;
}
}
}
}

// Note: Flux through boundary turned off, because sheath heat flux
// is calculated and removed separately
ddt(P) += (2. / 3) * FV::Div_par_K_Grad_par(kappa_par, T, false);
Expand Down
Loading