Skip to content
Open
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
10 changes: 8 additions & 2 deletions sd1d.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ class SD1D : public PhysicsModel {

mesh->communicate(Ne, NVi, P);

Field3D P_solver = P; // Save the pressure in the solver

// Floor small values
P = floor(P, 1e-10);
Ne = floor(Ne, 1e-10);
Expand All @@ -390,7 +392,7 @@ class SD1D : public PhysicsModel {

Vi = NVi / Ne;

Field3D Te = 0.5 * P / Ne; // Assuming Te = Ti
Field3D Te = 0.5 * P / Nelim; // Assuming Te = Ti

for (auto &i : Te.getRegion("RGN_NOBNDRY")) {
if (Te[i] > 10.)
Expand Down Expand Up @@ -1157,7 +1159,7 @@ class SD1D : public PhysicsModel {
if (rhs_explicit) {
// Flux splitting with upwinding
Field3D a = sqrt(gamma_sound * 2. * Te); // Local sound speed
ddt(NVi) = -FV::Div_par(NVi, Vi, a, bndry_flux_fix) // Momentum flow
ddt(NVi) = -FV::Div_par(NVi, Vi, a, false) // Momentum flow
- Grad_par(P);

if (atomic) {
Expand Down Expand Up @@ -1271,6 +1273,10 @@ class SD1D : public PhysicsModel {
if (ADpar > 0.0) {
ddt(P) += ADpar * AddedDissipation(1.0, P, P, true);
}

// Force P towards value in solver.
// Note: This only impacts solutions where Ne < floor
ddt(P) += 2. * Te * Ne - P_solver;
}
}

Expand Down