Skip to content

Commit

Permalink
advect actual density not log
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjridley committed Nov 22, 2024
1 parent bece951 commit c92ccd5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/solver_vertical_rusanov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ void Ions::solver_vertical_rusanov(Grid grid,
if (species[iSpecies].DoAdvect) {

// Log(number density):
log_s = log(species[iSpecies].density_scgc);
//log_s = log(species[iSpecies].density_scgc);
log_s = species[iSpecies].density_scgc;

calc_grad_and_diff_alts_rusanov(grid,
log_s,
Expand Down Expand Up @@ -508,11 +509,13 @@ void Ions::solver_vertical_rusanov(Grid grid,

// densities:
log_s =
log(species[iSpecies].density_scgc)
- dt * (divVertVel_s[iSpecies] +
species[iSpecies].density_scgc
//log(species[iSpecies].density_scgc)
- dt * (//divVertVel_s[iSpecies] +
species[iSpecies].velocity_vcgc[2] % gradLogN_s[iSpecies])
+ dt * diffLogN_s[iSpecies];
species[iSpecies].newDensity_scgc = exp(log_s);
//species[iSpecies].newDensity_scgc = exp(log_s);
species[iSpecies].newDensity_scgc = log_s;

} else
species[iSpecies].newDensity_scgc = species[iSpecies].density_scgc;
Expand Down

0 comments on commit c92ccd5

Please sign in to comment.