parallel_ohms_law: Added a new component.#432
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #432 +/- ##
==========================================
- Coverage 22.50% 22.03% -0.47%
==========================================
Files 87 89 +2
Lines 8071 8241 +170
Branches 1146 1167 +21
==========================================
Hits 1816 1816
- Misses 6085 6255 +170
Partials 170 170 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @malamast, nice work. Can you tell me a bit more about how mean field drifts with this approach compare to what SOLPS, UEDGE etc are doing? It looks more or less like what I understand is in SOLPS, but I'm not a drifts expert and never looked at the equations in detail. |
ZedThree
left a comment
There was a problem hiding this comment.
Some little bits to tidy up, but otherwise looks good. I'll leave the physics review up to @mikekryjak / @bendudson !
|
|
||
|
|
||
| namespace { | ||
| BoutReal clip(BoutReal value, BoutReal min, BoutReal max) { |
There was a problem hiding this comment.
This is unused and can be deleted
| return value; | ||
| } | ||
|
|
||
| Ind3D indexAt(const Field3D& f, int x, int y, int z) { |
There was a problem hiding this comment.
This is in hermes_utils, so this implementation can be deleted
| /// | ||
| /// exp( 2*log(fc) - log(fm) ) | ||
| /// | ||
| BoutReal limitFree(BoutReal fm, BoutReal fc) { |
There was a problem hiding this comment.
Also unused and can be deleted here
| } | ||
|
|
||
| eta = softFloor( resistivity_eta / eta_norm , resistivity_floor ); | ||
| // eta = sqrt( SQ(resistivity_eta / eta_norm) + resistivity_floor*resistivity_floor ); // This mitigates discontinuities. |
There was a problem hiding this comment.
We can delete commented out code:
| // eta = sqrt( SQ(resistivity_eta / eta_norm) + resistivity_floor*resistivity_floor ); // This mitigates discontinuities. |
| // if (!current.isAllocated()) { | ||
| // Not yet allocated -> Set to the value | ||
| // This avoids having to set to zero initially and add the first time | ||
| // current = charge * N * V; | ||
| // } else { | ||
| current += charge * N * V; | ||
| // } |
There was a problem hiding this comment.
| // if (!current.isAllocated()) { | |
| // Not yet allocated -> Set to the value | |
| // This avoids having to set to zero initially and add the first time | |
| // current = charge * N * V; | |
| // } else { | |
| current += charge * N * V; | |
| // } | |
| current += charge * N * V; |
| // set(electrons["velocity"], Ve); // # This is causing a problem with option.hasAttribute("final-domain") check in set function. | ||
| electrons["velocity"].force(Ve); |
There was a problem hiding this comment.
I'm not quite sure what this comment means -- is there an issue here that needs to be resolved?
There was a problem hiding this comment.
The problem is probably that:
- This component needs the collision frequency, so needs to run after
collisions collisionsuses the species velocities so marks electron velocity asfinal- This component needs to set the velocity. This isn't consistent with the friction calculation in
collisionsso an exception is thrown. This is the mechanism working as intended, flagging a circular dependency.
I think this should be resolved by #399, because that separates the collision frequency calculation from the friction calculation. This parallel_ohms_law component could run between braginskii_collisions and braginskii_friction.
1) Use parallel Ohm's law to calculate the parallel current 2) then uses this parallel current to calculate the parallel electron velocity. -This compoment requries cossisions to be calculated first so it should be called after collisions component. -When parallel_ohms_law is used then there is no need to evolve_momentum for electrons
c8a1997 to
d421c5a
Compare
In SOLPS and UEDGE, the parallel Ohm’s law is used to compute the electron parallel velocity, rather than solving a full electron momentum equation. I implemented this approach with the expectation that it would improve the numerical stability of my 2D transport simulations when drift terms are included. In practice, I enable this through the following component setup: For the electron species, the configuration is: Based on some runs with this formulation, the resulting electron parallel velocity Ve was lower than when using evolve_momentum but the trends were the same (except some initial transient phases with the evolve_momentum). However, at present, I do not have a reliable validation strategy for this component because I couldn't make it work with the drifts. I suggest not merging it for now. |
…d before the sheath_boundary component. using IS_SET_NOBOUNDARY and GET_NOBOUNDARY macros so that it can set Ve and NVe in the electron state without forcing it.
|
This is in better shape now. It needs to be called after braginskii_collisions and after vorticity or relax_potential. I'm preparing some comparisons with the evolve_momentum case. |
/// Caution! This component is not carfully evaluated for multispecies cases with multiple ions.
/// Use parallel Ohm's law to calculate the parallel current.
/// This law basically comes from the electron parallel momentum equation
/// by neglecting inertial (small by m_e / m_i) and viscous terms
/// (see Phys. Plasmas 10, 4744–4757 (2003) by Simakov & Catto).
/// Use the parallel current to calculate the electron parallel velocity
///
/// Jpar = - 1/eta * ∇phi + 1/(eta e n_e) * ∇P_e + (0.71 k_B)/(eta e) * ∇T_e
///
/// where phi is the electric potential and eta is the resistivity.
///
/// After normalization the equation takes the form:
///
/// Jpar = - ∇phi / eta + ∇P_e / (eta n_e) + 0.71 ∇T_e / eta
///
/// where the normalization parameter for the resistivity eta is:
///
/// eta_norm = Tnorm / (rho_s0 * Nnorm * Cs0 * qe)
///
/// Then uses this parallel current to calculate the parallel electron velocity.
///
/// Note: This needs to be called after collisions and other
/// components which impose forces on electrons_