Commit 0454d624 authored by Valentin Vallaeys's avatar Valentin Vallaeys Committed by Philippe Delandmeter
Browse files

slim3d: add pacanowski-philander + correct okubo

+ add export rho
parent ae8415c1
......@@ -72,7 +72,7 @@ class Slim3d_equations :
self._hor_visc_fact = factor
self._hor_visc_max = maximum
def set_horizontal_diffusivity(self, mode, constant=1, factor=0.0, maximum=1e9):
def set_horizontal_diffusivity(self, mode, constant=1, factor=0.03, maximum=1e9):
if (mode != "okubo") and (mode != "constant"):
dgpy.Msg.Fatal("Unknown mode for horizontal_viscosity : "+mode)
self._horizontal_diffusivity = mode
......@@ -81,13 +81,13 @@ class Slim3d_equations :
self._hor_diff_max = maximum
def set_vertical_viscosity(self, mode, constant_value=1e-5):
if (mode != "gotm") and (mode != "constant"):
if (mode != "gotm") and (mode != "constant") and (mode != "PP"):
dgpy.Msg.Fatal("Unknown viscosity for vertical_viscosity : "+mode)
self._vertical_viscosity = mode
self._vertical_viscosity_value = constant_value
def set_vertical_diffusivity(self, mode, constant_value=1e-5):
if (mode != "gotm") and (mode != "constant"):
if (mode != "gotm") and (mode != "constant") and (mode != "PP"):
dgpy.Msg.Fatal("Unknown diffusivity for vertical_diffusivity : "+mode)
self._vertical_diffusivity = mode
self._vertical_diffusivity_value = constant_value
......@@ -202,6 +202,7 @@ class Loop:
self._export_S_nc = False
self._export_eta_nc = False
self._export_z_nc = False
self._export_rho = False
self._timeIntegrator = None
self._export = []
self._ncExport = []
......@@ -216,11 +217,12 @@ class Loop:
def export_elevation(self): self._export_eta = True
def export_vertical_diffusivity(self): self._export_kappav = True
def export_vertical_viscosity(self): self._export_nuv = True
def export_rho(self): self._export_rho = True
def export_uv_nc(self): self._export_uv_nc = True
def export_salinity_nc(self): self._export_S_nc = True
def export_elevation_nc(self): self._export_eta_nc = True
def export_z_nc(self): self._export_z_nc = True
def restart(self, directory, index):
self._restart_dir = directory
self._restart_ind = index
......@@ -235,6 +237,7 @@ class Loop:
d = slimSolver.getDofs()
if self._export_uv: self._export.append(dgpy.dgIdxExporter(d.uvDof, self._odir + "/uv", True))
if self._export_w: self._export.append(dgpy.dgIdxExporter(d.wDof3d, self._odir + "/w"))
if self._export_rho: self._export.append(dgpy.dgIdxExporter(d.rhoDof3d, self._odir + "/rho"))
if self._export_uvAv2d: self._export.append(dgpy.dgIdxExporter(d.uvAvDof2d, self._odir + "/uvAv2d", True))
if self._export_eta: self._export.append(dgpy.dgIdxExporter(d.etaDof2d, self._odir + "/eta"))
if self._export_S:
......
......@@ -112,8 +112,12 @@ def slim3d_setup(loop):
if eq._vertical_viscosity == 'constant':
f.nuvFunc = dgpy.functionConstant(eq._vertical_viscosity_value)
elif eq._vertical_viscosity == 'PP':
f.nuvFunc = dgpy.nuPacanowskiPhilander(d.uvGradDof.getFunction(), d.rhoDof3d.getFunctionGradient(), 1e-2, 1e-5, 10, 2)
if eq._vertical_diffusivity == 'constant':
f.kappavFunc = dgpy.functionConstant(eq._vertical_diffusivity_value)
elif eq._vertical_diffusivity == 'PP':
f.kappavFunc = dgpy.kappaPacanowskiPhilander(d.uvGradDof.getFunction(), d.rhoDof3d.getFunctionGradient(), f.nuvFunc, 1e-5, 10)
if slimSolver.getComputeBottomFriction():
f.z0BFunc = dgpy.functionConstant(eq._z0[0])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment