Skip to content

Commit d453f63

Browse files
committed
Add rotation of total buoyancy flag
1 parent b19a7be commit d453f63

File tree

7 files changed

+71
-52
lines changed

7 files changed

+71
-52
lines changed

src/Fortran_libraries/MHD_src/IO/add_sph_MHD_fields_2_ctl.f90

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ subroutine add_field_name_4_sph_mhd &
104104
! thermal buoyancy flag
105105
if(fl_prop%flag_thermal_buoyancy) then
106106
call add_phys_name_ctl(thermal_buoyancy, field_ctl)
107-
call add_phys_name_ctl(rot_buoyancy, field_ctl)
107+
call add_phys_name_ctl(rot_thermal_buoyancy, field_ctl)
108108
call add_phys_name_ctl(div_buoyancy, field_ctl)
109109
end if
110110
! compositional buoyancy flag
@@ -113,11 +113,6 @@ subroutine add_field_name_4_sph_mhd &
113113
call add_phys_name_ctl(div_composite_buoyancy, field_ctl)
114114
call add_phys_name_ctl(rot_composite_buoyancy, field_ctl)
115115
end if
116-
! total buoyancy flag
117-
if(fl_prop%flag_thermal_buoyancy &
118-
& .or. fl_prop%flag_comp_buoyancy) then
119-
call add_phys_name_ctl(buoyancy, field_ctl)
120-
end if
121116
end if
122117
!
123118
! induction flag

src/Fortran_libraries/SERIAL_src/Fields/check_base_forces.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ subroutine add_field_ctl_4_rot_forces(field_ctl)
131131
& call add_phys_name_ctl(Lorentz_force, field_ctl)
132132
!
133133
if(check_field_list_ctl(rot_buoyancy, field_ctl)) &
134+
& call add_phys_name_ctl(buoyancy, field_ctl)
135+
if(check_field_list_ctl(rot_thermal_buoyancy, field_ctl)) &
134136
& call add_phys_name_ctl(thermal_buoyancy, field_ctl)
135137
if(check_field_list_ctl(rot_composite_buoyancy, field_ctl)) &
136138
& call add_phys_name_ctl(composite_buoyancy, field_ctl)

src/Fortran_libraries/SERIAL_src/Fields/m_rot_force_labels.f90

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
!! rot_inertia [rot_forces%i_m_advect]
1919
!! rot_Coriolis_force [rot_forces%i_Coriolis]
2020
!! rot_Lorentz_force [rot_forces%i_lorentz]
21-
!! rot_buoyancy [rot_forces%i_thrm_buo]
21+
!! rot_thermal_buoyancy [rot_forces%i_thrm_buo]
2222
!! rot_composite_buoyancy [rot_forces%i_comp_buo]
23+
!! rot_buoyancy [rot_forces%i_buoyancy]
2324
!!
2425
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2526
!!@endverbatim
@@ -55,20 +56,27 @@ module m_rot_force_labels
5556
& math = '$ e_{ijk} \partial_{j}' &
5657
& // '\left(e_{kkm} J_{l} B_{m} \right) $')
5758
!
58-
!> Field label for curl of filtered thermal buoyancy
59+
!> Field label for curl of thermal buoyancy
5960
!! @f$ -e_{ijk} \partial_{j} \alpha_{T} T g_{k} @f$
60-
type(field_def), parameter :: rot_buoyancy &
61+
type(field_def), parameter :: rot_thermal_buoyancy &
6162
& = field_def(n_comp = n_vector, &
62-
& name = 'rot_buoyancy', &
63+
& name = 'rot_thermal_buoyancy', &
6364
& math = '$-e_{ijk} \partial_{j} \alpha_{T}' &
6465
& // ' T g_{k}$')
65-
!> Field label for curl of filtered compositional buoyancy
66+
!> Field label for curl of compositional buoyancy
6667
!! @f$ -e_{ijk} \partial_{j} \alpha_{C} C g_{k} @f$
6768
type(field_def), parameter :: rot_composite_buoyancy &
6869
& = field_def(n_comp = n_vector, &
6970
& name = 'rot_composite_buoyancy', &
7071
& math = '$-e_{ijk} \partial_{j} \alpha_{C}' &
7172
& // ' C g_{k}$')
73+
!> Field label for curl of total buoyancy
74+
!! @f$ -e_{ijk} \partial_{j} (\alpha_{T} T+\alpha_{C} C) g_{k} @f$
75+
type(field_def), parameter :: rot_buoyancy &
76+
& = field_def(n_comp = n_vector, &
77+
& name = 'rot_buoyancy', &
78+
& math = '$-e_{ijk} \partial_{j} (\alpha_{T} T ' &
79+
& // ' + \alpha_{C} C) g_{k}$')
7280
!
7381
! ----------------------------------------------------------------------
7482
!
@@ -86,6 +94,7 @@ logical function check_rot_force(field_name)
8694
& .or. (field_name .eq. rot_Coriolis_force%name) &
8795
& .or. (field_name .eq. rot_Lorentz_force%name) &
8896
& .or. (field_name .eq. rot_buoyancy%name) &
97+
& .or. (field_name .eq. rot_thermal_buoyancy%name) &
8998
& .or. (field_name .eq. rot_composite_buoyancy%name)
9099
!
91100
end function check_rot_force
@@ -105,6 +114,7 @@ subroutine set_rot_force_names(array_c2i)
105114
call set_field_label_to_ctl(rot_Coriolis_force, array_c2i)
106115
call set_field_label_to_ctl(rot_Lorentz_force, array_c2i)
107116
call set_field_label_to_ctl(rot_buoyancy, array_c2i)
117+
call set_field_label_to_ctl(rot_thermal_buoyancy, array_c2i)
108118
call set_field_label_to_ctl(rot_composite_buoyancy, array_c2i)
109119
!
110120
end subroutine set_rot_force_names

src/Fortran_libraries/SERIAL_src/Fields/t_base_force_labels.f90

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -167,53 +167,55 @@ subroutine set_base_force_addresses &
167167
& .or. check_flux_tensors(field_name) &
168168
& .or. check_asym_flux_tensors(field_name)
169169
if(flag) then
170-
if (field_name .eq. pressure_gradient%name) then
170+
if (field_name .eq. pressure_gradient%name) then
171171
forces%i_press_grad = i_phys
172-
else if (field_name .eq. inertia%name) then
172+
else if(field_name .eq. inertia%name) then
173173
forces%i_m_advect = i_phys
174-
else if (field_name .eq. Coriolis_force%name) then
174+
else if(field_name .eq. Coriolis_force%name) then
175175
forces%i_coriolis = i_phys
176-
else if (field_name .eq. Lorentz_force%name) then
176+
else if(field_name .eq. Lorentz_force%name) then
177177
forces%i_lorentz = i_phys
178-
else if (field_name .eq. magnetic_tension%name) then
178+
else if(field_name .eq. magnetic_tension%name) then
179179
forces%i_m_tension = i_phys
180180
!
181-
else if (field_name .eq. thermal_buoyancy%name) then
181+
else if(field_name .eq. thermal_buoyancy%name) then
182182
forces%i_thrm_buo = i_phys
183-
else if (field_name .eq. composite_buoyancy%name) then
183+
else if(field_name .eq. composite_buoyancy%name) then
184184
forces%i_comp_buo = i_phys
185+
else if(field_name .eq. buoyancy%name) then
186+
forces%i_buoyancy = i_phys
185187
!
186-
else if (field_name .eq. vecp_induction%name) then
188+
else if(field_name .eq. vecp_induction%name) then
187189
forces%i_vp_induct = i_phys
188-
else if (field_name .eq. magnetic_induction%name) then
190+
else if(field_name .eq. magnetic_induction%name) then
189191
forces%i_induction = i_phys
190-
else if (field_name .eq. magnetic_stretch%name) then
192+
else if(field_name .eq. magnetic_stretch%name) then
191193
forces%i_mag_stretch = i_phys
192194
!
193-
else if (field_name .eq. heat_advect%name) then
195+
else if(field_name .eq. heat_advect%name) then
194196
forces%i_h_advect = i_phys
195-
else if (field_name .eq. pert_heat_advect%name) then
197+
else if(field_name .eq. pert_heat_advect%name) then
196198
forces%i_ph_advect = i_phys
197199
!
198-
else if (field_name .eq. composition_advect%name) then
200+
else if(field_name .eq. composition_advect%name) then
199201
forces%i_c_advect = i_phys
200-
else if (field_name .eq. pert_comp_advect%name) then
202+
else if(field_name .eq. pert_comp_advect%name) then
201203
forces%i_pc_advect = i_phys
202204
!
203-
else if (field_name .eq. momentum_flux%name ) then
205+
else if(field_name .eq. momentum_flux%name) then
204206
forces%i_m_flux = i_phys
205-
else if (field_name .eq. maxwell_tensor%name ) then
207+
else if(field_name .eq. maxwell_tensor%name) then
206208
forces%i_maxwell = i_phys
207-
else if (field_name .eq. induction_tensor%name ) then
209+
else if(field_name .eq. induction_tensor%name) then
208210
forces%i_induct_t = i_phys
209211
!
210-
else if (field_name .eq. heat_flux%name) then
212+
else if(field_name .eq. heat_flux%name) then
211213
forces%i_h_flux = i_phys
212-
else if (field_name .eq. pert_heat_flux%name) then
214+
else if(field_name .eq. pert_heat_flux%name) then
213215
forces%i_ph_flux = i_phys
214-
else if (field_name .eq. composite_flux%name) then
216+
else if(field_name .eq. composite_flux%name) then
215217
forces%i_c_flux = i_phys
216-
else if (field_name .eq. pert_comp_flux%name) then
218+
else if(field_name .eq. pert_comp_flux%name) then
217219
forces%i_pc_flux = i_phys
218220
end if
219221
end if
@@ -237,17 +239,19 @@ subroutine set_rot_force_addresses &
237239
!
238240
flag = check_rot_force(field_name)
239241
if(flag) then
240-
if (field_name .eq. rot_inertia%name) then
242+
if (field_name .eq. rot_inertia%name) then
241243
rot_forces%i_m_advect = i_phys
242-
else if (field_name .eq. rot_Coriolis_force%name) then
244+
else if(field_name .eq. rot_Coriolis_force%name) then
243245
rot_forces%i_Coriolis = i_phys
244-
else if (field_name .eq. rot_Lorentz_force%name) then
246+
else if(field_name .eq. rot_Lorentz_force%name) then
245247
rot_forces%i_lorentz = i_phys
246248
!
247-
else if (field_name .eq. rot_buoyancy%name) then
249+
else if(field_name .eq. rot_thermal_buoyancy%name) then
248250
rot_forces%i_thrm_buo = i_phys
249-
else if (field_name .eq. rot_composite_buoyancy%name) then
251+
else if(field_name .eq. rot_composite_buoyancy%name) then
250252
rot_forces%i_comp_buo = i_phys
253+
else if(field_name .eq. rot_buoyancy%name) then
254+
rot_forces%i_buoyancy = i_phys
251255
end if
252256
end if
253257
!
@@ -272,33 +276,33 @@ subroutine set_div_force_addresses &
272276
& .or. check_div_flux_tensor(field_name) &
273277
& .or. check_div_scalar_flux(field_name)
274278
if(flag) then
275-
if (field_name .eq. div_inertia%name) then
279+
if (field_name .eq. div_inertia%name) then
276280
div_forces%i_m_advect = i_phys
277-
else if (field_name .eq. div_Coriolis_force%name) then
281+
else if(field_name .eq. div_Coriolis_force%name) then
278282
div_forces%i_Coriolis = i_phys
279-
else if (field_name .eq. div_Lorentz_force%name) then
283+
else if(field_name .eq. div_Lorentz_force%name) then
280284
div_forces%i_lorentz = i_phys
281285
!
282-
else if (field_name .eq. div_buoyancy%name) then
286+
else if(field_name .eq. div_buoyancy%name) then
283287
div_forces%i_thrm_buo = i_phys
284-
else if (field_name .eq. div_composite_buoyancy%name) then
288+
else if(field_name .eq. div_composite_buoyancy%name) then
285289
div_forces%i_comp_buo = i_phys
286290
!
287-
else if (field_name .eq. div_heat_flux%name) then
291+
else if(field_name .eq. div_heat_flux%name) then
288292
div_forces%i_h_flux = i_phys
289-
else if (field_name .eq. div_pert_heat_flux%name) then
293+
else if(field_name .eq. div_pert_heat_flux%name) then
290294
div_forces%i_ph_flux = i_phys
291295
!
292-
else if (field_name .eq. div_composition_flux%name) then
296+
else if(field_name .eq. div_composition_flux%name) then
293297
div_forces%i_c_flux = i_phys
294-
else if (field_name .eq. div_pert_composition_flux%name) then
298+
else if(field_name .eq. div_pert_composition_flux%name) then
295299
div_forces%i_pc_flux = i_phys
296300
!
297-
else if (field_name .eq. div_momentum_flux%name) then
301+
else if(field_name .eq. div_momentum_flux%name) then
298302
div_forces%i_m_flux = i_phys
299-
else if (field_name .eq. div_maxwell_tensor%name) then
303+
else if(field_name .eq. div_maxwell_tensor%name) then
300304
div_forces%i_maxwell = i_phys
301-
else if (field_name .eq. div_induction_tensor%name) then
305+
else if(field_name .eq. div_induction_tensor%name) then
302306
div_forces%i_induct_t = i_phys
303307
end if
304308
end if

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,9 @@
439439
"|`rot_inertia` | Curl of inertia | $- \\nabla \\times \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
440440
"|`rot_Lorentz_force` | Curl of Lorentz force | $ \\nabla \\times \\left({\\bf J} \\times {\\bf B}\\right) $|\n",
441441
"|`rot_Coriolis_force` | Curl of Coriolis force | $ -2 \\Omega \\nabla \\times \\left(\\hat{z} \\times {\\bf u} \\right) $|\n",
442-
"|`rot_buoyancy` | Curl of thermal buoyancy | $ - \\nabla \\times \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
442+
"|`rot_thermal_buoyancy` | Curl of thermal buoyancy | $ - \\nabla \\times \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
443443
"|`rot_composite_buoyancy` | Curl of compositional buoyancy | $ - \\nabla \\times \\left(\\alpha_{C} C{\\bf g}\\right) $|\n",
444+
"|`rot_buoyancy` | Curl of total buoyancy | $ - \\nabla \\times \\left[\\left(\\alpha_{T} T + \\alpha_{C} C \\right){\\bf g}\\right] $|\n",
444445
"|`Lorentz_work` | Work of Lorentz force | ${\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
445446
"|`work_against_Lorentz` | Work against Lorentz force | $- {\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
446447
"|`buoyancy_flux` | Thermal buoyancy flux | $ -\\alpha_{T} T {\\bf g} \\cdot {\\bf u} $|\n",
@@ -457,6 +458,7 @@
457458
"cell_type": "markdown",
458459
"id": "b5c583c0-c2c8-46c8-b95c-f286414cc552",
459460
"metadata": {
461+
"jp-MarkdownHeadingCollapsed": true,
460462
"tags": []
461463
},
462464
"source": [
@@ -492,6 +494,7 @@
492494
"cell_type": "markdown",
493495
"id": "bdc523c8-2a11-424d-83cf-24d41470e983",
494496
"metadata": {
497+
"jp-MarkdownHeadingCollapsed": true,
495498
"tags": []
496499
},
497500
"source": [
@@ -529,6 +532,7 @@
529532
"cell_type": "markdown",
530533
"id": "5451dc1f-4045-45d1-910e-042d251e5a19",
531534
"metadata": {
535+
"jp-MarkdownHeadingCollapsed": true,
532536
"tags": []
533537
},
534538
"source": [

src/Jupyter/Calypso_control_glossary.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,9 @@
439439
"|`rot_inertia` | Curl of inertia | $- \\nabla \\times \\left({\\bf \\omega} \\times {\\bf u}\\right) $|\n",
440440
"|`rot_Lorentz_force` | Curl of Lorentz force | $ \\nabla \\times \\left({\\bf J} \\times {\\bf B}\\right) $|\n",
441441
"|`rot_Coriolis_force` | Curl of Coriolis force | $ -2 \\Omega \\nabla \\times \\left(\\hat{z} \\times {\\bf u} \\right) $|\n",
442-
"|`rot_buoyancy` | Curl of thermal buoyancy | $ - \\nabla \\times \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
442+
"|`rot_thermal_buoyancy` | Curl of thermal buoyancy | $ - \\nabla \\times \\left(\\alpha_{T} T {\\bf g}\\right) $|\n",
443443
"|`rot_composite_buoyancy` | Curl of compositional buoyancy | $ - \\nabla \\times \\left(\\alpha_{C} C{\\bf g}\\right) $|\n",
444+
"|`rot_buoyancy` | Curl of total buoyancy | $ - \\nabla \\times \\left[\\left(\\alpha_{T} T + \\alpha_{C} C \\right){\\bf g}\\right] $|\n",
444445
"|`Lorentz_work` | Work of Lorentz force | ${\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
445446
"|`work_against_Lorentz` | Work against Lorentz force | $- {\\bf u}\\cdot \\left( {\\bf J} \\times {\\bf B} \\right) $| \n",
446447
"|`buoyancy_flux` | Thermal buoyancy flux | $ -\\alpha_{T} T {\\bf g} \\cdot {\\bf u} $|\n",
@@ -457,6 +458,7 @@
457458
"cell_type": "markdown",
458459
"id": "b5c583c0-c2c8-46c8-b95c-f286414cc552",
459460
"metadata": {
461+
"jp-MarkdownHeadingCollapsed": true,
460462
"tags": []
461463
},
462464
"source": [
@@ -492,6 +494,7 @@
492494
"cell_type": "markdown",
493495
"id": "bdc523c8-2a11-424d-83cf-24d41470e983",
494496
"metadata": {
497+
"jp-MarkdownHeadingCollapsed": true,
495498
"tags": []
496499
},
497500
"source": [
@@ -529,6 +532,7 @@
529532
"cell_type": "markdown",
530533
"id": "5451dc1f-4045-45d1-910e-042d251e5a19",
531534
"metadata": {
535+
"jp-MarkdownHeadingCollapsed": true,
532536
"tags": []
533537
},
534538
"source": [

tests/Dynamo_Benchmark/Dynamobench_Case2_cont/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
!

0 commit comments

Comments
 (0)