Skip to content

Commit df1bcc4

Browse files
author
Loren
committed
new vgrad terms
1 parent 6a8c2c9 commit df1bcc4

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

src/Diagnostics/Diagnostics_Base.F90

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Module Diagnostics_Base
9494
! actual induction (not multiplied by B)
9595
Integer, Parameter :: ialt_offset3 = 3000
9696
Integer, Parameter :: ialt_offset4 = ialt_offset3+100 ! 3100
97+
Integer, Parameter :: ialt_offset5 = ialt_offset4+200 ! 3300
9798

9899
! total
99100
Integer, Parameter :: induct_work_r = custom_offset + 1
@@ -300,6 +301,24 @@ Module Diagnostics_Base
300301
Integer, Parameter :: ialtcomp_t2 = ialt_offset4 + 5 + comp_offset
301302
Integer, Parameter :: ialtcomp_p2 = ialt_offset4 + 6 + comp_offset
302303

304+
! bit more breakup, start at 3300
305+
! comp
306+
! vgrad
307+
Integer, Parameter :: ialtcomp_t3 = ialt_offset5 + 1
308+
Integer, Parameter :: ialtcomp_t4 = ialt_offset5 + 2
309+
! induct
310+
Integer, Parameter :: ialtcomp_t5 = ialt_offset5 + 3
311+
Integer, Parameter :: ialtcomp_t6 = ialt_offset5 + 4
312+
! shear
313+
! vgrad
314+
Integer, Parameter :: ialtshear_t3 = ialt_offset5 + 5
315+
316+
! mag torque things
317+
Integer, Parameter :: alttorque1 = ialt_offset5 + 6
318+
Integer, Parameter :: alttorque2 = ialt_offset5 + 7
319+
Integer, Parameter :: alttorque3 = ialt_offset5 + 8
320+
Integer, Parameter :: alttorque4 = ialt_offset5 + 9
321+
303322

304323
include "turbKE_codes.F"
305324
include "axial_field_codes.F"

src/Diagnostics/Diagnostics_Custom.F90

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,73 @@ Subroutine Custom_MHD_Diagnostics(buffer)
13341334
Endif
13351335
Enddo
13361336

1337+
! terms bit more broken up
1338+
! comp, vgrad
1339+
If (compute_quantity(ialtcomp_t3)) Then
1340+
DO_PSI
1341+
qty(PSI) = -buff1(PSI, dvpdp)/radius(r)/sintheta(t)
1342+
END_DO
1343+
Call Add_Quantity(qty)
1344+
Endif
1345+
If (compute_quantity(ialtcomp_t4)) Then
1346+
DO_PSI
1347+
qty(PSI) = -buff1(PSI, vtheta)*cottheta(t)/radius(r)
1348+
END_DO
1349+
Call Add_Quantity(qty)
1350+
Endif
1351+
! comp, induct
1352+
If (compute_quantity(ialtcomp_t5)) Then
1353+
DO_PSI
1354+
qty(PSI) = -buff2(PSI,btheta)*buff1(PSI, dvpdp)/radius(r)/sintheta(t)
1355+
END_DO
1356+
Call Add_Quantity(qty)
1357+
Endif
1358+
If (compute_quantity(ialtcomp_t6)) Then
1359+
DO_PSI
1360+
qty(PSI) = -buff2(PSI,btheta)*buff1(PSI, vtheta)*cottheta(t)/radius(r)
1361+
END_DO
1362+
Call Add_Quantity(qty)
1363+
Endif
1364+
! shear, vgrad
1365+
If (compute_quantity(ialtshear_t3)) Then
1366+
DO_PSI
1367+
qty(PSI) = buff1(PSI, dvtdr) - buff1(PSI, vtheta)/radius(r)
1368+
END_DO
1369+
Call Add_Quantity(qty)
1370+
Endif
1371+
1372+
1373+
! more TORQUE stuff
1374+
! torque, vgrad
1375+
If (compute_quantity(alttorque1)) Then
1376+
DO_PSI
1377+
qty(PSI) = radius(r)*sintheta(t)/four_pi*(buffer(PSI, dbpdr) +&
1378+
&buffer(PSI, bphi)/radius(r))
1379+
END_DO
1380+
Call Add_Quantity(qty)
1381+
Endif
1382+
If (compute_quantity(alttorque2)) Then
1383+
DO_PSI
1384+
qty(PSI) = buffer(PSI,br)*radius(r)*sintheta(t)/four_pi*(buffer(PSI, dbpdr) +&
1385+
&buffer(PSI, bphi)/radius(r))
1386+
END_DO
1387+
Call Add_Quantity(qty)
1388+
Endif
1389+
If (compute_quantity(alttorque3)) Then
1390+
DO_PSI
1391+
qty(PSI) = (sintheta(t)*buffer(PSI, dbpdt) +&
1392+
&costheta(t)*buffer(PSI, bphi))/four_pi
1393+
END_DO
1394+
Call Add_Quantity(qty)
1395+
Endif
1396+
If (compute_quantity(alttorque4)) Then
1397+
DO_PSI
1398+
qty(PSI) = buffer(PSI,btheta)/four_pi*(sintheta(t)*buffer(PSI, dbpdt) +&
1399+
&costheta(t)*buffer(PSI, bphi))
1400+
END_DO
1401+
Call Add_Quantity(qty)
1402+
Endif
1403+
13371404
DeAllocate(ind_work_r)
13381405
DeAllocate(ind_work_t)
13391406
DeAllocate(ind_work_p)

0 commit comments

Comments
 (0)