Skip to content

Commit 1160046

Browse files
committed
Merge branch 'revert-928bd1c9' into 'main'
Revert "Crudely add radiative loss" See merge request hepplestone/heatflow-mk2!54
2 parents 0210bf7 + 9df8293 commit 1160046

6 files changed

Lines changed: 19 additions & 26 deletions

File tree

src/constants.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module constants
1313
real(real12), parameter :: hbar = 1.05457148e-34_real12 !Reduced Planck constant
1414
real(real12), parameter :: atomic_mass=1.67262158e-27_real12 !Atomic mass of hydrogen
1515
real(real12), parameter :: avogadros=6.022e23_real12 !Avogadro's number
16-
real(real12), parameter :: StefBoltz=5.670373e-8_real12 !Stefan-Boltzmann constant
16+
1717
real(real12), parameter :: TINY=1.0e-12_real12 !Tiny number to avoid division by zero
1818
integer(int12) , parameter :: fields=6_int12 !Number of fields in the system
1919
end module constants

src/constructions.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module constructions
2727
real(real12) :: volume !volume of the block
2828
real(real12), dimension(3) :: Length !length of the block in 3 dimensions
2929
integer(int12) :: iheater !whether the block is a heater
30-
real(real12) :: kappa, rho, heat_capacity, tau, em !physical properties of the material
30+
real(real12) :: kappa, rho, heat_capacity, tau !physical properties of the material
3131
end type heatblock
3232
!!Defines the material to be used in the simulation
3333
type material
@@ -39,7 +39,6 @@ module constructions
3939
real(real12) :: rho !density of the material
4040
real(real12) :: sound_speed !speed of sound in the material
4141
real(real12) :: tau !relaxation time
42-
real(real12) :: em !emissivity of the material
4342
logical :: source !whether the material is a source of heat ??
4443
end type material
4544
end module constructions

src/heating.f90

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
!!! Author: Harry Mclean, Frank Davies, Steven Hepplestone
1212
!!!#################################################################################################
1313
module Heating
14-
use constants, only: real12, int12, pi, StefBoltz
14+
use constants, only: real12, int12, pi
1515
use globe_data, only: Temp_p, Temp_pp, Heat, heated_volume
16-
use inputs, only: nx,ny,nz, grid, NA, power_in, time_step, T_System, freq, ntime, T_Bath
16+
use inputs, only: nx,ny,nz, grid, NA, power_in, time_step, T_System, freq, ntime
1717
use materials, only: material
1818
implicit none
1919
contains
@@ -35,7 +35,7 @@ subroutine heater(itime, Q, Qdens)
3535
Q = 0._real12
3636
POWER = power_in
3737
time = time_step * real(itime,real12)
38-
time_pulse = 1E-12_real12
38+
time_pulse = 0.5_real12
3939
heated_volume=0.0
4040
heated_num=0
4141

@@ -89,20 +89,20 @@ subroutine heater(itime, Q, Qdens)
8989
!------------------------------
9090
! AC oscillatory heating raw, with power correction
9191
!------------------------------
92-
Q(IA) = POWER * (sin(time * 2.0_real12 * PI * freq)**2.0_real12)
92+
Q(IA) = POWER * (sin(time * 2.0_real12 * PI * freq)**2.0_real12)&
93+
+POWER*2.0_real12*PI*freq*tau*sin(2.0_real12*time*2.0_real12*PI*freq)
9394
!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9495
case(5)
9596
!------------------------------
96-
! AC oscillatory heating raw, with power correction
97+
! Radiative heating
9798
!------------------------------
98-
Q(IA) = POWER * (sin(time * 2.0_real12 * PI * freq)**2.0_real12)&
99-
+POWER*2.0_real12*PI*freq*tau*sin(2.0_real12*time*2.0_real12*PI*freq)
99+
! Q(IA)= e*eps* T**4
100100
!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101101
case(6)
102102
!------------------------------
103-
! Pulsed heating
103+
! Step one heating
104104
!------------------------------
105-
if ((itime .le. time_pulse)) then
105+
if (itime == 1) then
106106
Q(IA) = POWER
107107
else
108108
Q(IA) = 0.0
@@ -111,15 +111,12 @@ subroutine heater(itime, Q, Qdens)
111111
end select
112112

113113
!------------------------------
114-
! If emissitivity is not zero, then calculate the radiative heating
114+
! convert from Q~density to Q
115115
!------------------------------
116-
117-
Q(IA) = Q(IA) - grid(ix,iy,iz)%em * grid(ix,iy,iz)%length(1)*&
118-
grid(ix,iy,iz)%length(2)*StefBoltz &
119-
* ((Temp_p(IA)**4.0_real12) - (T_Bath**4.0_real12))
116+
!Qdens(IA)=Q(IA)
117+
Q(IA)=Q(IA)
120118
!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121119

122-
123120

124121

125122
!------------------------------

src/inputs.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ subroutine read_mat(unit)
525525
type(material), dimension(100) :: dum_mat
526526
character(1024) :: buffer
527527
integer :: reason, j
528-
integer, dimension(8) :: readvarmat
528+
integer, dimension(7) :: readvarmat
529529
integer :: i, index
530530

531531
i=0
@@ -571,7 +571,6 @@ subroutine read_mat(unit)
571571
CALL assignD(buffer,"rho" ,dum_mat(i)%rho ,readvarmat(5))! assign rho
572572
CALL assignD(buffer,"sound_speed" ,dum_mat(i)%sound_speed ,readvarmat(6))! assign sound_speed
573573
CALL assignD(buffer,"tau" ,dum_mat(i)%tau ,readvarmat(7))! assign tau
574-
CALL assignD(buffer,"em" ,dum_mat(i)%em ,readvarmat(8))! assign emissivity
575574
end do read
576575

577576
! Check for duplicate indices

src/material.f90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ module materials
2222

2323
contains
2424

25-
subroutine material(imaterial_type,kappa,kappa3D,h_conv,heat_capacity,rho,sound_speed,tau, em)
25+
subroutine material(imaterial_type,kappa,kappa3D,h_conv,heat_capacity,rho,sound_speed,tau)
2626

2727
integer(int12), intent(in) ::imaterial_type
2828
integer(int12) :: i, tmp
29-
real(real12), intent(inout) :: kappa3D, kappa, h_conv, heat_capacity, sound_speed, rho, tau, em
29+
real(real12), intent(inout) :: kappa3D, kappa, h_conv, heat_capacity, sound_speed, rho, tau
3030
logical :: found
3131

3232
!!!=============================================
@@ -66,7 +66,6 @@ subroutine material(imaterial_type,kappa,kappa3D,h_conv,heat_capacity,rho,sound_
6666
rho = input_materials(i)%rho
6767
sound_speed = input_materials(i)%sound_speed
6868
tau = input_materials(i)%tau
69-
em = input_materials(i)%em
7069

7170
exit mat_loop
7271
end if

src/setup.f90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module setup
3232
!!!#################################################################################################
3333
subroutine set_global_variables()
3434
integer(int12) :: ix,iy,iz,index
35-
real(real12) :: kappa,kappa3D,h_conv,heat_capacity,rho,sound_speed,tau, em
35+
real(real12) :: kappa,kappa3D,h_conv,heat_capacity,rho,sound_speed,tau
3636
allocate(Temp_cur(nx, ny, nz))
3737
allocate(Temp_p(NA))
3838
allocate(Temp_pp(NA))
@@ -51,12 +51,11 @@ subroutine set_global_variables()
5151
do ix = 1, nx
5252
index = index + 1
5353
CALL material(grid(ix,iy,iz)%imaterial_type,&
54-
kappa,kappa3D,h_conv,heat_capacity,rho,sound_speed,tau, em)
54+
kappa,kappa3D,h_conv,heat_capacity,rho,sound_speed,tau)
5555
grid(ix,iy,iz)%kappa = kappa
5656
grid(ix,iy,iz)%rho = rho
5757
grid(ix,iy,iz)%heat_capacity = heat_capacity
5858
grid(ix,iy,iz)%tau = tau*inverse_time*inverse_time
59-
grid(ix,iy,iz)%em = em
6059
lin_rhoc(index) = rho*heat_capacity
6160
if (Check_Stability) CALL stability(kappa, rho, heat_capacity, ix, iy, iz)
6261
end do

0 commit comments

Comments
 (0)