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

Update equations to match physics and boozer fit for general toroidal angle #1177

Merged
merged 23 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6ea35e6
Change equations to match physics:
unalmis Aug 12, 2024
2dfcb67
Fix bugs in boozer tranform and boozer harmonics
unalmis Aug 12, 2024
b64570a
Revert changes to B_theta_mn in previous commit
unalmis Aug 12, 2024
cf49ba5
Merge branch 'ku/bugfix_angles' into ku/angles
unalmis Aug 12, 2024
2f32d99
Merge branch 'ku/bugfix_angles' into ku/angles
unalmis Aug 13, 2024
535bafd
Merge branch 'ku/angles' into ku/fix_boozer
unalmis Aug 13, 2024
583675f
Merge branch 'ku/bugfix_angles' into ku/angles
unalmis Aug 13, 2024
a779c38
Merge branch 'ku/bugfix_angles' into ku/angles
unalmis Aug 13, 2024
2b2fffa
Merge branch 'ku/angles' into ku/fix_boozer
unalmis Aug 13, 2024
a2a8b81
Register angle derivatives as copies of stream functions
unalmis Aug 17, 2024
e627311
Merge branch 'ku/angles' into ku/fix_boozer
unalmis Aug 17, 2024
e238c54
Update master data for new alias
unalmis Aug 17, 2024
f2d2563
Merge branch 'master' into ku/angles
unalmis Aug 17, 2024
b5f0727
Merge branch 'ku/angles' into ku/fix_boozer
unalmis Aug 17, 2024
9270292
update boozer fit for general toroidal angle (#1179)
unalmis Aug 17, 2024
3aa9dda
Add psi_rrr = 0 to assumptions in test_axis_limits
unalmis Aug 18, 2024
2ce481e
Merge branch 'master' into ku/angles
dpanici Aug 20, 2024
440664f
Merge branch 'master' into ku/angles
unalmis Aug 20, 2024
01513a8
Merge branch 'master' into ku/angles
unalmis Aug 22, 2024
bac9401
improve descriptions of angle derivatives
unalmis Aug 22, 2024
2fb656d
Merge branch 'master' into ku/angles
unalmis Aug 26, 2024
c381196
Merge branch 'master' into ku/angles
unalmis Aug 27, 2024
1c88963
Merge branch 'master' into ku/angles
unalmis Aug 27, 2024
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
250 changes: 249 additions & 1 deletion desc/compute/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2764,6 +2764,25 @@ def _phi_rr(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="phi_rrz",
label="\\partial_{\\rho \\rho \\zeta} \\phi",
units="rad",
units_long="radians",
description="Toroidal angle in lab frame, second derivative wrt radial coordinate "
unalmis marked this conversation as resolved.
Show resolved Hide resolved
"and first wrt DESC toroidal coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["omega_rrz"],
)
def _phi_rrz(params, transforms, profiles, data, **kwargs):
data["phi_rrz"] = data["omega_rrz"]
return data


@register_compute_fun(
name="phi_rt",
label="\\partial_{\\rho \\theta} \\phi",
Expand All @@ -2783,6 +2802,25 @@ def _phi_rt(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="phi_rtz",
label="\\partial_{\\rho \\theta \\zeta} \\phi",
units="rad",
units_long="radians",
description="Toroidal angle in lab frame, third derivative wrt radial, "
"poloidal, and toroidal coordinates",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["omega_rtz"],
)
def _phi_rtz(params, transforms, profiles, data, **kwargs):
data["phi_rtz"] = data["omega_rtz"]
return data


@register_compute_fun(
name="phi_rz",
label="\\partial_{\\rho \\zeta} \\phi",
Expand All @@ -2802,6 +2840,25 @@ def _phi_rz(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="phi_rzz",
label="\\partial_{\\rho \\zeta \\zeta} \\phi",
units="rad",
units_long="radians",
description="Toroidal angle in lab frame, first derivative wrt radial and "
"second derivative wrt DESC toroidal coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["omega_rzz"],
)
def _phi_rzz(params, transforms, profiles, data, **kwargs):
data["phi_rzz"] = data["omega_rzz"]
return data


@register_compute_fun(
name="phi_t",
label="\\partial_{\\theta} \\phi",
Expand Down Expand Up @@ -2843,12 +2900,31 @@ def _phi_tt(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="phi_ttz",
label="\\partial_{\\theta \\theta \\zeta} \\phi",
units="rad",
units_long="radians",
description="Toroidal angle in lab frame, second derivative wrt poloidal "
dpanici marked this conversation as resolved.
Show resolved Hide resolved
"coordinate and first derivative wrt toroidal coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["omega_ttz"],
)
def _phi_ttz(params, transforms, profiles, data, **kwargs):
data["phi_ttz"] = data["omega_ttz"]
return data


@register_compute_fun(
name="phi_tz",
label="\\partial_{\\theta \\zeta} \\phi",
units="rad",
units_long="radians",
description="Toroidal angle in lab frame, second derivative wrt poloidal and "
description="Toroidal angle in lab frame, derivative wrt poloidal and "
"toroidal coordinate",
dim=1,
params=[],
Expand All @@ -2862,6 +2938,25 @@ def _phi_tz(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="phi_tzz",
label="\\partial_{\\theta \\zeta \\zeta} \\phi",
units="rad",
units_long="radians",
description="Toroidal angle in lab frame, derivative wrt poloidal coordinate and "
"second derivative wrt toroidal coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["omega_tzz"],
)
def _phi_tzz(params, transforms, profiles, data, **kwargs):
data["phi_tzz"] = data["omega_tzz"]
return data


@register_compute_fun(
name="phi_z",
label="\\partial_{\\zeta} \\phi",
Expand Down Expand Up @@ -2903,6 +2998,25 @@ def _phi_zz(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="phi_zzz",
label="\\partial_{\\zeta \\zeta \\zeta} \\phi",
units="rad",
units_long="radians",
description="Toroidal angle in lab frame, third derivative wrt toroidal "
"coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["omega_zzz"],
)
def _phi_zzz(params, transforms, profiles, data, **kwargs):
data["phi_zzz"] = data["omega_zzz"]
return data


@register_compute_fun(
name="rho",
label="\\rho",
Expand Down Expand Up @@ -2986,6 +3100,83 @@ def _theta_PEST_r(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="theta_PEST_rt",
label="\\partial_{\\rho \\theta} \\vartheta",
units="rad",
units_long="radians",
description="PEST straight field line poloidal angular coordinate, derivative wrt "
"radial and DESC poloidal coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["lambda_rt"],
)
def _theta_PEST_rt(params, transforms, profiles, data, **kwargs):
data["theta_PEST_rt"] = data["lambda_rt"]
rahulgaur104 marked this conversation as resolved.
Show resolved Hide resolved
return data


@register_compute_fun(
name="theta_PEST_rrt",
label="\\partial_{\\rho \\rho \\theta} \\vartheta",
units="rad",
units_long="radians",
description="PEST straight field line poloidal angular coordinate, second "
"derivative wrt radial coordinate and first derivative wrt DESC poloidal "
"coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["lambda_rrt"],
)
def _theta_PEST_rrt(params, transforms, profiles, data, **kwargs):
data["theta_PEST_rrt"] = data["lambda_rrt"]
return data


@register_compute_fun(
name="theta_PEST_rtz",
label="\\partial_{\\rho \\theta \\zeta} \\vartheta",
units="rad",
units_long="radians",
description="PEST straight field line poloidal angular coordinate, derivative wrt "
"radial and DESC poloidal and toroidal coordinates",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["lambda_rtz"],
)
def _theta_PEST_rtz(params, transforms, profiles, data, **kwargs):
data["theta_PEST_rtz"] = data["lambda_rtz"]
return data


@register_compute_fun(
name="theta_PEST_rtt",
label="\\partial_{\\rho \\theta \\theta} \\vartheta",
units="rad",
units_long="radians",
description="PEST straight field line poloidal angular coordinate, derivative wrt "
"radial coordinate once and DESC poloidal coordinate twice",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["lambda_rtt"],
)
def _theta_PEST_rtt(params, transforms, profiles, data, **kwargs):
data["theta_PEST_rtt"] = data["lambda_rtt"]
return data

unalmis marked this conversation as resolved.
Show resolved Hide resolved

@register_compute_fun(
name="theta_PEST_t",
label="\\partial_{\\theta} \\vartheta",
Expand Down Expand Up @@ -3024,6 +3215,25 @@ def _theta_PEST_tt(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="theta_PEST_ttt",
label="\\partial_{\\theta \\theta \\theta} \\vartheta",
units="rad",
units_long="radians",
description="PEST straight field line poloidal angular coordinate, third "
"derivative wrt poloidal coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["lambda_ttt"],
)
def _theta_PEST_ttt(params, transforms, profiles, data, **kwargs):
data["theta_PEST_ttt"] = data["lambda_ttt"]
return data


@register_compute_fun(
name="theta_PEST_tz",
label="\\partial_{\\theta \\zeta} \\vartheta",
Expand All @@ -3043,6 +3253,25 @@ def _theta_PEST_tz(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="theta_PEST_tzz",
label="\\partial_{\\theta \\zeta \\zeta} \\vartheta",
units="rad",
units_long="radians",
description="PEST straight field line poloidal angular coordinate, derivative wrt "
"poloidal coordinate once and toroidal coordinate twice",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["lambda_tzz"],
)
def _theta_PEST_tzz(params, transforms, profiles, data, **kwargs):
data["theta_PEST_tzz"] = data["lambda_tzz"]
return data


@register_compute_fun(
name="theta_PEST_z",
label="\\partial_{\\zeta} \\vartheta",
Expand Down Expand Up @@ -3081,6 +3310,25 @@ def _theta_PEST_zz(params, transforms, profiles, data, **kwargs):
return data


@register_compute_fun(
name="theta_PEST_ttz",
label="\\partial_{\\theta \\theta \\zeta} \\vartheta",
units="rad",
units_long="radians",
description="PEST straight field line poloidal angular coordinate, second "
"derivative wrt poloidal coordinate and derivative wrt toroidal coordinate",
dim=1,
params=[],
transforms={},
profiles=[],
coordinates="rtz",
data=["lambda_ttz"],
)
def _theta_PEST_ttz(params, transforms, profiles, data, **kwargs):
data["theta_PEST_ttz"] = data["lambda_ttz"]
return data


@register_compute_fun(
name="zeta",
label="\\zeta",
Expand Down
Loading
Loading