V3FIT
|
Compute the JxB - Grad(p) covariant force components. The plasma is in equilibrium when the force of the magnetic pressure balances the plasma pressure. More...
Functions/Subroutines | |
subroutine | update_force |
Update MHD forces on full radial mesh. More... | |
subroutine | incfields (jbsupsmnh, jbsupumnh, jbsupvmnh, jpmnh, |
Compute nonlinear or linearized contravariant magnetic field components and pressure in real space. More... | |
subroutine | lorentz (bsupsijf, bsupuijf, bsupvijf, |
Compute covariant (sub) real-space components of the Lorentz K X B force. More... | |
subroutine | getmhdforce (fsubsmnf, fsubumnf, fsubvmnf, pijh, |
Compute covariant (sub) components of the MHD force J X B - grad(p). More... | |
subroutine | initpardamping (parscale, pardamp) |
Compute scaling factors for parallel flow damping. More... | |
subroutine | get_force_harmonics (pardamp, f_smnf, f_umnf, f_vmnf, pa |
Final computation of the MHD covariant Fourier force components. More... | |
subroutine | addpardamping (pardamp, f_smnf, f_umnf, f_vmnf, |
Add parallel flow damping terms to forces (for Hessian calculation) to suppress null space at resonances. More... | |
Compute the JxB - Grad(p) covariant force components. The plasma is in equilibrium when the force of the magnetic pressure balances the plasma pressure.
F = J X B - Grad(p) = 0 (1)
where J is the current density. Updates for B (dB) and p (dp) were computed in siesta_bfield and siesta_pressure, respectively.
B_i+1 = B_i + dB (2a)
p_i+1 = p_i + dp (2b)
Note that the magnetic field and pressure terms contain a Jacobian factor. Updated current density can be found from the updated magnetic field.
J = Curl(B)/mu0 (3)
Actual computation of the contravariant current components is implimented in cv_currents. The curvilinear coordinates, the J X B term becomes
(J X B)_s = (K^u*B^v - K^v*B^u) (4a)
(J X B)_u = (K^v*B^s - K^s*B^v) (4b)
(J X B)_v = (K^s*B^u - K^u*B^s) (4c)
where K^i = sqrt(g) J^i.
subroutine siesta_force::addpardamping | ( | real (dp), dimension(:,:), intent(in) | pardamp, |
real (dp), dimension(:,:,:), intent(inout) | f_smnf, | ||
real (dp), dimension(:,:,:), intent(inout) | f_umnf, | ||
real (dp), dimension(:,:,:), intent(inout) | f_vmnf | ||
) |
Add parallel flow damping terms to forces (for Hessian calculation) to suppress null space at resonances.
Compute parallel (to B) damping force and add it to (linearized) forces to suppress null space in preconditioner.
[in,out] | f_smnf | Covariant component of the mhd force in the s direction. |
[in,out] | f_umnf | Covariant component of the mhd force in the u direction. |
[in,out] | f_vmnf | Covariant component of the mhd force in the v direction. |
[in] | jvsupsmnf | Contravariant displacement in the s direction. |
[in] | jvsupsmnf | Contravariant displacement in the u direction. |
[in] | jvsupsmnf | Contravariant displacement in the v direction. |
Definition at line 784 of file siesta_force.f90.
subroutine siesta_force::get_force_harmonics | ( | real (dp), dimension(:,:), intent(inout), allocatable | pardamp, |
real (dp), dimension(:,:,:), intent(inout) | f_smnf, | ||
real (dp), dimension(:,:,:), intent(inout) | f_umnf, | ||
real (dp), dimension(:,:,:), intent(inout) | f_vmnf, | ||
pa | |||
) |
Final computation of the MHD covariant Fourier force components.
Add pressure gradients and parallel damping (to Hessian), and scale and print boundary values.
[in,out] | pardamp | Parallel damping. |
[in,out] | f_smnf | Covariant component of the mhd force in the s direction. |
[in,out] | f_umnf | Covariant component of the mhd force in the u direction. |
[in,out] | f_vmnf | Covariant component of the mhd force in the v direction. |
[in] | parity | Parity of the fourier components. |
Definition at line 595 of file siesta_force.f90.
subroutine siesta_force::getmhdforce | ( | real (dp), dimension(:,:,:), intent(inout) | fsubsmnf, |
real (dp), dimension(:,:,:), intent(inout) | fsubumnf, | ||
real (dp), dimension(:,:,:), intent(inout) | fsubvmnf, | ||
real (dp), dimension(:,:,:), intent(in), allocatable | pijh | ||
) |
Compute covariant (sub) components of the MHD force J X B - grad(p).
The MHD forces are sum of Lorentz and pressure gradient forces
F = J X B - Grad(p) (1)
where J is the plasma current density. In curvilinear coodinates, the forces components becomes
F_s = (K^u*B^v - K^v*B^u) - dp/ds (2a)
F_u = (K^v*B^s - K^s*B^v) - dp/du (2b)
F_v = (K^s*B^u - K^u*B^s) - dp/dv (2c)
where K^i = sqrt(g)*J^i . Note this routine works on one parity at a time. When l_linearize is true, calculate the perturbed Force only (Ignores F(xc=0) part). When l_linearize is false, calculate full non-linear force(F(xc=0) part only)
[in,out] | fsubsmnf | Covariant force in the s direction. |
[in,out] | fsubumnf | Covariant force in the s direction. |
[in,out] | fsubvmnf | Covariant force in the s direction. |
[in] | pijh | Real space pressure. |
[in,out] | KxBsij | Covariant component of the lorentz force in the s direction. |
[in,out] | KxBuij | Covariant component of the lorentz force in the u direction. |
[in,out] | KxBvij | Covariant component of the lorentz force in the v direction. |
[in,out] | pardamp | Parallel damping. |
[in] | parity | Parity of the fourier components. |
Definition at line 429 of file siesta_force.f90.
subroutine siesta_force::incfields | ( | real (dp), dimension(:,:,:), intent(in), allocatable | jbsupsmnh, |
real (dp), dimension(:,:,:), intent(in), allocatable | jbsupumnh, | ||
real (dp), dimension(:,:,:), intent(in), allocatable | jbsupvmnh, | ||
real (dp), dimension(:,:,:), intent(in), allocatable | jpmnh | ||
) |
Compute nonlinear or linearized contravariant magnetic field components and pressure in real space.
[in] | jbsupsmnh | Contravariant B field in the s direction. |
[in] | jbsupumnh | Contravariant B field in the u direction. |
[in] | jbsupvmnh | Contravariant B field in the v direction. |
[in] | jpmnh | Pressure on the half grid. |
[in] | djbsupsmnh | Contravariant B field perturbation in the s direction. |
[in] | djbsupumnh | Contravariant B field perturbation in the u direction. |
[in] | djbsupvmnh | Contravariant B field perturbation in the v direction. |
[in] | djpmnh | Pressure perturbation. |
[out] | jbsupsijh | Real space contravariant B field in the s direction. |
[out] | jbsupuijh | Real space contravariant B field in the u !direction. |
[out] | jbsupvijh | Real space contravariant B field in the v direction. |
[in] | iparity | Fourier parity. |
Definition at line 231 of file siesta_force.f90.
subroutine siesta_force::initpardamping | ( | parscale, | |
real (dp), dimension(:,:), intent(inout), allocatable | pardamp | ||
) |
Compute scaling factors for parallel flow damping.
[in,out] | parscale | Scratch array. |
[in,out] | pardamp | Parallel damping. |
Definition at line 536 of file siesta_force.f90.
subroutine siesta_force::lorentz | ( | bsupsijf, | |
bsupuijf, | |||
bsupvijf | |||
) |
Compute covariant (sub) real-space components of the Lorentz K X B force.
[in] | bsupsijf | Contravariant component of the B field in the s direction. |
[in] | bsupuijf | Contravariant component of the B field in the u direction. |
[in] | bsupvijf | Contravariant component of the B field in the v direction. |
[in] | ksupsijf | Contravariant component of the current in the s direction. |
[in] | ksupuijf | Contravariant component of the current in the u direction. |
[in] | ksupvijf | Contravariant component of the current in the v direction. |
[in,out] | KxBsij | Covariant component of the lorentz force in the s direction. |
[in,out] | KxBuij | Covariant component of the lorentz force in the u direction. |
[in,out] | KxBvij | Covariant component of the lorentz force in the v direction. |
[in] | fcomb | Control flag to sum the components with previous values. |
Definition at line 348 of file siesta_force.f90.
subroutine siesta_force::update_force |
Update MHD forces on full radial mesh.
Updates force using the advanced values of B and p obtained from calls to siesta_pressure::update_pres and siesta_bfield::update_bfield Update values of fsub*mn*f stored in quantities. Linearized force is
Flin ~ delta_v
has only the linear part. Not DC part and not non-linear.
Definition at line 70 of file siesta_force.f90.