B.n free boundary solver (only valid in vacuum)#437
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
| // use the Boundary Integral Equation Solver for Toroidal systems | ||
| // for the free-boundary force contribution | ||
| BIEST | ||
| BIEST, |
There was a problem hiding this comment.
warning: invalid case style for enum constant 'BIEST' [readability-identifier-naming]
| BIEST, | |
| kBiest, |
|
|
||
| // use just the coils field with B_coils . n = 0 boundary condition | ||
| // instead of pressure continuity | ||
| ONLY_COILS_BDOTN |
There was a problem hiding this comment.
warning: invalid case style for enum constant 'ONLY_COILS_BDOTN' [readability-identifier-naming]
| ONLY_COILS_BDOTN | |
| kOnlyCoilsBdotn |
| // Original pressure continuity boundary condition. | ||
| // MUST NOT BREAK TRI-DIAGONAL RADIAL COUPLING: OFFENDS | ||
| // PRECONDITIONER! | ||
| double edgePressure = |
There was a problem hiding this comment.
warning: invalid case style for variable 'edgePressure' [readability-identifier-naming]
| double edgePressure = | |
| double edge_pressure = |
src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:1061:
- if (edgePressure != 0.0) {
- edgePressure = m_p_.evalMassProfile(1.0) / edgePressure *
+ if (edge_pressure != 0.0) {
+ edge_pressure = m_p_.evalMassProfile(1.0) / edge_pressure *src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:1082:
- m_h_.vacuum_magnetic_pressure[idx_lk] + edgePressure;
+ m_h_.vacuum_magnetic_pressure[idx_lk] + edge_pressure;| const int k = kl / s_.nThetaEff; | ||
| const int l = kl % s_.nThetaEff; | ||
| const int idx_lk = l * s_.nZeta + k; | ||
| double outsideEdgePressure = |
There was a problem hiding this comment.
warning: invalid case style for variable 'outsideEdgePressure' [readability-identifier-naming]
| double outsideEdgePressure = | |
| double outside_edge_pressure = |
src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:1086:
- rBSq[kl] = outsideEdgePressure * (r1_e[idx_kl] + r1_o[idx_kl]) /
+ rBSq[kl] = outside_edge_pressure * (r1_e[idx_kl] + r1_o[idx_kl]) /src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:1090:
- delBSq[kl] = fabs(outsideEdgePressure - insideTotalPressure[kl]);
+ delBSq[kl] = fabs(outside_edge_pressure - insideTotalPressure[kl]);| } | ||
|
|
||
| double IdealMhdModel::get_delbn() const { | ||
| double delBnAvg = 0.0; |
There was a problem hiding this comment.
warning: invalid case style for variable 'delBnAvg' [readability-identifier-naming]
| double delBnAvg = 0.0; | |
| double del_bn_avg = 0.0; |
src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:3630:
- delBnAvg += delBn[kl] * s_.wInt[l];
+ del_bn_avg += delBn[kl] * s_.wInt[l];src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:3633:
- delBnAvg /= delBnNorm;
+ del_bn_avg /= delBnNorm;src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:3635:
- return delBnAvg;
+ return del_bn_avg;| double delBnAvg = 0.0; | ||
| if (m_fc_.lfreeb && | ||
| m_vacuum_pressure_state_ == VacuumPressureState::kActive) { | ||
| double delBnNorm = 0.0; |
There was a problem hiding this comment.
warning: invalid case style for variable 'delBnNorm' [readability-identifier-naming]
| double delBnNorm = 0.0; | |
| double del_bn_norm = 0.0; |
src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:3631:
- delBnNorm += insideTotalPressure[kl] * s_.wInt[l];
+ del_bn_norm += insideTotalPressure[kl] * s_.wInt[l];src/vmecpp/cpp/vmecpp/vmec/ideal_mhd_model/ideal_mhd_model.cc:3633:
- delBnAvg /= delBnNorm;
+ delBnAvg /= del_bn_norm;63beef0 to
b6253dc
Compare
bcc2392 to
5593167
Compare
b6253dc to
534e821
Compare
534e821 to
0ed610f
Compare
|
@jurasic-pf This one currently segfaults in CI - sure that I should review this already? |
|
right, these ones are definitely drafts |
5593167 to
936f877
Compare
8c27a5f to
21297d8
Compare
936f877 to
128f815
Compare
21297d8 to
b02ff54
Compare
128f815 to
69142e7
Compare
b02ff54 to
7c80e22
Compare

TL;DR
Added a new free boundary method
ONLY_COILS_BDOTNthat uses B_coils·n = 0 boundary condition instead of pressure continuity for vacuum calculations.