|
subroutine | ts_init (a_grid, a_bc, a_ts) |
| Initializes the PETSc time stepper for the 2D diffusion solver. This routine sets up a system of conserving Fick's law type equations on the 2D XGC solver mesh for: density, flow and parallel and perpendicular temperature, i.e., 3*n_species+1 equations. The linear terms of the form \(\nabla \cdot \boldsymbol{D}.\nabla X \) are discretized with linear finite elements. The nonlinear terms are discretized with finite difference. The diffusivity tensor is set up such that only trnasport perpendicular to flux-surfaces is computed by this model. More...
|
|
subroutine | ts_solve (a_ts, a_dt, XX_in, blocksize) |
| This routine performs the actual time integration of the 2D diffusion model. More...
|
|
subroutine | formrhsjacobian (ts, t_dummy, a_XX, J, Jpre, a_ts, ierr) |
| Update the RHS Jacobian In case the RHS Jacobian has any time dependent terms, this routine would compute the time dependent terms and put them into the final Jacobian for the present stage/step. More...
|
|
subroutine | formrhsjacobianlocal (a_ts, Jpre, XX_in, nn, ierr) |
| Helper routine in XGC space for setting up the non-linear terms of the RHS Jacobian. This routine is used to compute any time dependent terms on the XGC solver grid. The result of this calculation will be inserted in the final RHS Jacobian. More...
|
|
subroutine | rhsfunction (ts, time, a_XX, a_FF, a_ts, ierr) |
| Evaluates the RHS equation. More...
|
|
subroutine | formrhsfunctionlocal (a_ts, time, ts_it, snes_it, XX_in, div_gamma_in, rhs_out, nn) |
| Computations in XGC space for RHS evaluation This includes 4 nonlinear terms for each species, one in the momentum equation, and three in the temperature equation. The terms are: (1/n) grad(n).(D+eta).grad(u) = (1/n) (D+eta) (dn/dr)(du/dr) in the momentum equation, and (T/n) div(D.grad(n)) = (T/n) d(D dn/dr)/dr (1/3n) grad(n).(5D+2chi).grad(T) = (5D+2chi)/(3n) (dn/dr)(dT/dr) (2m/3) grad(u).eta.grad(u) = (2m eta)/3 (du/dr)^2 Since this involves only radial gradients, we can simply use the XGC matrix gridgradientx. We have to take care, though, that vertices with undefined grad(psi) do not contribute (since we defined the tensor diffusivity to be D_ij=D(psi) psi_hat psi_hat). More...
|
|
subroutine | diffusion_solve (nn, XX_in, dt) |
|
subroutine formrhsfunctionlocal |
( |
type(xgc_ts) |
a_ts, |
|
|
|
time, |
|
|
|
ts_it, |
|
|
|
snes_it, |
|
|
real (kind=8), dimension(nn,a_ts%blocksize), intent(in) |
XX_in, |
|
|
real (kind=8), dimension(nn), intent(in) |
div_gamma_in, |
|
|
real (kind=8), dimension(nn,a_ts%blocksize), intent(out) |
rhs_out, |
|
|
integer |
nn |
|
) |
| |
Computations in XGC space for RHS evaluation This includes 4 nonlinear terms for each species, one in the momentum equation, and three in the temperature equation. The terms are: (1/n) grad(n).(D+eta).grad(u) = (1/n) (D+eta) (dn/dr)(du/dr) in the momentum equation, and (T/n) div(D.grad(n)) = (T/n) d(D dn/dr)/dr (1/3n) grad(n).(5D+2chi).grad(T) = (5D+2chi)/(3n) (dn/dr)(dT/dr) (2m/3) grad(u).eta.grad(u) = (2m eta)/3 (du/dr)^2 Since this involves only radial gradients, we can simply use the XGC matrix gridgradientx. We have to take care, though, that vertices with undefined grad(psi) do not contribute (since we defined the tensor diffusivity to be D_ij=D(psi) psi_hat psi_hat).
- Parameters
-
[in,out] | ts | PETSc time stepping object, TS |
[in] | time | Time stamp, PETScReal, PETScReal |
[in] | ts_it | TS time step index, PETScInt |
[in] | snes_it | SNES iteration index, PETScInt |
[in] | XX_in | Input quantities [n,ui,Tipa,Tipe,{ue,Tepa,Tepe}], real(8) |
[in] | div_gamma_in | div(D.grad(n)) |
[out] | rhs_out | Nonlinear RHS terms [n,ui,Tipa,Tipe,{ue,Tepa,Tepe}], real(8) |
[in] | nn | Number of mesh vertices, integer |