Skip to content

Commit ff57ff2

Browse files
committed
Add the volumetric heating term
The volumetric heating term is enabled using the boolean l_vol_heat. This term scales with the inverse of r^2 and is meant for the use using buoyancy with the Rayleigh number.
1 parent 857bb4a commit ff57ff2

5 files changed

Lines changed: 18 additions & 11 deletions

File tree

src/Namelists.f90

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ subroutine readNamelists(tscheme)
8585
& strat,polind,DissNb,g0,g1,g2,r_cut_model,thickStrat, &
8686
& epsS,slopeStrat,rStrat,ampStrat, &
8787
& r_LCR,nVarDiff,nVarVisc,difExp,nVarEps,interior_model, &
88-
& nVarEntropyGrad,l_isothermal,ktopp,po,prec_angle, &
89-
& dilution_fac,stef,tmelt,phaseDiffFac,penaltyFac, &
90-
& epsPhase,ktopphi,kbotphi,ampForce
88+
& nVarEntropyGrad,l_isothermal,l_vol_heat,ktopp,po, &
89+
& prec_angle,dilution_fac,stef,tmelt,phaseDiffFac, &
90+
& penaltyFac,epsPhase,ktopphi,kbotphi,ampForce
9191

9292
namelist/B_external/ &
9393
& rrMP,amp_imp,expo_imp,bmax_imp,n_imp,l_imp, &
@@ -990,6 +990,7 @@ subroutine writeNamelists(n_out)
990990

991991
write(n_out,'('' radratio ='',ES14.6,'','')') radratio
992992
write(n_out,'('' l_isothermal ='',l3,'','')') l_isothermal
993+
write(n_out,'('' l_vol_heat ='',l3,'','')') l_vol_heat
993994
write(n_out,'('' phaseDiffFac ='',ES14.6,'','')') phaseDiffFac
994995
write(n_out,'('' epsPhase ='',ES14.6,'','')') epsPhase
995996
write(n_out,'('' penaltyFac ='',ES14.6,'','')') penaltyFac
@@ -1361,6 +1362,7 @@ subroutine defaultNamelists
13611362
l_non_rot =.false. ! No Coriolis force !
13621363
l_anel =.false. ! Anelastic stuff !
13631364
l_isothermal =.false. ! Isothermal = 0 Grünesein !
1365+
l_vol_heat =.false. ! No volemtric heating
13641366
interior_model="None" ! Name of the interior model
13651367

13661368
!---- Run time and number of threads:

src/get_nl.f90

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module grid_space_arrays_mod
3030
use parallel_mod, only: get_openmp_blocks
3131
use constants, only: two, third, one
3232
use logic, only: l_conv_nl, l_heat_nl, l_mag_nl, l_anel, l_mag_LF, l_adv_curl, &
33-
& l_chemical_conv, l_precession, l_centrifuge, l_phase_field, l_ehd_dep, l_ehd_die
33+
& l_chemical_conv, l_precession, l_centrifuge, l_phase_field, l_ehd_dep, l_ehd_die, l_vol_heat
3434

3535
implicit none
3636

@@ -460,6 +460,10 @@ subroutine get_nl(this, time, nR, nBc, lRmsCalc)
460460
this%heatTerms(:,nPhi)= &
461461
& opr * rae/rat * radratio**2/(1.0D0-radratio)**4 * or4(nR)
462462
end if
463+
464+
if ( l_vol_heat ) then
465+
this%heatTerms(:,nPhi)= opr
466+
end if
463467
end do
464468
!$omp end parallel
465469

src/get_td.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module nonlinear_lm_mod
1111
use truncation, only: lm_max, lm_maxMag, m_min
1212
use logic, only : l_anel, l_conv_nl, l_corr, l_heat, l_anelastic_liquid, &
1313
& l_mag_nl, l_mag_kin, l_mag_LF, l_conv, l_mag, &
14-
& l_chemical_conv, l_single_matrix, l_double_curl, l_ehd_die
14+
& l_chemical_conv, l_single_matrix, l_double_curl, l_ehd_die, l_vol_heat
1515
use radial_functions, only: r, or2, or1, beta, epscProf, or4, temp0, orho1, l_R
1616
use physical_parameters, only: CorFac, epsc, n_r_LCR, epscXi
1717
use blocking, only: lm2l, lm2lmA, lm2lmS
@@ -60,7 +60,7 @@ subroutine initialize(this,lmP_max)
6060
allocate( this%VxBrLM(lmP_max), this%VxBtLM(lmP_max), this%VxBpLM(lmP_max))
6161
bytes_allocated = bytes_allocated + 6*lmP_max*SIZEOF_DEF_COMPLEX
6262

63-
if ( l_anel .or. l_ehd_die ) then
63+
if ( l_anel .or. l_ehd_die .or. l_vol_heat ) then
6464
allocate( this%heatTermsLM(lmP_max) )
6565
bytes_allocated = bytes_allocated+lmP_max*SIZEOF_DEF_COMPLEX
6666
end if
@@ -120,7 +120,7 @@ subroutine set_zero(this)
120120
this%VStLM(lm)=zero
121121
this%VSpLM(lm)=zero
122122
end if
123-
if ( l_anel .or. l_ehd_die ) this%heatTermsLM(lm)=zero
123+
if ( l_anel .or. l_ehd_die .or. l_vol_heat ) this%heatTermsLM(lm)=zero
124124
if ( l_chemical_conv ) then
125125
this%VXitLM(lm)=zero
126126
this%VXipLM(lm)=zero
@@ -478,15 +478,15 @@ subroutine get_dsdt(this, nR, nBc, dsdt, dVSrLM)
478478
if ( nBc == 0 ) then
479479

480480
dsdt(1)=epsc*epscProf(nR)!+opr/epsS*divKtemp0(nR)
481-
if ( l_anel .or. l_ehd_die ) then
481+
if ( l_anel .or. l_ehd_die .or. l_vol_heat ) then
482482
if ( l_anelastic_liquid ) then
483483
dsdt(1)=dsdt(1)+temp0(nR)*this%heatTermsLM(1)
484484
else
485485
dsdt(1)=dsdt(1)+this%heatTermsLM(1)
486486
end if
487487
end if
488488

489-
if ( l_anel .or. l_ehd_die ) then
489+
if ( l_anel .or. l_ehd_die .or. l_vol_heat ) then
490490
if ( l_anelastic_liquid ) then
491491
!$omp parallel do
492492
do lm=lm_min,lm_max

src/logic.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ module logic
7474
logical :: lVerbose ! Switch for detailed information about run progress
7575
logical :: l_ehd_dep ! Switch for dilectrophoretic force
7676
logical :: l_ehd_die ! Switch for dielectric heating
77+
logical :: l_vol_heat ! Switch for volumetric heating
7778

7879
logical :: l_PressGraph ! Store pressure in graphic files
7980

src/rIter.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module rIter_mod
2121
& l_precession, l_centrifuge, l_adv_curl, &
2222
& l_double_curl, l_parallel_solve, l_single_matrix,&
2323
& l_temperature_diff, l_RMS, l_phase_field, &
24-
& l_onset, l_DTrMagSpec, l_ehd_dep, l_ehd_die
24+
& l_onset, l_DTrMagSpec, l_ehd_dep, l_ehd_die, l_vol_heat
2525
use radial_data, only: n_r_cmb, n_r_icb, nRstart, nRstop, nRstartMag, &
2626
& nRstopMag
2727
use radial_functions, only: or2, orho1, l_R
@@ -683,7 +683,7 @@ subroutine transform_to_lm_space(this, nR, lRmsCalc, dVSrLM, dVXirLM, dphidt)
683683
call spat_to_qst(this%gsa%VSr, this%gsa%VSt, this%gsa%VSp, &
684684
& dVSrLM, this%nl_lm%VStLM, this%nl_lm%VSpLM, l_R(nR))
685685

686-
if ( l_anel .or. l_ehd_die ) call scal_to_SH(this%gsa%heatTerms, this%nl_lm%heatTermsLM, &
686+
if ( l_anel .or. l_ehd_die .or. l_vol_heat ) call scal_to_SH(this%gsa%heatTerms, this%nl_lm%heatTermsLM, &
687687
& l_R(nR))
688688
end if
689689
if ( l_chemical_conv ) then

0 commit comments

Comments
 (0)