67 CHARACTER(LEN=32),
PARAMETER ::
source_name =
"cooling of planetary atmosphere"
71 :: t_s, & !< temperature at the surface
72 rho_s, & !< density at the surface
80 REAL :: const1, const2
105 TYPE(
dict_typ),
POINTER :: config,IO
108 REAL :: effradflux, q
110 CALL getattr(config,
"stype", stype)
113 CALL this%Info(
"############################ ATTENTION ############################")
114 CALL this%Warning(
"sources_planetcooling::InitSources",
"Untested module, use with care!")
117 SELECT TYPE (phys => physics)
121 CALL this%Error(
"sources_planetheating::InitSources",
"physics not supported")
124 SELECT TYPE (const => physics%constants)
128 CALL this%Error(
"sources_planetheating::InitSources",
"only SI units supported")
131 ALLOCATE(this%Q,this%T_s)
136 CALL getattr(config,
"cvis", this%cvis, 0.9)
139 CALL getattr(config,
"radflux", this%radflux)
141 CALL getattr(config,
"albedo", this%albedo,0.0)
143 CALL getattr(config,
"mean_distance", this%distance,physics%constants%AU)
145 CALL getattr(config,
"T_0", this%T_0)
147 CALL getattr(config,
"gacc", this%gacc)
152 this%Q%data1d(:) = 0.0
153 this%T_s%data1d(:) = this%T_0
156 SELECT TYPE(phys => physics)
159 effradflux = (1.-this%albedo)*this%radflux*(phys%constants%AU/this%distance)**2
162 q = phys%gamma/(phys%gamma-1.0)
163 this%tau_inf= ((4*phys%Constants%SB*gamma(1.+4./q)/effradflux)**(0.25) * this%T_0)**q
165 this%const1 = phys%mu/(phys%gamma*phys%Constants%RG)
166 this%const2 = phys%Constants%SB*this%tau_inf**(-4./q) * gamma(1.0+4./q)
170 CALL this%SetOutput(mesh,config,io)
173 CALL this%InfoSources(mesh)
183 CHARACTER(LEN=32) :: param_str
185 WRITE (param_str,
'(ES10.2)') this%radflux
186 CALL this%Info(
" mean stellar flux: " // trim(param_str) //
" W/m^2")
187 WRITE (param_str,
'(ES10.2)') this%T_0
188 CALL this%Info(
" mean equil. temp.: " // trim(param_str) //
" K")
189 WRITE (param_str,
'(ES10.2)') this%tau_inf
190 CALL this%Info(
" optical depth: " // trim(param_str))
225 REAL,
INTENT(IN) :: time
230 REAL :: const1,const2
233 IF (time.NE.this%time)
THEN
236 this%T_s%data1d(:) = this%const1 * pvar%pressure%data1d(:)/pvar%density%data1d(:)
240 IF (
ALLOCATED(this%P_s)) this%P_s%data1d(:) = pvar%density%data1d(:)*this%gacc
241 IF (
ALLOCATED(this%rho_s)) this%rho_s%data1d(:) = physics%mu/(physics%Constants%RG) &
242 *this%P_s%data1d(:)/this%T_s%data1d(:)
245 WHERE (mesh%without_ghost_zones%mask1d(:))
246 this%Q%data1d(:) = this%const2*this%T_s%data1d(:)**4
248 this%Q%data1d(:) = 0.0
277 CALL getattr(config,
"output/Qcool", valwrite, 0)
278 IF (valwrite .EQ. 1) &
279 CALL setattr(io,
"Qcool", &
280 this%Q%data3d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX))
283 CALL getattr(config,
"output/T_s", valwrite, 0)
284 IF (valwrite .EQ. 1) &
285 CALL setattr(io,
"T_s", &
286 this%T_s%data3d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX))
289 CALL getattr(config,
"output/P_s", valwrite, 0)
290 IF (valwrite .EQ. 1)
THEN
293 this%P_s%data1d(:) = 0.0
294 CALL setattr(io,
"P_s", &
295 this%P_s%data3d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX))
299 CALL getattr(config,
"output/rho_s", valwrite, 0)
300 IF (valwrite .EQ. 1)
THEN
303 this%rho_s%data1d(:) = 0.0
304 CALL setattr(io,
"rho_s", &
305 this%rho_s%data3d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX))
317 IF (
ALLOCATED(this%P_s))
DEALLOCATE(this%P_s)
318 IF (
ALLOCATED(this%rho_s))
DEALLOCATE(this%rho_s)
Dictionary for generic data types.
module for SI units and physical constants
base module for numerical flux functions
elemental real function, public lngamma(x)
computes the logarithm of the gammafunction with Lanczos approximation found in Numerical Recipes for...
subroutine finalize(this)
Destructor of logging_base class.
base class for mesh arrays
derived class for compound of mesh arrays
subroutine setoutput(this, config, IO)
Setup mesh fields for i/o.
physics module for 1D,2D and 3D non-isothermal Euler equations
generic source terms module providing functionaly common to all source terms
source terms module for simple optically thin cooling
subroutine initsources(this, Mesh, Physics, Fluxes, config, IO)
subroutine updatecooling(this, Mesh, Physics, time, pvar)
Updates the cooling function at each time step.
character(len=32), parameter source_name
gray cooling of planetary atmospheres
subroutine infosources(this, Mesh)