Skip to content

Commit 6db3c42

Browse files
committed
Adding some extra scalar field diagnostics.
These are offset to allow for the future addition of other codes in approximately the order in which they appear for the main fields. The codes for these anticipated outputs are added but commented out and not implemented yet. The docs have also been updated.
1 parent 6790d65 commit 6db3c42

File tree

3 files changed

+243
-13
lines changed

3 files changed

+243
-13
lines changed

doc/source/User_Guide/arbitrary_scalar_fields.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ Active scalar fields
255255
:math:`\frac{\partial\chi_{a_i}}{\partial \phi}` 10010+200*(i-1) longitudinal derivative of active scalar field i
256256
:math:`\frac{\partial\chi_{a_i}^\prime}{\partial \phi}` 10011+200*(i-1) longitudinal derivative of the active scalar field i perturbation
257257
:math:`\frac{\partial\overline{\chi_{a_i}}}{\partial \phi}` 10012+200*(i-1) longitudinal derivative of the active scalar field i mean
258+
:math:`d_{7_i}\mathrm{g}_{7_i}\chi` 10071+200*(i-1) chi\_buoyancy\_force for active scalar field i
259+
:math:`d_{7_i}\mathrm{g}_{7_i}\chi'` 10072+200*(i-1) chi\_buoyancy\_pforce for active scalar field i perturbation
260+
:math:`d_{7_i}\mathrm{g}_{7_i}\overline{\chi}` 10073+200*(i-1) chi\_buoyancy\_mforce for active scalar field i mean
261+
:math:`d_{7_i}\mathrm{g}_{7_i}\chi_{00}` 10074+200*(i-1) chi\_buoyancy\_force\_ell0 for active scalar field i l0
262+
:math:`d_{7_i}v_r\mathrm{g}_{7_i}\chi` 10171+200*(i-1) buoy\_work for active scalar field i
263+
:math:`d_{7_i}v'_r\mathrm{g}_{7_i}\chi'` 10072+200*(i-1) buoy\_work\_pp for active scalar field i perturbation
264+
:math:`d_{7_i}\overline{v_r}\mathrm{g}_{7_i}\overline{\chi}` 10073+200*(i-1) buoy\_work\_mm for active scalar field i mean
265+
:math:`d_{7_i}\mathrm{g}_{7_i}{\chi^\prime}{v^\prime}_r` 10181+200*(i-1) chi\_production\_buoyant\_pKE for active scalar field i
258266
=============================================================== =================== ================================================================
259267

260268
Passive scalar fields

src/Diagnostics/Diagnostics_Scalars.F90

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,75 @@ Subroutine Compute_Scalars(buffer)
139139
END_DO
140140
Call Add_Quantity(qty)
141141
Endif
142+
143+
! only valid for active scalars
144+
if (ii .le. n_active_scalars) then
145+
! NOTE: The ell=0 component of the r-momentum equation is entirely described by
146+
! hydrostatic balance between the pressure and entropy and composition perturbations
147+
! (the reference state is assumed to also be in hydrostatic balance).
148+
! As such, the ell=0 buoancy force is uninteresting from the point of
149+
! view of the flow. We explicitly separate the ell=0 component for this
150+
! term (as with the entropy and pressure terms).
151+
! -- full buoyancy
152+
If (compute_quantity(chi_buoyancy_force+scoff) .or. compute_quantity(chi_buoy_work+scoff)) Then
153+
DO_PSI
154+
qty(PSI) = ref%chi_buoyancy_coeff(ii,r)*(buffer(PSI,chivar)-&
155+
& ell0_values(r,chivar))
156+
END_DO
157+
If (compute_quantity(chi_buoyancy_force+scoff))Call Add_Quantity(qty)
158+
If (compute_quantity(chi_buoy_work+scoff)) Then
159+
DO_PSI
160+
qty(PSI)=buffer(PSI,vr)*qty(PSI)
161+
END_DO
162+
Call Add_Quantity(qty)
163+
Endif
164+
Endif
165+
166+
! -- fluctuating buoyancy (ell = 0, m =0 already subtracted)
167+
If (compute_quantity(chi_buoyancy_pforce+scoff) .or. compute_quantity(chi_buoy_work_pp+scoff)) Then
168+
DO_PSI
169+
qty(PSI) = ref%chi_buoyancy_coeff(ii,r)*fbuffer(PSI,chivar)
170+
END_DO
171+
If (compute_quantity(chi_buoyancy_pforce+scoff)) Call Add_Quantity(qty)
172+
If (compute_quantity(chi_buoy_work_pp+scoff)) Then
173+
DO_PSI
174+
qty(PSI)=buffer(PSI,vr)*qty(PSI)
175+
END_DO
176+
Call Add_Quantity(qty)
177+
Endif
178+
Endif
179+
180+
! -- mean buoyancy
181+
If (compute_quantity(chi_buoyancy_mforce+scoff) .or. compute_quantity(chi_buoy_work_mm+scoff)) Then
182+
DO_PSI
183+
qty(PSI) = ref%chi_buoyancy_coeff(ii,r)*(m0_values(PSI2,chivar)-&
184+
& ell0_values(r,chivar))
185+
END_DO
186+
If (compute_quantity(chi_buoyancy_mforce+scoff)) Call Add_Quantity(qty)
187+
If (compute_quantity(chi_buoy_work_mm+scoff)) Then
188+
DO_PSI
189+
qty(PSI)=buffer(PSI,vr)*qty(PSI)
190+
END_DO
191+
Call Add_Quantity(qty)
192+
Endif
193+
Endif
194+
195+
If (compute_quantity(chi_buoyancy_force_ell0+scoff)) Then
196+
DO_PSI
197+
qty(PSI) = ref%chi_buoyancy_coeff(ii,r)*ell0_values(r,chivar)
198+
END_DO
199+
Call Add_Quantity(qty)
200+
Endif
201+
202+
! Chi Buoyant Production of turbulent kinetic energy.
203+
If (compute_quantity(chi_production_buoyant_pKE+scoff)) Then
204+
DO_PSI
205+
qty(PSI) = ref%chi_buoyancy_coeff(ii,r)*fbuffer(PSI,chivar)*fbuffer(PSI,vr)
206+
END_DO
207+
Call Add_Quantity(qty)
208+
Endif
209+
endif
210+
142211
Enddo
143212
End Subroutine Compute_Scalars
144213

0 commit comments

Comments
 (0)