Skip to content

Commit a5df7e7

Browse files
committed
Add divergence of total buoyancy flag
1 parent d453f63 commit a5df7e7

File tree

11 files changed

+104
-35
lines changed

11 files changed

+104
-35
lines changed

doc/CALYPSO.pdf

1.16 KB
Binary file not shown.

doc/tex_src/controls_CALYPSO.tex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,16 @@ \subsection{\tt phys\_values\_ctl}
361361
\tt rot\_inertia & Curl of inertia & $ -\nabla \times \left(\bvec{\omega} \times \bvec{u}\right) $ \\
362362
\tt rot\_Lorentz\_force & Curl of Lorentz force & $ \nabla \times \left(\bvec{J} \times \bvec{B}\right) $ \\
363363
\tt rot\_Coriolis\_force & Curl of Coriolis force & $ -2 \Omega \nabla \times \left(\hat{z} \times \bvec{u} \right) $ \\
364-
\tt rot\_buoyancy & Curl of thermal buoyancy & $ - \nabla \times \left(\alpha_{T} T \bvec{g}\right) $ \\
364+
\tt rot\_thermal\_buoyancy & Curl of thermal buoyancy & $ - \nabla \times \left(\alpha_{T} T \bvec{g}\right) $ \\
365365
\tt rot\_composite\_buoyancy & Curl of compositional buoyancy & $ - \nabla \times \left(\alpha_{C} C\bvec{g}\right) $\\
366+
\tt rot\_buoyancy & Curl of total buoyancy & $ - \nabla \times \left[\left(\alpha_{T} T + \alpha_{C} C \right) \bvec{g}\right] $ \\
367+
\hline
368+
\tt div\_inertia & Divergence of inertia & $ -\nabla \cdot \left(\bvec{\omega} \times \bvec{u}\right) $ \\
369+
\tt div\_Lorentz\_force & Divergence of Lorentz force & $ \nabla \cdot \left(\bvec{J} \times \bvec{B}\right) $ \\
370+
\tt div\_Coriolis\_force & Divergence of Coriolis force & $ -2 \Omega \nabla \cdot \left(\hat{z} \times \bvec{u} \right) $ \\
371+
\tt div\_thermal\_buoyancy & Divergence of thermal buoyancy & $ - \nabla \cdot \left(\alpha_{T} T \bvec{g}\right) $ \\
372+
\tt div\_composite\_buoyancy & Divergence of compositional buoyancy & $ - \nabla \cdot \left(\alpha_{C} C \bvec{g}\right) $\\
373+
\tt div\_buoyancy & Divergence of total buoyancy & $ - \nabla \cdot \left[ \left(\alpha_{T} T + \alpha_{C} C \right) \bvec{g}\right] $ \\
366374
\hline
367375
\tt Lorentz\_work & Work of Lorentz force
368376
& $\bvec{u}\cdot \left( \bvec{J} \times \bvec{B} \right) $ \\
@@ -574,8 +582,9 @@ \subsection{\tt forces\_define}
574582
Label & Field name & Equation \\ \hline
575583
\verb|Coriolis| & Coriolis force & $-2\Omega \hat{z} \times \bvec{u} $ \\
576584
\verb|Lorentz| & Lorentz force & $\bvec{J} \times \bvec{B} $ \\
577-
\verb|gravity| & Thermal buoyancy & $-\alpha_{T} T \bvec{g}$ \\
585+
\verb|Thermal_buoyancy| & Thermal buoyancy & $-\alpha_{T} T \bvec{g}$ \\
578586
\verb|Compositional_buoyancy| & Compositional buoyancy & $-\alpha_{C} C \bvec{g}$\\ \hline
587+
\verb|gravity| & Thermal buoyancy {\color{red} (Deprecated)} & $-\alpha_{T} T \bvec{g}$ \\
579588
\verb|Composite_gravity| & Compositional buoyancy {\color{red} (Deprecated)} & $-\alpha_{C} C \bvec{g}$\\ \hline
580589
\end{tabular}
581590
\end{center}

examples/dynamo_benchmark/dynamobench_case_1/control_snapshot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ begin MHD_control
6464
nod_value_ctl Lorentz_force Viz_On Monitor_On
6565
nod_value_ctl inertia Viz_On Monitor_On
6666
!
67-
nod_value_ctl rot_Coriolis_force Viz_On Monitor_On
68-
nod_value_ctl rot_Lorentz_force Viz_On Monitor_On
69-
nod_value_ctl rot_inertia Viz_On Monitor_On
70-
nod_value_ctl rot_buoyancy Viz_On Monitor_On
67+
nod_value_ctl rot_Coriolis_force Viz_On Monitor_On
68+
nod_value_ctl rot_Lorentz_force Viz_On Monitor_On
69+
nod_value_ctl rot_inertia Viz_On Monitor_On
70+
nod_value_ctl rot_thermal_buoyancy Viz_On Monitor_On
7171
end array nod_value_ctl
7272
end phys_values_ctl
7373
!

examples/dynamo_benchmark/dynamobench_case_2/control_MHD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ begin MHD_control
8989
nod_value_ctl rot_Coriolis_force Viz_On Monitor_Off
9090
nod_value_ctl rot_Lorentz_force Viz_On Monitor_Off
9191
nod_value_ctl rot_inertia Viz_On Monitor_Off
92-
nod_value_ctl rot_buoyancy Viz_On Monitor_Off
92+
nod_value_ctl rot_thermal_buoyancy Viz_On Monitor_Off
9393
end array nod_value_ctl
9494
end phys_values_ctl
9595
!

src/Fortran_libraries/MHD_src/IO/add_sph_MHD_fields_2_ctl.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ subroutine add_field_name_4_sph_mhd &
105105
if(fl_prop%flag_thermal_buoyancy) then
106106
call add_phys_name_ctl(thermal_buoyancy, field_ctl)
107107
call add_phys_name_ctl(rot_thermal_buoyancy, field_ctl)
108-
call add_phys_name_ctl(div_buoyancy, field_ctl)
108+
call add_phys_name_ctl(div_thermal_buoyancy, field_ctl)
109109
end if
110110
! compositional buoyancy flag
111111
if(fl_prop%flag_comp_buoyancy) then

src/Fortran_libraries/SERIAL_src/Fields/check_base_forces.f90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ subroutine add_field_ctl_4_div_forces(field_ctl)
158158
if(check_field_list_ctl(div_Lorentz_force, field_ctl)) &
159159
& call add_phys_name_ctl(Lorentz_force, field_ctl)
160160
!
161-
if(check_field_list_ctl(div_buoyancy, field_ctl)) &
161+
if(check_field_list_ctl(div_thermal_buoyancy, field_ctl)) &
162162
call add_phys_name_ctl(thermal_buoyancy, field_ctl)
163163
if(check_field_list_ctl(div_composite_buoyancy, field_ctl)) &
164164
call add_phys_name_ctl(composite_buoyancy, field_ctl)
165+
if(check_field_list_ctl(div_buoyancy, field_ctl)) &
166+
call add_phys_name_ctl(buoyancy, field_ctl)
165167
!
166168
if(check_field_list_ctl(div_momentum_flux, field_ctl)) &
167169
call add_phys_name_ctl(momentum_flux, field_ctl)

src/Fortran_libraries/SERIAL_src/Fields/m_div_force_labels.f90

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
!! div_inertia [div_forces%i_m_advect]
2222
!! div_Coriolis_force [div_forces%i_Coriolis]
2323
!! div_Lorentz_force [div_forces%i_lorentz]
24-
!! div_buoyancy [div_forces%i_thrm_buo]
24+
!! div_thermal_buoyancy [div_forces%i_thrm_buo]
2525
!! div_composite_buoyancy [div_forces%i_comp_buo]
26+
!! div_buoyancy [div_forces%i_buoyancy]
2627
!!
2728
!! div_momentum_flux [div_forces%i_m_flux]
2829
!! div_maxwell_tensor [div_forces%i_maxwell]
@@ -68,18 +69,25 @@ module m_div_force_labels
6869
& math = '$ \partial_{i}' &
6970
& // '(e_{ijk} J_{j} B_{k})$')
7071
!
71-
!> Field label for divergence of filtered thermal buoyancy
72-
!! @f$ -\partial_{i} \alpha_{T} g_{i} T @f$
73-
type(field_def), parameter :: div_buoyancy &
72+
!> Field label for divergence of thermal buoyancy
73+
!! @f$ -\partial_{i} \alpha_{T} T g_{i} @f$
74+
type(field_def), parameter :: div_thermal_buoyancy &
7475
& = field_def(n_comp = n_scalar, &
75-
& name = 'div_buoyancy', &
76+
& name = 'div_thermal_buoyancy', &
7677
& math = '$-\partial_{i} \alpha_{T} T g_{i}$')
77-
!> Field label for divergence of filtered compositional buoyancy
78-
!! @f$ -\partial_{i} \alpha_{C} g_{i} C @f$
78+
!> Field label for divergence of compositional buoyancy
79+
!! @f$ -\partial_{i} \alpha_{C} C g_{i} @f$
7980
type(field_def), parameter :: div_composite_buoyancy &
8081
& = field_def(n_comp = n_scalar, &
8182
& name = 'div_composite_buoyancy', &
8283
& math = '$-\partial_{i} \alpha_{C} C g_{i}$')
84+
!> Field label for divergence of total buoyancy
85+
!! @f$ -\partial_{i} (\alpha_{T} T + \alpha_{C} C) g_{i} @f$
86+
type(field_def), parameter :: div_buoyancy &
87+
& = field_def(n_comp = n_scalar, &
88+
& name = 'div_buoyancy', &
89+
& math = '$-\partial_{i} (\alpha_{T} T ' &
90+
& // ' \alpha_{C} C) g_{i}$')
8391
!
8492
!> Field label for divergence of momentum flux
8593
!! @f$ \partial_{j} (u_{i} u_{j}) @f$
@@ -143,6 +151,7 @@ logical function check_div_force(field_name)
143151
& .or. (field_name .eq. div_Coriolis_force%name) &
144152
& .or. (field_name .eq. div_Lorentz_force%name) &
145153
& .or. (field_name .eq. div_buoyancy%name) &
154+
& .or. (field_name .eq. div_thermal_buoyancy%name) &
146155
& .or. (field_name .eq. div_composite_buoyancy%name)
147156
!
148157
end function check_div_force
@@ -190,8 +199,9 @@ subroutine set_div_force_names(array_c2i)
190199
call set_field_label_to_ctl(div_inertia, array_c2i)
191200
call set_field_label_to_ctl(div_Coriolis_force, array_c2i)
192201
call set_field_label_to_ctl(div_Lorentz_force, array_c2i)
193-
call set_field_label_to_ctl(div_buoyancy, array_c2i)
202+
call set_field_label_to_ctl(div_thermal_buoyancy, array_c2i)
194203
call set_field_label_to_ctl(div_composite_buoyancy, array_c2i)
204+
call set_field_label_to_ctl(div_buoyancy, array_c2i)
195205
call set_field_label_to_ctl(div_momentum_flux, array_c2i)
196206
call set_field_label_to_ctl(div_maxwell_tensor, array_c2i)
197207
call set_field_label_to_ctl(div_induction_tensor, array_c2i)

src/Fortran_libraries/SERIAL_src/Fields/t_base_force_labels.f90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,12 @@ subroutine set_div_force_addresses &
283283
else if(field_name .eq. div_Lorentz_force%name) then
284284
div_forces%i_lorentz = i_phys
285285
!
286-
else if(field_name .eq. div_buoyancy%name) then
286+
else if(field_name .eq. div_thermal_buoyancy%name) then
287287
div_forces%i_thrm_buo = i_phys
288288
else if(field_name .eq. div_composite_buoyancy%name) then
289289
div_forces%i_comp_buo = i_phys
290+
else if(field_name .eq. div_buoyancy%name) then
291+
div_forces%i_buoyancy = i_phys
290292
!
291293
else if(field_name .eq. div_heat_flux%name) then
292294
div_forces%i_h_flux = i_phys

src/Jupyter/.ipynb_checkpoints/Calypso_control_glossary-checkpoint.ipynb

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@
349349
"cell_type": "markdown",
350350
"id": "7b9e2659-51a3-4f34-a123-3b89605c194d",
351351
"metadata": {
352+
"jp-MarkdownHeadingCollapsed": true,
352353
"tags": []
353354
},
354355
"source": [
@@ -397,7 +398,7 @@
397398
"|`[Label]` | Field name | ` `Math expression` ` |\n",
398399
"|:-|:-|:-|\n",
399400
"|`viscous_diffusion` | Viscous diffusion | $-\\nu \\nabla \\times \\nabla \\times {\\bf u}$ |\n",
400-
"|`inertia` | Inertia term | $ -{\\bf \\omega} \\times {\\bf u} $ |\n",
401+
"|`inertia` | Inertia term | $ {\\bf \\omega} \\times {\\bf u} $ |\n",
401402
"|`thermal_buoyancy` | Thermal buoyancy | $ -\\alpha_{T} T {\\bf g} $ |\n",
402403
"|`composite_buoyancy` | Compositional buoyancy | $ -\\alpha_{C} C{\\bf g} $|\n",
403404
"|`buoyancy` | Total buoyancy | $ -\\left( \\alpha_{T} T + \\alpha_{C} C \\right){\\bf g} $ |\n",
@@ -426,7 +427,7 @@
426427
"tags": []
427428
},
428429
"source": [
429-
"##### List of products of fields and differenciation of forces"
430+
"##### List of differenciation of forces"
430431
]
431432
},
432433
{
@@ -436,12 +437,37 @@
436437
"source": [
437438
"|`[Label]` | Field name | ` `Math expression` ` |\n",
438439
"|:-|:-|:-|\n",
439-
"|`rot_inertia` | Curl of inertia | $- \\nabla \\times \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
440+
"|`rot_inertia` | Curl of inertia | $ \\nabla \\times \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
440441
"|`rot_Lorentz_force` | Curl of Lorentz force | $ \\nabla \\times \\left({\\bf J} \\times {\\bf B}\\right) $|\n",
441442
"|`rot_Coriolis_force` | Curl of Coriolis force | $ -2 \\Omega \\nabla \\times \\left(\\hat{z} \\times {\\bf u} \\right) $|\n",
442443
"|`rot_thermal_buoyancy` | Curl of thermal buoyancy | $ - \\nabla \\times \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
443444
"|`rot_composite_buoyancy` | Curl of compositional buoyancy | $ - \\nabla \\times \\left(\\alpha_{C} C{\\bf g}\\right) $|\n",
444445
"|`rot_buoyancy` | Curl of total buoyancy | $ - \\nabla \\times \\left[\\left(\\alpha_{T} T + \\alpha_{C} C \\right){\\bf g}\\right] $|\n",
446+
"|`div_inertia` | Divergence of inertia | $ \\nabla \\cdot \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
447+
"|`div_Lorentz_force` | Divergence of Lorentz force | $ \\nabla \\cdot \\left({\\bf J} \\times {\\bf B}\\right) $|\n",
448+
"|`div_Coriolis_force` | Divergence of Coriolis force | $ -2 \\Omega \\nabla \\cdot \\left(\\hat{z} \\times {\\bf u} \\right) $|\n",
449+
"|`div_thermal_buoyancy` | Divergence of thermal buoyancy | $ - \\nabla \\cdot \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
450+
"|`div_composite_buoyancy` | Divergence of compositional buoyancy | $ - \\nabla \\cdot \\left(\\alpha_{C} C{\\bf g}\\right) $|\n",
451+
"|`div_buoyancy` | Divergence of total buoyancy | $ - \\nabla \\cdot \\left[\\left(\\alpha_{T} T + \\alpha_{C} C \\right){\\bf g}\\right] $|\n"
452+
]
453+
},
454+
{
455+
"cell_type": "markdown",
456+
"id": "b5c583c0-c2c8-46c8-b95c-f286414cc552",
457+
"metadata": {
458+
"tags": []
459+
},
460+
"source": [
461+
"##### List of products of fields"
462+
]
463+
},
464+
{
465+
"cell_type": "markdown",
466+
"id": "e24a4b5b-0709-42b5-b275-51ba09b1f5e3",
467+
"metadata": {},
468+
"source": [
469+
"|`[Label]` | Field name | ` `Math expression` ` |\n",
470+
"|:-|:-|:-|\n",
445471
"|`Lorentz_work` | Work of Lorentz force | ${\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
446472
"|`work_against_Lorentz` | Work against Lorentz force | $- {\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
447473
"|`buoyancy_flux` | Thermal buoyancy flux | $ -\\alpha_{T} T {\\bf g} \\cdot {\\bf u} $|\n",
@@ -456,11 +482,8 @@
456482
},
457483
{
458484
"cell_type": "markdown",
459-
"id": "b5c583c0-c2c8-46c8-b95c-f286414cc552",
460-
"metadata": {
461-
"jp-MarkdownHeadingCollapsed": true,
462-
"tags": []
463-
},
485+
"id": "1870a03b-95f3-430a-8e7b-26e33809ccda",
486+
"metadata": {},
464487
"source": [
465488
"##### List of fields with equatorial symmetry"
466489
]

src/Jupyter/Calypso_control_glossary.ipynb

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@
349349
"cell_type": "markdown",
350350
"id": "7b9e2659-51a3-4f34-a123-3b89605c194d",
351351
"metadata": {
352+
"jp-MarkdownHeadingCollapsed": true,
352353
"tags": []
353354
},
354355
"source": [
@@ -397,7 +398,7 @@
397398
"|`[Label]` | Field name | ` `Math expression` ` |\n",
398399
"|:-|:-|:-|\n",
399400
"|`viscous_diffusion` | Viscous diffusion | $-\\nu \\nabla \\times \\nabla \\times {\\bf u}$ |\n",
400-
"|`inertia` | Inertia term | $ -{\\bf \\omega} \\times {\\bf u} $ |\n",
401+
"|`inertia` | Inertia term | $ {\\bf \\omega} \\times {\\bf u} $ |\n",
401402
"|`thermal_buoyancy` | Thermal buoyancy | $ -\\alpha_{T} T {\\bf g} $ |\n",
402403
"|`composite_buoyancy` | Compositional buoyancy | $ -\\alpha_{C} C{\\bf g} $|\n",
403404
"|`buoyancy` | Total buoyancy | $ -\\left( \\alpha_{T} T + \\alpha_{C} C \\right){\\bf g} $ |\n",
@@ -426,7 +427,7 @@
426427
"tags": []
427428
},
428429
"source": [
429-
"##### List of products of fields and differenciation of forces"
430+
"##### List of differenciation of forces"
430431
]
431432
},
432433
{
@@ -436,12 +437,37 @@
436437
"source": [
437438
"|`[Label]` | Field name | ` `Math expression` ` |\n",
438439
"|:-|:-|:-|\n",
439-
"|`rot_inertia` | Curl of inertia | $- \\nabla \\times \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
440+
"|`rot_inertia` | Curl of inertia | $ \\nabla \\times \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
440441
"|`rot_Lorentz_force` | Curl of Lorentz force | $ \\nabla \\times \\left({\\bf J} \\times {\\bf B}\\right) $|\n",
441442
"|`rot_Coriolis_force` | Curl of Coriolis force | $ -2 \\Omega \\nabla \\times \\left(\\hat{z} \\times {\\bf u} \\right) $|\n",
442443
"|`rot_thermal_buoyancy` | Curl of thermal buoyancy | $ - \\nabla \\times \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
443444
"|`rot_composite_buoyancy` | Curl of compositional buoyancy | $ - \\nabla \\times \\left(\\alpha_{C} C{\\bf g}\\right) $|\n",
444445
"|`rot_buoyancy` | Curl of total buoyancy | $ - \\nabla \\times \\left[\\left(\\alpha_{T} T + \\alpha_{C} C \\right){\\bf g}\\right] $|\n",
446+
"|`div_inertia` | Divergence of inertia | $ \\nabla \\cdot \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
447+
"|`div_Lorentz_force` | Divergence of Lorentz force | $ \\nabla \\cdot \\left({\\bf J} \\times {\\bf B}\\right) $|\n",
448+
"|`div_Coriolis_force` | Divergence of Coriolis force | $ -2 \\Omega \\nabla \\cdot \\left(\\hat{z} \\times {\\bf u} \\right) $|\n",
449+
"|`div_thermal_buoyancy` | Divergence of thermal buoyancy | $ - \\nabla \\cdot \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
450+
"|`div_composite_buoyancy` | Divergence of compositional buoyancy | $ - \\nabla \\cdot \\left(\\alpha_{C} C{\\bf g}\\right) $|\n",
451+
"|`div_buoyancy` | Divergence of total buoyancy | $ - \\nabla \\cdot \\left[\\left(\\alpha_{T} T + \\alpha_{C} C \\right){\\bf g}\\right] $|\n"
452+
]
453+
},
454+
{
455+
"cell_type": "markdown",
456+
"id": "b5c583c0-c2c8-46c8-b95c-f286414cc552",
457+
"metadata": {
458+
"tags": []
459+
},
460+
"source": [
461+
"##### List of products of fields"
462+
]
463+
},
464+
{
465+
"cell_type": "markdown",
466+
"id": "e24a4b5b-0709-42b5-b275-51ba09b1f5e3",
467+
"metadata": {},
468+
"source": [
469+
"|`[Label]` | Field name | ` `Math expression` ` |\n",
470+
"|:-|:-|:-|\n",
445471
"|`Lorentz_work` | Work of Lorentz force | ${\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
446472
"|`work_against_Lorentz` | Work against Lorentz force | $- {\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
447473
"|`buoyancy_flux` | Thermal buoyancy flux | $ -\\alpha_{T} T {\\bf g} \\cdot {\\bf u} $|\n",
@@ -456,11 +482,8 @@
456482
},
457483
{
458484
"cell_type": "markdown",
459-
"id": "b5c583c0-c2c8-46c8-b95c-f286414cc552",
460-
"metadata": {
461-
"jp-MarkdownHeadingCollapsed": true,
462-
"tags": []
463-
},
485+
"id": "1870a03b-95f3-430a-8e7b-26e33809ccda",
486+
"metadata": {},
464487
"source": [
465488
"##### List of fields with equatorial symmetry"
466489
]

0 commit comments

Comments
 (0)