Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ocean-mixing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
inmcm-mirror
ocean-mixing
Commits
73f95bd8
Commit
73f95bd8
authored
6 months ago
by
Evgeny Mortikov
Browse files
Options
Downloads
Patches
Plain Diff
minor k-epsilon update
parent
63373027
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
obl_k_epsilon.f90
+76
-21
76 additions, 21 deletions
obl_k_epsilon.f90
obl_pph_dyn.f90
+10
-10
10 additions, 10 deletions
obl_pph_dyn.f90
with
86 additions
and
31 deletions
obl_k_epsilon.f90
+
76
−
21
View file @
73f95bd8
module
obl_k_epsilon
module
obl_k_epsilon
!< @brief k-epsilon scheme module
!< @brief k-epsilon scheme module
! --------------------------------------------------------------------------------
! modules used
! modules used
! --------------------------------------------------------------------------------
use
obl_math
use
obl_math
use
obl_grid
use
obl_grid
use
obl_bc
use
obl_bc
use
obl_turb_common
use
obl_turb_common
! directives list
! directives list
! --------------------------------------------------------------------------------
implicit
none
implicit
none
private
! public interface
! --------------------------------------------------------------------------------
public
::
advance_turbulence_closure
public
::
define_stability_functions
public
::
get_eddy_viscosity
,
get_eddy_diffusivity
public
::
get_eddy_viscosity_vec
,
get_eddy_diffusivity_vec
public
::
TKE_init
,
EPS_init
public
::
TKE_bc
,
EPS_bc
! --------------------------------------------------------------------------------
!> @brief k-epsilon parameters
!> @brief k-epsilon parameters
type
,
public
::
kepsilonParamType
type
,
public
::
kepsilonParamType
...
@@ -28,6 +44,7 @@ module obl_k_epsilon
...
@@ -28,6 +44,7 @@ module obl_k_epsilon
contains
contains
! --------------------------------------------------------------------------------
! --------------------------------------------------------------------------------
subroutine
define_stability_functions
(
param
,
bc
,
grid
)
subroutine
define_stability_functions
(
param
,
bc
,
grid
)
!< @brief advance stability functions: N**2, S**2, Ri-gradient
!< @brief advance stability functions: N**2, S**2, Ri-gradient
...
@@ -65,8 +82,8 @@ module obl_k_epsilon
...
@@ -65,8 +82,8 @@ module obl_k_epsilon
bc
%
U_dyn0
,
bc
%
U_dynH
,
param
,
grid
%
cz
)
bc
%
U_dyn0
,
bc
%
U_dynH
,
param
,
grid
%
cz
)
call
EPS_bc
(
EPS
,
&
call
EPS_bc
(
EPS
,
&
bc
%
U_dyn0
,
bc
%
U_dynH
,
param
,
grid
%
dz
,
grid
%
cz
)
bc
%
U_dyn0
,
bc
%
U_dynH
,
param
,
grid
%
dz
,
grid
%
cz
)
call
get_
Km_k_eps
(
Km
,
TKE
,
EPS
,
param
,
grid
%
cz
)
call
get_
eddy_viscosity
(
Km
,
TKE
,
EPS
,
param
,
grid
)
call
get_
Kh_k_eps
(
Kh
,
Km
,
param
,
grid
%
cz
)
call
get_
eddy_diffusivity
(
Kh
,
Km
,
param
,
grid
)
call
TKE_bc
(
TKE
,
&
call
TKE_bc
(
TKE
,
&
bc
%
U_dyn0
,
bc
%
U_dynH
,
param
,
grid
%
cz
)
bc
%
U_dyn0
,
bc
%
U_dynH
,
param
,
grid
%
cz
)
call
eps_bc
(
EPS
,
&
call
eps_bc
(
EPS
,
&
...
@@ -91,7 +108,7 @@ module obl_k_epsilon
...
@@ -91,7 +108,7 @@ module obl_k_epsilon
end
do
end
do
end
subroutine
end
subroutine
subroutine
eps
_init
(
eps
,
param
,
nz
,
z
)
subroutine
EPS
_init
(
eps
,
param
,
nz
,
z
)
!< @brief TKE dissipation rate initialization
!< @brief TKE dissipation rate initialization
type
(
kepsilonParamType
),
intent
(
in
)
::
param
type
(
kepsilonParamType
),
intent
(
in
)
::
param
integer
,
intent
(
in
)
::
nz
!< number of z-steps
integer
,
intent
(
in
)
::
nz
!< number of z-steps
...
@@ -137,36 +154,74 @@ module obl_k_epsilon
...
@@ -137,36 +154,74 @@ module obl_k_epsilon
end
subroutine
EPS_bc
end
subroutine
EPS_bc
subroutine
get_Km_k_eps
(
Km
,
TKE
,
eps
,
param
,
nz
)
! --------------------------------------------------------------------------------
!< @brief calculate momentum transfer coefficient in k-epsilon closure
subroutine
get_eddy_viscosity
(
Km
,
TKE
,
EPS
,
param
,
grid
)
!< @brief calculate eddy viscosity
! ----------------------------------------------------------------------------
type
(
kepsilonParamType
),
intent
(
in
)
::
param
type
(
gridDataType
),
intent
(
in
)
::
grid
real
,
dimension
(
grid
%
cz
),
intent
(
out
)
::
Km
!< eddy viscosity, [m**2 / s]
real
,
dimension
(
grid
%
cz
),
intent
(
in
)
::
TKE
,
EPS
!<
! ----------------------------------------------------------------------------
call
get_eddy_viscosity_vec
(
Km
,
TKE
,
EPS
,
param
,
grid
%
cz
)
end
subroutine
get_eddy_viscosity
subroutine
get_eddy_viscosity_vec
(
Km
,
TKE
,
EPS
,
param
,
cz
)
!< @brief calculate eddy viscosity
! ----------------------------------------------------------------------------
type
(
kepsilonParamType
),
intent
(
in
)
::
param
type
(
kepsilonParamType
),
intent
(
in
)
::
param
integer
,
intent
(
in
)
::
nz
!< number of z-steps
real
,
intent
(
inout
)
::
TKE
(
nz
),
eps
(
nz
)
real
,
intent
(
out
)
::
Km
(
nz
)
!eddy viscosity for momentum, [m**2 / s]
integer
::
k
!< counter
do
k
=
1
,
nz
integer
,
intent
(
in
)
::
cz
!< grid size
real
,
dimension
(
cz
),
intent
(
out
)
::
Km
!< eddy viscosity, [m**2 / s]
real
,
dimension
(
cz
),
intent
(
in
)
::
TKE
,
EPS
!<
integer
::
k
! ----------------------------------------------------------------------------
do
k
=
1
,
cz
if
(
eps
(
k
)
<
param
%
eps_min
)
then
if
(
eps
(
k
)
<
param
%
eps_min
)
then
Km
(
k
)
=
param
%
C_mu
*
TKE
(
k
)
*
TKE
(
k
)
/
param
%
eps_min
Km
(
k
)
=
param
%
C_mu
*
TKE
(
k
)
*
TKE
(
k
)
/
param
%
eps_min
else
else
Km
(
k
)
=
param
%
C_mu
*
TKE
(
k
)
*
TKE
(
k
)
/
eps
(
k
)
Km
(
k
)
=
param
%
C_mu
*
TKE
(
k
)
*
TKE
(
k
)
/
eps
(
k
)
endif
endif
end
do
end
do
end
subroutine
get_
Km_k_eps
end
subroutine
get_
eddy_viscosity_vec
subroutine
get_Kh_k_eps
(
Kh
,
Km
,
param
,
nz
)
! --------------------------------------------------------------------------------
!< @brief calculate scalar transfer coefficient in k-epsilon closure
subroutine
get_eddy_diffusivity
(
Kh
,
Km
,
param
,
grid
)
!< @brief calculate eddy diffusivity
! ----------------------------------------------------------------------------
type
(
kepsilonParamType
),
intent
(
in
)
::
param
type
(
kepsilonParamType
),
intent
(
in
)
::
param
integer
,
intent
(
in
)
::
nz
!< number of z-steps
type
(
gridDataType
),
intent
(
in
)
::
grid
real
,
intent
(
in
)
::
Km
(
nz
)
!eddy viscosity for momentum, [m**2 / s]
real
,
intent
(
out
)
::
Kh
(
nz
)
!eddy diffusivity for tracers, [m**2 / s]
integer
::
k
!< counter
do
k
=
1
,
nz
real
,
dimension
(
grid
%
cz
),
intent
(
out
)
::
Kh
!< eddy diffusivity, [m**2 / s]
real
,
dimension
(
grid
%
cz
),
intent
(
in
)
::
Km
!< eddy viscosity, [m**2 / s]
! ----------------------------------------------------------------------------
call
get_eddy_diffusivity_vec
(
Kh
,
Km
,
param
,
grid
%
cz
)
end
subroutine
get_eddy_diffusivity
subroutine
get_eddy_diffusivity_vec
(
Kh
,
Km
,
param
,
cz
)
!< @brief calculate eddy diffusivity
! ----------------------------------------------------------------------------
type
(
kepsilonParamType
),
intent
(
in
)
::
param
integer
,
intent
(
in
)
::
cz
!< grid size
real
,
dimension
(
cz
),
intent
(
out
)
::
Kh
!< eddy diffusivity, [m**2 / s]
real
,
dimension
(
cz
),
intent
(
in
)
::
Km
!< eddy viscosity, [m**2 / s]
integer
::
k
! ----------------------------------------------------------------------------
do
k
=
1
,
cz
Kh
(
k
)
=
Km
(
k
)
/
param
%
PrT0
Kh
(
k
)
=
Km
(
k
)
/
param
%
PrT0
end
do
end
do
end
subroutine
get_
Kh_k_eps
end
subroutine
get_
eddy_diffusivity_vec
! --------------------------------------------------------------------------------
subroutine
solve_TKE_eq
(
Field
,
Km
,
nz
,
dz
,
dt
,
P_TKE
,
B_TKE
,
eps
,
param
)
subroutine
solve_TKE_eq
(
Field
,
Km
,
nz
,
dz
,
dt
,
P_TKE
,
B_TKE
,
eps
,
param
)
!< @brief solver for TKE equation (explicit)
!< @brief solver for TKE equation (explicit)
...
...
This diff is collapsed.
Click to expand it.
obl_pph_dyn.f90
+
10
−
10
View file @
73f95bd8
...
@@ -92,8 +92,8 @@ module obl_pph_dyn
...
@@ -92,8 +92,8 @@ module obl_pph_dyn
type
(
pphDynParamType
),
intent
(
in
)
::
param
type
(
pphDynParamType
),
intent
(
in
)
::
param
type
(
gridDataType
),
intent
(
in
)
::
grid
type
(
gridDataType
),
intent
(
in
)
::
grid
real
,
intent
(
out
)
::
Km
(
grid
%
cz
)
!< eddy viscosity, [m**2 / s]
real
,
dimension
(
grid
%
cz
),
intent
(
out
)
::
Km
!< eddy viscosity, [m**2 / s]
real
,
intent
(
in
)
::
Ri_grad
(
grid
%
cz
)
!< Richardson gradient number, [n/d]
real
,
dimension
(
grid
%
cz
),
intent
(
in
)
::
Ri_grad
!< Richardson gradient number, [n/d]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
...
@@ -108,8 +108,8 @@ module obl_pph_dyn
...
@@ -108,8 +108,8 @@ module obl_pph_dyn
type
(
pphDynParamType
),
intent
(
in
)
::
param
type
(
pphDynParamType
),
intent
(
in
)
::
param
integer
,
intent
(
in
)
::
cz
!< grid size
integer
,
intent
(
in
)
::
cz
!< grid size
real
,
intent
(
out
)
::
Km
(
cz
)
!< eddy viscosity, [m**2 / s]
real
,
dimension
(
cz
),
intent
(
out
)
::
Km
!< eddy viscosity, [m**2 / s]
real
,
intent
(
in
)
::
Ri_grad
(
cz
)
!< Richardson gradient number, [n/d]
real
,
dimension
(
cz
),
intent
(
in
)
::
Ri_grad
!< Richardson gradient number, [n/d]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
...
@@ -132,8 +132,8 @@ module obl_pph_dyn
...
@@ -132,8 +132,8 @@ module obl_pph_dyn
type
(
pphDynParamType
),
intent
(
in
)
::
param
type
(
pphDynParamType
),
intent
(
in
)
::
param
type
(
gridDataType
),
intent
(
in
)
::
grid
type
(
gridDataType
),
intent
(
in
)
::
grid
real
,
intent
(
out
)
::
Kh
(
grid
%
cz
)
!< eddy diffusivity, [m**2 / s]
real
,
dimension
(
grid
%
cz
),
intent
(
out
)
::
Kh
!< eddy diffusivity, [m**2 / s]
real
,
intent
(
in
)
::
Ri_grad
(
grid
%
cz
)
!< Richardson gradient number, [n/d]
real
,
dimension
(
grid
%
cz
),
intent
(
in
)
::
Ri_grad
!< Richardson gradient number, [n/d]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
...
@@ -148,8 +148,8 @@ module obl_pph_dyn
...
@@ -148,8 +148,8 @@ module obl_pph_dyn
type
(
pphDynParamType
),
intent
(
in
)
::
param
type
(
pphDynParamType
),
intent
(
in
)
::
param
integer
,
intent
(
in
)
::
cz
!< grid size
integer
,
intent
(
in
)
::
cz
!< grid size
real
,
intent
(
out
)
::
Kh
(
cz
)
!< eddy diffusivity, [m**2 / s]
real
,
dimension
(
cz
),
intent
(
out
)
::
Kh
!< eddy diffusivity, [m**2 / s]
real
,
intent
(
in
)
::
Ri_grad
(
cz
)
!< Richardson gradient number, [n/d]
real
,
dimension
(
cz
),
intent
(
in
)
::
Ri_grad
!< Richardson gradient number, [n/d]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
U_dynH
!< dynamic velocity, [m/s]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
real
,
intent
(
in
)
::
mld
!< mixed layer depth, [m]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment