51 CHARACTER(LEN=32),
PARAMETER ::
source_name =
"inertial forces" 77 CLASS(sources_rotframe) :: this
78 CLASS(mesh_base),
INTENT(IN) :: Mesh
79 CLASS(physics_base),
INTENT(IN) :: Physics
80 CLASS(fluxes_base),
INTENT(IN) :: Fluxes
81 TYPE(Dict_TYP),
POINTER :: config, IO
85 CALL getattr(config,
"stype", stype)
87 CALL this%InitSources(mesh,fluxes,physics,config,io)
95 CALL this%Error(
"sources_rotframe::InitSources",
"physics not supported")
98 IF (mesh%FARGO.GT.0) &
99 CALL this%Error(
"sources_rotframe::InitSources", &
100 "rotating frame with FARGO seems broken, don't use it together")
102 IF (physics%VDIM.NE.2) &
103 CALL this%Error(
"sources_rotframe::InitSources", &
104 "Only 2D simulations working with rotating frame at the moment." )
107 this%accel%data1d(:) = 0.
109 this%cent%data1d(:) = 0.
111 this%centproj%data1d(:) = 0.
113 this%cos1%data1d(:) = 0.
115 CALL getattr(config,
"gparam", this%gparam, 1.0)
128 IF (abs(mesh%rotcent(1)).LE.tiny(mesh%rotcent(1)) &
129 .AND.abs(mesh%rotcent(2)).LE.tiny(mesh%rotcent(2)))
THEN 131 this%cent%data4d(:,:,:,:) = mesh%posvec%bcenter(:,:,:,:)
135 this%cent%data4d(:,:,:,1) = mesh%rotcent(1)
136 this%cent%data4d(:,:,:,2) = mesh%rotcent(2)
137 this%cent%data4d(:,:,:,3) = mesh%rotcent(3)
138 CALL mesh%Geometry%Convert2Curvilinear(mesh%bcenter,this%cent%data4d,this%cent%data4d)
142 this%cent%data4d(:,:,:,:) = mesh%posvec%bcenter(:,:,:,:) - this%cent%data4d(:,:,:,:)
151 CLASS(sources_rotframe),
INTENT(IN) :: this
152 CLASS(mesh_base),
INTENT(IN) :: Mesh
154 CHARACTER(LEN=32) :: omega_str
156 WRITE (omega_str,
'(ES8.2)') mesh%OMEGA
157 CALL this%Info(
" angular velocity: " // trim(omega_str))
164 CLASS(sources_rotframe),
INTENT(INOUT) :: this
165 CLASS(mesh_base),
INTENT(IN) :: Mesh
166 CLASS(physics_base),
INTENT(INOUT) :: Physics
167 CLASS(fluxes_base),
INTENT(IN) :: Fluxes
168 CLASS(sources_base),
INTENT(INOUT) :: Sources
169 REAL,
INTENT(IN) :: time, dt
170 CLASS(marray_compound),
INTENT(INOUT) :: pvar,cvar,sterm
193 DO k=mesh%KMIN,mesh%KMAX
194 DO j=mesh%JMIN,mesh%JMAX
196 DO i=mesh%IMIN,mesh%IMAX
198 this%accel%data4d(i,j,k,1) = mesh%OMEGA*(mesh%OMEGA*this%cent%data4d(i,j,k,1) &
199 + 2.0*pvar%data4d(i,j,k,physics%YVELOCITY))
200 this%accel%data4d(i,j,k,2) = mesh%OMEGA*(mesh%OMEGA*this%cent%data4d(i,j,k,2) &
201 - 2.0*pvar%data4d(i,j,k,physics%XVELOCITY))
208 CALL physics%ExternalSources(this%accel,pvar,cvar,sterm)
214 CLASS(sources_rotframe),
INTENT(IN) :: this
215 CLASS(mesh_base),
INTENT(IN) :: Mesh
216 CLASS(physics_base),
INTENT(IN) :: Physics
217 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX,Physics%VNUM), &
218 INTENT(INOUT) :: pvar
226 pvar(:,:,:,physics%XVELOCITY) = pvar(:,:,:,physics%XVELOCITY) + &
227 mesh%OMEGA * this%cent%data4d(:,:,:,2)
228 pvar(:,:,:,physics%YVELOCITY) = pvar(:,:,:,physics%YVELOCITY) - &
229 mesh%OMEGA * this%cent%data4d(:,:,:,1)
236 CLASS(sources_rotframe),
INTENT(INOUT) :: this
238 CALL this%accel%Destroy()
239 CALL this%cent%Destroy()
240 CALL this%centproj%Destroy()
241 CALL this%cos1%Destroy()
243 CALL this%sources_c_accel%Finalize()
subroutine infosources(this, Mesh)
subroutine initsources_rotframe(this, Mesh, Physics, Fluxes, config, IO)
Constructor of the rotating reference frame module.
generic source terms module providing functionaly common to all source terms
source terms module for constant acceleration
derived class for compound of mesh arrays
base class for mesh arrays
character(len=32) source_name
physics module for 1D,2D and 3D isothermal Euler equations
subroutine finalize(this)
subroutine convert2rotatingframe(this, Mesh, Physics, pvar)
source terms module for inertial forces caused by a rotating grid
Dictionary for generic data types.
physics module for 1D,2D and 3D non-isothermal Euler equations
base module for numerical flux functions
subroutine externalsources_single(this, Mesh, Physics, Fluxes, Sources, time, dt, pvar, cvar, sterm)