Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 2d/sediment/bed_sediment/redist_n.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
LinearSolvers,
LinearAlgebraTools,
NumericalFlux)
from proteus.mprans import RDLS3P
from proteus.mprans import RDLS
import redist_p as physics
from proteus import Context

Expand Down Expand Up @@ -37,8 +37,8 @@
massLumping = False
numericalFluxType = NumericalFlux.DoNothing
conservativeFlux = None
subgridError = RDLS3P.SubgridError(physics.coefficients,nd)
shockCapturing = RDLS3P.ShockCapturing(physics.coefficients,nd,shockCapturingFactor=ct.rd_shockCapturingFactor,lag=ct.rd_lag_shockCapturing)
subgridError = RDLS.SubgridError(physics.coefficients,nd)
shockCapturing = RDLS.ShockCapturing(physics.coefficients,nd,shockCapturingFactor=ct.rd_shockCapturingFactor,lag=ct.rd_lag_shockCapturing)

fullNewtonFlag = True
multilevelNonlinearSolver = NonlinearSolvers.Newton
Expand Down
8 changes: 4 additions & 4 deletions 2d/sediment/bed_sediment/redist_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from proteus import *
from proteus.default_p import *
from math import *
from proteus.mprans import RDLS3P
from proteus.mprans import RDLS
from proteus import Context

"""
Expand All @@ -19,11 +19,11 @@
movingDomain = ct.movingDomain
T = ct.T

LevelModelType = RDLS3P.LevelModel
LevelModelType = RDLS.LevelModel



coefficients = RDLS3P.Coefficients(applyRedistancing=ct.applyRedistancing,
coefficients = RDLS.Coefficients(applyRedistancing=ct.applyRedistancing,
epsFact=ct.epsFact_redistance,
nModelId=ct.LS_model,
rdModelId=ct.RD_model,
Expand All @@ -34,7 +34,7 @@ def getDBC_rd(x,flag):
pass

dirichletConditions = {0:getDBC_rd}
weakDirichletConditions = {0:RDLS3P.setZeroLSweakDirichletBCsSimple}
weakDirichletConditions = {0:RDLS.setZeroLSweakDirichletBCsSimple}

advectiveFluxBoundaryConditions = {}
diffusiveFluxBoundaryConditions = {0:{}}
Expand Down
69 changes: 34 additions & 35 deletions 2d/sediment/bed_sediment/tank.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#fluid parameters
("rho_0", 998.2, "water density"),
("rho_1", 1.205, "air density"),
("nu_0", 1e-6, "water kin viscosity"),
("nu_0", 1.0e-6, "water kin viscosity"),
("nu_1", 1.5e-5, "air kin viscosity"),
('g',np.array([0.0, -9.8, 0.0]),'Gravitational acceleration'),
# sediment parameters
('cSed', 0.55,'Initial sediment concentration'),
('rho_s',2600 ,'sediment material density'),
('rho_s',2600.,'sediment material density'),
('alphaSed', 150.,'laminar drag coefficient'),
('betaSed', 1.72,'turbulent drag coefficient'),
('grain',0.0025, 'Grain size'),
Expand All @@ -44,12 +44,12 @@
('nContact', 5.0,'Contact stress coefficient'),
('angFriction', pi/6., 'Angle of friction'),
('vos_limiter', 0.6, 'Weak limiter for vos'),
('mu_fr_limiter', 1e-3,'Hard limiter for contact stress friction coeff'),
('mu_fr_limiter', 1.0e-3,'Hard limiter for contact stress friction coeff'),
# numerical options
("refinement", 25.,"L[0]/refinement"),
("sedimentDynamics", True, "Enable sediment dynamics module"),
("cfl", 0.25 ,"Target cfl"),
("duration", 5.0 ,"Duration of the simulation"),
("duration", 0.5 ,"Duration of the simulation"),
("PSTAB", 1.0, "Affects subgrid error"),
("res", 1.0e-8, "Residual tolerance"),
("epsFact_density", 3.0, "Control width of water/air transition zone"),
Expand Down Expand Up @@ -90,31 +90,31 @@

# ----- Sediment stress ----- #

sedClosure = HsuSedStress(aDarcy = opts.alphaSed,
betaForch = opts.betaSed,
grain = opts.grain,
packFraction = opts.packFraction,
packMargin = opts.packMargin,
maxFraction = opts.maxFraction,
frFraction = opts.frFraction,
sigmaC = opts.sigmaC,
C3e = opts.C3e,
C4e = opts.C4e,
eR = opts.eR,
fContact = opts.fContact,
mContact = opts.mContact,
nContact = opts.nContact,
angFriction = opts.angFriction,
vos_limiter = opts.vos_limiter,
mu_fr_limiter = opts.mu_fr_limiter,
sedClosure = HsuSedStress(opts.alphaSed,
opts.betaSed,
opts.grain,
opts.packFraction,
opts.packMargin,
opts.maxFraction,
opts.frFraction,
opts.sigmaC,
opts.C3e,
opts.C4e,
opts.eR,
opts.fContact,
opts.mContact,
opts.nContact,
opts.angFriction,
opts.vos_limiter,
opts.mu_fr_limiter,
)

# ----- DOMAIN ----- #

domain = Domain.PlanarStraightLineGraphDomain()


# ----- Phisical constants ----- #
# ----- Physical constants ----- #

# Water
rho_0 = opts.rho_0
Expand Down Expand Up @@ -143,10 +143,9 @@
sediment_bottom = opts.sediment_bottom
waterLevel = waterLine_z

####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
##################################################################################
# Domain and mesh
####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

##################################################################################
L = (opts.Lx, opts.Ly)
he = L[0]/opts.refinement
dim = dimx, dimy = L
Expand All @@ -167,18 +166,18 @@

tank = st.Rectangle(domain, dim=dim, coords=coords)

#############################################################################################################################################################################################################################################################################################################################################################################################
#################################################################################
# ----- BOUNDARY CONDITIONS ----- #
#############################################################################################################################################################################################################################################################################################################################################################################################
#################################################################################

tank.BC['y-'].setFreeSlip()
tank.BC['y+'].setAtmosphere(orientation=np.array([0., +1.,0.]))
tank.BC['x-'].setFreeSlip()
tank.BC['x+'].setFreeSlip()

####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
#################################################################################
# Turbulence
####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
#################################################################################


if opts.useRANS:
Expand All @@ -190,9 +189,9 @@
tank.BC['y+'].setTurbulentZeroGradient()


######################################################################################################################################################################################################################
#################################################################################
# Gauges and probes #
######################################################################################################################################################################################################################
#################################################################################

T=opts.duration
PG = []
Expand All @@ -217,9 +216,9 @@
sampleRate=0.,
fileName='solidFractionGauges.csv')

######################################################################################################################################################################################################################
##################################################################################
# Numerical Options and other parameters #
######################################################################################################################################################################################################################
##################################################################################

domain.MeshOptions.he = he

Expand Down Expand Up @@ -327,9 +326,9 @@
pbasis = C0_AffineQuadraticOnSimplexWithNodalBasis


####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
####################################################################################################################
# Numerical parameters
####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
######################################################################################

ns_forceStrongDirichlet = False
ns_sed_forceStrongDirichlet = False
Expand Down
6 changes: 3 additions & 3 deletions 2d/sediment/friction_angle_dambrek_sediment/redist_n.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
LinearSolvers,
LinearAlgebraTools,
NumericalFlux)
from proteus.mprans import RDLS3P
from proteus.mprans import RDLS
import redist_p as physics
from proteus import Context

Expand Down Expand Up @@ -37,8 +37,8 @@
massLumping = False
numericalFluxType = NumericalFlux.DoNothing
conservativeFlux = None
subgridError = RDLS3P.SubgridError(physics.coefficients,nd)
shockCapturing = RDLS3P.ShockCapturing(physics.coefficients,nd,shockCapturingFactor=ct.rd_shockCapturingFactor,lag=ct.rd_lag_shockCapturing)
subgridError = RDLS.SubgridError(physics.coefficients,nd)
shockCapturing = RDLS.ShockCapturing(physics.coefficients,nd,shockCapturingFactor=ct.rd_shockCapturingFactor,lag=ct.rd_lag_shockCapturing)

fullNewtonFlag = True
multilevelNonlinearSolver = NonlinearSolvers.Newton
Expand Down
8 changes: 4 additions & 4 deletions 2d/sediment/friction_angle_dambrek_sediment/redist_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from proteus import *
from proteus.default_p import *
from math import *
from proteus.mprans import RDLS3P
from proteus.mprans import RDLS
from proteus import Context

"""
Expand All @@ -19,7 +19,7 @@
movingDomain = ct.movingDomain
T = ct.T

LevelModelType = RDLS3P.LevelModel
LevelModelType = RDLS.LevelModel

if ct.sedimentDynamics:
LS_model=2
Expand All @@ -29,7 +29,7 @@
RD_model=2


coefficients = RDLS3P.Coefficients(applyRedistancing=ct.applyRedistancing,
coefficients = RDLS.Coefficients(applyRedistancing=ct.applyRedistancing,
epsFact=ct.epsFact_redistance,
nModelId=LS_model,
rdModelId=RD_model,
Expand All @@ -40,7 +40,7 @@ def getDBC_rd(x,flag):
pass

dirichletConditions = {0:getDBC_rd}
weakDirichletConditions = {0:RDLS3P.setZeroLSweakDirichletBCsSimple}
weakDirichletConditions = {0:RDLS.setZeroLSweakDirichletBCsSimple}

advectiveFluxBoundaryConditions = {}
diffusiveFluxBoundaryConditions = {0:{}}
Expand Down
36 changes: 18 additions & 18 deletions 2d/sediment/friction_angle_dambrek_sediment/tank.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,24 @@

# ----- Sediment stress ----- #

sedClosure = HsuSedStress(aDarcy = opts.alphaSed,
betaForch = opts.betaSed,
grain = opts.grain,
packFraction = opts.packFraction,
packMargin = opts.packMargin,
maxFraction = opts.maxFraction,
frFraction = opts.frFraction,
sigmaC = opts.sigmaC,
C3e = opts.C3e,
C4e = opts.C4e,
eR = opts.eR,
fContact = opts.fContact,
mContact = opts.mContact,
nContact = opts.nContact,
angFriction = opts.angFriction,
vos_limiter = opts.vos_limiter,
mu_fr_limiter = opts.mu_fr_limiter,
)
sedClosure = HsuSedStress(opts.alphaSed,
opts.betaSed,
opts.grain,
opts.packFraction,
opts.packMargin,
opts.maxFraction,
opts.frFraction,
opts.sigmaC,
opts.C3e,
opts.C4e,
opts.eR,
opts.fContact,
opts.mContact,
opts.nContact,
opts.angFriction,
opts.vos_limiter,
opts.mu_fr_limiter,
)


# ----- DOMAIN ----- #
Expand Down
6 changes: 3 additions & 3 deletions 2d/sediment/group_sediment/redist_n.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
LinearSolvers,
LinearAlgebraTools,
NumericalFlux)
from proteus.mprans import RDLS3P
from proteus.mprans import RDLS
import redist_p as physics
from proteus import Context

Expand Down Expand Up @@ -37,8 +37,8 @@
massLumping = False
numericalFluxType = NumericalFlux.DoNothing
conservativeFlux = None
subgridError = RDLS3P.SubgridError(physics.coefficients,nd)
shockCapturing = RDLS3P.ShockCapturing(physics.coefficients,nd,shockCapturingFactor=ct.rd_shockCapturingFactor,lag=ct.rd_lag_shockCapturing)
subgridError = RDLS.SubgridError(physics.coefficients,nd)
shockCapturing = RDLS.ShockCapturing(physics.coefficients,nd,shockCapturingFactor=ct.rd_shockCapturingFactor,lag=ct.rd_lag_shockCapturing)

fullNewtonFlag = True
multilevelNonlinearSolver = NonlinearSolvers.Newton
Expand Down
8 changes: 4 additions & 4 deletions 2d/sediment/group_sediment/redist_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from proteus import *
from proteus.default_p import *
from math import *
from proteus.mprans import RDLS3P
from proteus.mprans import RDLS
from proteus import Context

"""
Expand All @@ -19,7 +19,7 @@
movingDomain = ct.movingDomain
T = ct.T

LevelModelType = RDLS3P.LevelModel
LevelModelType = RDLS.LevelModel

if ct.sedimentDynamics:
LS_model=2
Expand All @@ -29,7 +29,7 @@
RD_model=2


coefficients = RDLS3P.Coefficients(applyRedistancing=ct.applyRedistancing,
coefficients = RDLS.Coefficients(applyRedistancing=ct.applyRedistancing,
epsFact=ct.epsFact_redistance,
nModelId=LS_model,
rdModelId=RD_model,
Expand All @@ -40,7 +40,7 @@ def getDBC_rd(x,flag):
pass

dirichletConditions = {0:getDBC_rd}
weakDirichletConditions = {0:RDLS3P.setZeroLSweakDirichletBCsSimple}
weakDirichletConditions = {0:RDLS.setZeroLSweakDirichletBCsSimple}

advectiveFluxBoundaryConditions = {}
diffusiveFluxBoundaryConditions = {0:{}}
Expand Down
Loading