Ejemplo n.º 1
0
from proteus import *
from proteus.default_p import *
from math import *
from tank import *
from proteus.mprans import RDLS
"""
The redistancing equation in the sloshbox test problem.
"""

LevelModelType = RDLS.LevelModel

coefficients = RDLS.Coefficients(applyRedistancing=True,
                                 epsFact=epsFact_redistance,
                                 nModelId=2,
                                 rdModelId=3,
		                 useMetrics=useMetrics)

def getDBC_rd(x,flag):
    pass

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

advectiveFluxBoundaryConditions =  {}
diffusiveFluxBoundaryConditions = {0:{}}

class PerturbedSurface_phi:
    def uOfXT(self,x,t):
        return signedDistance(x)

initialConditions  = {0:PerturbedSurface_phi()}
Ejemplo n.º 2
0
from proteus import *
from proteus.default_p import *
from math import *
from cons_ls import *
from proteus.mprans import RDLS
import ncls_p

LevelModelType = RDLS.LevelModel

coefficients = RDLS.Coefficients(applyRedistancing=True,
                                 epsFact=epsFactRedistance,
                                 nModelId=0,
                                 rdModelId=1)

#now define the Dirichlet boundary conditions


def getDBC(x, flag):
    pass


dirichletConditions = {0: getDBC}

if LevelModelType == RDLS.LevelModel:
    #weakDirichletConditions = {0:RDLS.setZeroLSweakDirichletBCs}
    weakDirichletConditions = {0: RDLS.setZeroLSweakDirichletBCsSimple}
else:
    weakDirichletConditions = {0: coefficients.setZeroLSweakDirichletBCs}

#weakDirichletConditions = {0:coefficients.setZeroLSweakDirichletBCs2}
#weakDirichletConditions = None
Ejemplo n.º 3
0
    psitc['startRatio']=1.0
    rtol_res[0] = 0.0
    atol_res[0] = ct.rd_nl_atol_res
    useEisenstatWalker = False
    maxNonlinearIts = 1
    maxLineSearches = 0
    nonlinearSolverConvergenceTest = 'rits'
    levelNonlinearSolverConvergenceTest = 'rits'
    linearSolverConvergenceTest = 'r-true'

femSpaces = {0:ct.basis}
       
massLumping       = False
numericalFluxType = NumericalFlux.DoNothing
conservativeFlux  = None
subgridError      = RDLS.SubgridError(coefficients=physics.coefficients,
                                      nd=ct.domain.nd)
shockCapturing    = RDLS.ShockCapturing(coefficients=physics.coefficients,
                                        nd=ct.domain.nd,
                                        shockCapturingFactor=ct.rd_shockCapturingFactor,
                                        lag=ct.rd_lag_shockCapturing)
fullNewtonFlag = True
multilevelNonlinearSolver  = NonlinearSolvers.Newton
levelNonlinearSolver       = NonlinearSolvers.Newton

nonlinearSmoother = NonlinearSolvers.NLGaussSeidel
linearSmoother    = None

matrix = LinearAlgebraTools.SparseMatrix

if ct.useOldPETSc:
    multilevelLinearSolver = LinearSolvers.PETSc
Ejemplo n.º 4
0
from proteus.default_p import *
from math import *
from obstacleInTank3d import *
from proteus.mprans import RDLS
"""
The redistancing equation in the obstacleInTank test problem.
"""
##
LevelModelType = RDLS.LevelModel

##\ingroup test
#\brief The redistancing equation in the obstacleInTank test problem.
#
if applyCorrection:
    coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
                                     epsFact=epsFact_redistance,
                                     nModelId=1,
                                     rdModelId=3)
else:
    coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
                                     epsFact=epsFact_redistance,
                                     nModelId=1,
                                     rdModelId=2)

#now define the Dirichlet boundary conditions


def getDBC_rd(x, flag):
    pass


dirichletConditions = {0: getDBC_rd}
Ejemplo n.º 5
0
nd = domain.nd
mesh = domain.MeshOptions

genMesh = mesh.genMesh
movingDomain = ct.movingDomain
T = ct.T
"""
The redistancing equation in the sloshbox test problem.
"""

LevelModelType = RDLS.LevelModel

coefficients = RDLS.Coefficients(
    applyRedistancing=ct.applyRedistancing,
    epsFact=ct.epsFact_redistance,
    nModelId=int(ct.movingDomain) + 2,
    rdModelId=int(ct.movingDomain) + 3,
    useMetrics=ct.useMetrics,
    backgroundDiffusionFactor=ct.backgroundDiffusionFactor)


def getDBC_rd(x, flag):
    pass


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

advectiveFluxBoundaryConditions = {}
diffusiveFluxBoundaryConditions = {0: {}}
Ejemplo n.º 6
0
from proteus import *
from proteus.default_p import *
from math import *
from rotation2D import *
from proteus.mprans import RDLS
import ls_rotation_2d_p
name = soname + "_rdls"
LevelModelType = RDLS.LevelModel

coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
                                 epsFact=epsFactRedistance,
                                 nModelId=0,
                                 rdModelId=1,
                                 useMetrics=useMetrics)

#now define the Dirichlet boundary conditions


def getDBC(x, flag):
    pass


dirichletConditions = {0: getDBC}

if LevelModelType == RDLS.LevelModel:
    #weakDirichletConditions = {0:RDLS.setZeroLSweakDirichletBCs}
    weakDirichletConditions = {0: RDLS.setZeroLSweakDirichletBCsSimple}
else:
    weakDirichletConditions = {0: coefficients.setZeroLSweakDirichletBCs}

#weakDirichletConditions = {0:coefficients.setZeroLSweakDirichletBCs2}
Ejemplo n.º 7
0
from proteus import *
from proteus.default_p import *
from math import *
from floatingCylinder import *
from proteus.mprans import RDLS

LevelModelType = RDLS.LevelModel
coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
                                 epsFact=epsFact_redistance,
                                 nModelId=1,
                                 rdModelId=3,
                                 useConstantH=useConstantH)
#now define the Dirichlet boundary conditions


def getDBC_rd(x, flag):
    pass


dirichletConditions = {0: getDBC_rd}

if freezeLevelSet:
    if LevelModelType == RDLS.LevelModel:
        weakDirichletConditions = {0: RDLS.setZeroLSweakDirichletBCs}
    else:
        weakDirichletConditions = {0: coefficients.setZeroLSweakDirichletBCs}


class PerturbedSurface_phi:
    def __init__(self, waterLevel, slopeAngle):
        self.waterLevel = waterLevel
Ejemplo n.º 8
0
from proteus import *
from proteus.default_p import *
from math import *
from dambreak_Ubbink_fine import *
from proteus.mprans import RDLS
"""
The redistancing equation in the sloshbox test problem.
"""

LevelModelType = RDLS.LevelModel

coefficients = RDLS.Coefficients(
    applyRedistancing=applyRedistancing,
    epsFact=epsFact_redistance,
    nModelId=2,
    rdModelId=3,
    useMetrics=useMetrics,
    backgroundDiffusionFactor=backgroundDiffusionFactor)


def getDBC_rd(x, flag):
    pass


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

advectiveFluxBoundaryConditions = {}
diffusiveFluxBoundaryConditions = {0: {}}