Skip to content

Commit 7d0618b

Browse files
authored
Merge pull request #377 from bshanahan/sin_alpha-as-F3D
Change sin_alpha to a Field3D in sheath_boundary
2 parents 45e11ab + f1ae2af commit 7d0618b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/sheath_boundary.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct SheathBoundary : public Component {
7777
void transform(Options &state) override;
7878
private:
7979
BoutReal Ge; // Secondary electron emission coefficient
80-
BoutReal sin_alpha; // sin of angle between magnetic field and wall.
80+
Field3D sin_alpha; // sin of angle between magnetic field and wall.
8181

8282
bool lower_y; // Boundary on lower y?
8383
bool upper_y; // Boundary on upper y?

src/sheath_boundary.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ SheathBoundary::SheathBoundary(std::string name, Options& alloptions, Solver*) {
6161
sin_alpha = options["sin_alpha"]
6262
.doc("Sin of the angle between magnetic field line and wall surface. "
6363
"Should be between 0 and 1")
64-
.withDefault(1.0);
64+
.withDefault(Field3D(1.0));
6565

66-
if ((sin_alpha < 0.0) or (sin_alpha > 1.0)) {
66+
if ((min(sin_alpha) < 0.0) or (max(sin_alpha) > 1.0)) {
6767
throw BoutException("Range of sin_alpha must be between 0 and 1");
6868
}
6969

@@ -202,7 +202,7 @@ void SheathBoundary::transform(Options& state) {
202202
(adiabatic * ti + Zi * s_i * te * grad_ne / grad_ni) / Mi, 0., 100.);
203203

204204
// Note: Vzi = C_i * sin(α)
205-
ion_sum[i] += s_i * Zi * sin_alpha * sqrt(C_i_sq);
205+
ion_sum[i] += s_i * Zi * sin_alpha[ip] * sqrt(C_i_sq);
206206
}
207207
}
208208
}
@@ -238,7 +238,7 @@ void SheathBoundary::transform(Options& state) {
238238
BoutReal C_i_sq = std::clamp(
239239
(adiabatic * ti + Zi * s_i * te * grad_ne / grad_ni) / Mi, 0., 100.);
240240

241-
ion_sum[i] += s_i * Zi * sin_alpha * sqrt(C_i_sq);
241+
ion_sum[i] += s_i * Zi * sin_alpha[im] * sqrt(C_i_sq);
242242
}
243243
}
244244
}

0 commit comments

Comments
 (0)