pyrokinetics.local_geometry.metric.MetricTerms#
- class pyrokinetics.local_geometry.metric.MetricTerms(local_geometry, ntheta=None, theta=None)[source]#
Bases:
objectGeneral geometry Object representing local LocalGeometry fit parameters
Data stored in a ordered dictionary
The following methods are used to access the metric tensor terms via the following
Examples
>>> g_r_r = MetricTerms.toroidal_covariant_metric("r", "r")
- Parameters:
local_geometry (LocalGeometry)
- regulartheta#
Evenly spaced theta grid
- Type:
Array
- R#
Flux surface R (normalised to a_minor)
- Type:
Array
- Z#
Flux surface Z (normalised to a_minor)
- Type:
Array
- dRdtheta#
Derivative of \(R\) w.r.t \(\theta\)
- Type:
Array
- dRdr#
Derivative of \(R\) w.r.t \(r\)
- Type:
Array
- dZdtheta#
Derivative of \(Z\) w.r.t \(\theta\)
- Type:
Array
- dZdr#
Derivative of \(Z\) w.r.t \(r\)
- Type:
Array
- d2Rdtheta2Array
Second derivative of \(R\) w.r.t \(\theta\)
- d2RdrdthetaArray
Second derivative of \(R\) w.r.t \(r\) and \(\theta\)
- d2Zdtheta2Array
Second derivative of \(Z\) w.r.t \(\theta\)
- d2ZdrdthetaArray
Second derivative of \(Z\) w.r.t \(r\) and \(theta\)
- JacobianArray
Jacobian of flux surface
- qFloat
Safety factor
- dqdrFloat
Derivative of \(q\) w.r.t \(r\)
- dpsidrFloat
\(\partial \psi / \partial r\)
- d2psidr2Float
Second derivative of \(psi\) w.r.t \(r\) - arbitrary to set to 0
- mu0dPdrFloat
\(mu_0 \partial p \partial r\)
- sigma_alphaInteger
Sign to select if (r, alpha, theta) or (r, theta, alpha) is a RHS system
- field_coordsList
List of field-aligned co-ordinates
- toroidal_coordsList
List of toroidal co-ordinates
- dg_r_theta_dthetaArray
Derivative of toroidal covariant metric term g_r_theta w.r.t \(theta\)
- dg_theta_theta_drArray
Derivative of toroidal covariant metric term g_theta_theta w.r.t \(r\)
- dg_zeta_zeta_drArray
Derivative of toroidal covariant metric term g_zeta_zeta w.r.t \(r\)
- dg_zeta_zeta_dthetaArray
Derivative of toroidal covariant metric term g_zeta_zeta w.r.t \(theta\)
- __init__(local_geometry, ntheta=None, theta=None)[source]#
- Parameters:
local_geometry (LocalGeometry)
Methods
__init__(local_geometry[, ntheta, theta])convert_physical_units(norms)Convert physical-unit attributes to generic simulation units of
norms.field_aligned_contravariant_metric(coord1, ...)Field aligned contravariant metric tensor at requested co-ordinate
field_aligned_covariant_metric(coord1, coord2)Field aligned covariant metric tensor at requested co-ordinate
k_perp(ky, theta0, nperiod)Equation 155
Sets up field-aligned contravariant metric tensor
Sets up field-aligned covariant metric tensor
Sets contravariant metric components of toroidal system using covariant components
Sets up toroidal covariant metric tensor
Sets up required terms of derivative of toroidal covariant metric tensor
to(norms[, context])Thin wrapper for normalise
toroidal_contravariant_metric(coord1, coord2)Toroidal contravariant metric tensor at requested co-ordinate
toroidal_covariant_metric(coord1, coord2)Toroidal contravariant metric tensor at requested co-ordinate
Attributes
inherits correct \(\sigma_\alpha\) from
dalpha_dthetaintegrate over thetaDifferentiate eq 9 w.r.t theta
Equation 39 inherits correct \(\sigma_\alpha\) from
d2alpha_drdthetaintegrate over theta- property B_magnitude#
- Returns:
B_magnitude – Magntiude of total field
- Return type:
Array
- property B_theta#
- Returns:
B_theta – Poloidal field in toroidal coordinates
- Return type:
Array
- property B_zeta#
- Returns:
B_zeta – B_zeta which is the current function (I or f) (equation 16)
- Return type:
Array
- property alpha#
inherits correct \(\sigma_\alpha\) from
dalpha_dthetaintegrate over theta- Returns:
alpha – Field following coordinate in field alligned system
- Return type:
Array
- convert_physical_units(norms)[source]#
Convert physical-unit attributes to generic simulation units of
norms.
- property d2alpha_drdtheta#
- Returns:
d2alpha_drdtheta – Second derivative of alpha w.r.t \(\theta\) and \(r\) (equation 38)
- Return type:
Array
- property dB_magnitude_dr#
- Returns:
dB_magnitude_dr – Derivative of magntiude of total field w.r.t r
- Return type:
Array
- property dB_magnitude_dtheta#
- Returns:
dB_magnitude_dr – Derivative of magntiude of total field w.r.t theta
- Return type:
Array
- property dB_theta_drho#
- Returns:
dB_theta_drho – Derivative of B_theta w.r.t \(r\)
- Return type:
Array
- property dB_theta_dtheta#
- Returns:
dB_theta_drho – Derivative of B_theta w.r.t \(r\)
- Return type:
Array
- property dB_zeta_dr#
- Returns:
dB_zeta_dr – Radial derivative of \(B_\zeta\) w.r.t \(r\) (equation 19)
- Return type:
Array
- property dJacobian_dr#
- Returns:
dJacobian_dr – Derivative of Jacobian w.r.t \(r\) (equation 21)
- Return type:
Array
- property dJacobian_dtheta#
Differentiate eq 9 w.r.t theta
- Returns:
dJacobian_dtheta – Derivative of Jacobian w.r.t :math:` heta`
- Return type:
Array
- property dalpha_dr#
Equation 39 inherits correct \(\sigma_\alpha\) from
d2alpha_drdthetaintegrate over theta- Returns:
dalpha_dr – Derivative of alpha w.r.t \(r\)
- Return type:
Array
- property dalpha_dtheta#
- Returns:
dalpha_dtheta – Derivative of alpha w.r.t \(\theta\) (equation 37)
- Return type:
Array
- field_aligned_contravariant_metric(coord1, coord2)[source]#
Field aligned contravariant metric tensor at requested co-ordinate
- field_aligned_covariant_metric(coord1, coord2)[source]#
Field aligned covariant metric tensor at requested co-ordinate
- set_toroidal_contravariant_metric()[source]#
Sets contravariant metric components of toroidal system using covariant components
- set_toroidal_covariant_metric_derivatives()[source]#
Sets up required terms of derivative of toroidal covariant metric tensor
- toroidal_contravariant_metric(coord1, coord2)[source]#
Toroidal contravariant metric tensor at requested co-ordinate