Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add calculation of force error with anisotropic pressure tensor #395

Merged
merged 53 commits into from
Oct 5, 2023

Conversation

f0uriest
Copy link
Member

@f0uriest f0uriest commented Jan 5, 2023

Resolves #312

@f0uriest f0uriest marked this pull request as draft January 5, 2023 04:39
@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Merging #395 (ecddde0) into master (cbc288e) will increase coverage by 0.01%.
The diff coverage is 95.93%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
+ Coverage   94.63%   94.65%   +0.01%     
==========================================
  Files          79       79              
  Lines       18756    18872     +116     
==========================================
+ Hits        17750    17863     +113     
- Misses       1006     1009       +3     
Files Coverage Δ
desc/compute/_equil.py 100.00% <100.00%> (ø)
desc/compute/_profiles.py 99.08% <100.00%> (+0.11%) ⬆️
desc/compute/utils.py 95.89% <ø> (ø)
desc/continuation.py 93.37% <100.00%> (+0.66%) ⬆️
desc/equilibrium/equilibrium.py 96.27% <100.00%> (+0.07%) ⬆️
desc/objectives/__init__.py 100.00% <ø> (ø)
desc/objectives/linear_objectives.py 97.31% <92.85%> (-0.11%) ⬇️
desc/objectives/_equilibrium.py 96.66% <95.23%> (-0.27%) ⬇️
desc/objectives/getters.py 92.75% <66.66%> (-2.49%) ⬇️

dpanici
dpanici previously approved these changes Sep 8, 2023
@f0uriest f0uriest changed the title Rc/anisotropy Add calculation of force error with anisotropic pressure tensor Sep 10, 2023
dpanici
dpanici previously approved these changes Sep 11, 2023
desc/compute/_profiles.py Outdated Show resolved Hide resolved
@@ -1303,4 +1303,5 @@ def body(i, mins):
"electron_density": "ne_l",
"ion_temperature": "Ti_l",
"atomic_number": "Zeff_l",
"anisotropy": "a_lmn",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to do anisotropy, you have to give a regular pressure profile + a new anisotropy profile? I thought we could do this by just generalizing the pressure profile (something like p_l would become p_lmn)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be anisotropic scalar pressure (ie, scalar pressure but a function of r,t,z). What we actually want is an anisotropic pressure tensor, hence the need for the new profile to represent the difference between the parallel and perpendicular pressures (see the notes linked above for a full description)

desc/objectives/_equilibrium.py Show resolved Hide resolved
desc/objectives/_equilibrium.py Outdated Show resolved Hide resolved
desc/objectives/_equilibrium.py Show resolved Hide resolved
@@ -62,6 +63,27 @@ def test_SOLOVEV_results(SOLOVEV):
np.testing.assert_allclose(theta_err, 0, atol=1e-4)


@pytest.mark.regression
@pytest.mark.solve
def test_SOLOVEV_anisotropic_results(SOLOVEV):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, but it doesn't actually test that solving with non-zero anisotropy works correctly. Do we have any benchmark cases we could use for that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. Frank and I are working on comparing to near axis stuff but still in progress.

@f0uriest f0uriest requested a review from ddudt September 14, 2023 05:09
dpanici
dpanici previously approved these changes Sep 14, 2023
dpanici
dpanici previously approved these changes Sep 27, 2023
@f0uriest f0uriest merged commit 6b2bfaa into master Oct 5, 2023
16 checks passed
@f0uriest f0uriest deleted the rc/anisotropy branch October 5, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow computing equilibria with anisotropic pressure
4 participants