# mesh options nLevels = ct.nLevels parallelPartitioningType = mesh.parallelPartitioningType nLayersOfOverlapForParallel = mesh.nLayersOfOverlapForParallel restrictFineSolutionToAllMeshes = mesh.restrictFineSolutionToAllMeshes triangleOptions = mesh.triangleOptions elementQuadrature = ct.elementQuadrature elementBoundaryQuadrature = ct.elementBoundaryQuadrature femSpaces = {0: ct.basis} massLumping = False numericalFluxType = VOF.NumericalFlux conservativeFlux = None subgridError = VOF.SubgridError(coefficients=physics.coefficients, nd=ct.domain.nd) shockCapturing = VOF.ShockCapturing( coefficients=physics.coefficients, nd=ct.domain.nd, shockCapturingFactor=ct.vof_shockCapturingFactor, lag=ct.vof_lag_shockCapturing) fullNewtonFlag = True multilevelNonlinearSolver = NonlinearSolvers.Newton levelNonlinearSolver = NonlinearSolvers.Newton nonlinearSmoother = None linearSmoother = None matrix = LinearAlgebraTools.SparseMatrix
from tank import * from proteus.mprans import VOF LevelModelType = VOF.LevelModel if useOnlyVF: RD_model = None LS_model = None else: RD_model = 3 LS_model = 2 coefficients = VOF.Coefficients(LS_model=LS_model, V_model=0, RD_model=RD_model, ME_model=1, checkMass=False, useMetrics=useMetrics, epsFact=epsFact_vof, sc_uref=vof_sc_uref, sc_beta=vof_sc_beta, movingDomain=movingDomain) def getDBC_vof(x, flag): if flag == boundaryTags['top']: # or x[1] >= L[1] - 1.0e-12: return lambda x, t: 1.0 # if flag == boundaryTags['left']: # return waveVF # elif flag == boundaryTags['right']: # return outflowVF
movingDomain = ct.movingDomain T = ct.T LevelModelType = VOF.LevelModel if ct.useOnlyVF: RD_model = None LS_model = None else: RD_model = 3 LS_model = 2 coefficients = VOF.Coefficients(LS_model=LS_model, V_model=0, RD_model=RD_model, ME_model=1, checkMass=False, useMetrics=ct.useMetrics, epsFact=ct.epsFact_vof, sc_uref=ct.vof_sc_uref, sc_beta=ct.vof_sc_beta) dirichletConditions = {0: lambda x, flag: domain.bc[flag].vof_dirichlet.init_cython()} advectiveFluxBoundaryConditions = {0: lambda x, flag: domain.bc[flag].vof_advective.init_cython()} diffusiveFluxBoundaryConditions = {0: {}} class PerturbedSurface_H: def uOfXT(self,x,t): return smoothedHeaviside(ct.ecH*ct.he,ct.signedDistance(x)) initialConditions = {0:PerturbedSurface_H()}
movingDomain = ct.movingDomain T = ct.T LevelModelType = VOF.LevelModel if ct.useOnlyVF: RD_model = None LS_model = None else: RD_model = 3 LS_model = 2 coefficients = VOF.Coefficients(LS_model=int(ct.movingDomain) + LS_model, V_model=int(ct.movingDomain) + 0, RD_model=int(ct.movingDomain) + RD_model, ME_model=int(ct.movingDomain) + 1, checkMass=True, useMetrics=ct.useMetrics, epsFact=ct.epsFact_vof, sc_uref=ct.vof_sc_uref, sc_beta=ct.vof_sc_beta, movingDomain=ct.movingDomain) dirichletConditions = { 0: lambda x, flag: domain.bc[flag].vof_dirichlet.init_cython() } advectiveFluxBoundaryConditions = { 0: lambda x, flag: domain.bc[flag].vof_advective.init_cython() } diffusiveFluxBoundaryConditions = {0: {}}
from proteus import * from proteus.default_p import * from proteus.ctransportCoefficients import smoothedHeaviside from wavetank import * from proteus.mprans import VOF LevelModelType = VOF.LevelModel coefficients = VOF.Coefficients(LS_model=1, V_model=0, RD_model=3, ME_model=2, checkMass=False, useMetrics=useMetrics, epsFact=epsFact_vof, sc_uref=vof_sc_uref, sc_beta=vof_sc_beta) def getDBC_vof(x, flag): # if x[2] > L[2] - 1.0e-8: # return lambda x,t: 1.0 # elif x[0] > L[0] - 1.0e-8: # return outflowVF # elif x[0] < 1.0e-8: # return waveVF if flag == boundaryTags['top']: #x[2] > L[2] - 1.0e-8: return lambda x, t: 1.0 elif (not rightEndClosed ) and flag == boundaryTags['right']: #x[0] > L[0] - 1.0e-8: return outflowVF elif flag == boundaryTags['left']: #x[0] < 1.0e-8:
from proteus.mprans import VOF name=soname+"_vof" """ The non-conservative level set description of a bubble in a two-phase flow """ LevelModelType = VOF.LevelModel ##\ingroup test #\file vof_rotation_2d_p.py # # \todo finish vof_rotation_2d_p.py if applyRedistancing: coefficients = VOF.Coefficients(LS_model=0,V_model=0,RD_model=1,ME_model=2,checkMass=checkMass, epsFact=epsFact_vof,useMetrics=useMetrics) elif not onlyVOF: coefficients = VOF.Coefficients(LS_model=0,V_model=0,RD_model=None,ME_model=1,checkMass=checkMass, epsFact=epsFact_vof,useMetrics=useMetrics) else: coefficients = VOF.Coefficients(RD_model=None,ME_model=0,checkMass=checkMass, epsFact=epsFact_vof,useMetrics=useMetrics) def Heaviside(phi): if phi > 0: return 1.0 elif phi < 0: return 0.0 else: return 0.5
if useSpongeLayer: if useVOF: #LevelModelType = VolumeAveragedVOF.OneLevelVolumeAveragedVOF #LevelModelType = VOFV2.OneLevelVOFV2 LevelModelType = VolumeAveragedVOF.LevelModel #VOF.LevelModel coefficients = VolumeAveragedVOF.Coefficients(LS_model=1, V_model=0, RD_model=3, ME_model=2, epsFact=epsFact_vof, checkMass=checkMass) #coefficients = VolumeAveragedVOFCoefficients(LS_model=1,V_model=0,RD_model=3,ME_model=2,epsFact=epsFact_vof, # setParamsFunc=spongeLayerFunc,checkMass=checkMass) else: coefficients = VOF.Coefficients(LS_model=1, V_model=0, RD_model=3, ME_model=2, epsFact=epsFact_vof, checkMass=checkMass) dirichletConditions = {0: getDBC_vof} initialConditions = {0: Flat_H()} fluxBoundaryConditions = {0: 'outFlow'} advectiveFluxBoundaryConditions = {0: getAFBC_vof} diffusiveFluxBoundaryConditions = {0: {}}
name = soname + "_vof" """ The non-conservative level set description of a bubble in a two-phase flow """ LevelModelType = VOF.LevelModel ##\ingroup test #\file vof_vortex_2d_p.py # # \todo finish vof_vortex_2d_p.py if applyRedistancing: coefficients = VOF.Coefficients(LS_model=0, V_model=0, RD_model=1, ME_model=2, checkMass=checkMass, epsFact=epsFact_vof) else: coefficients = VOF.Coefficients(LS_model=0, V_model=0, RD_model=-1, ME_model=1, checkMass=checkMass, epsFact=epsFact_vof) def Heaviside(phi): if phi > 0: return 1.0 elif phi < 0:
from proteus.ctransportCoefficients import smoothedHeaviside from cons_ls import * from proteus.mprans import VOF name = soname + "_vof" """ The non-conservative level set description of a bubble in a two-phase flow """ LevelModelType = VOF.LevelModel coefficients = VOF.Coefficients( LS_model=LS_model, #0 V_model=V_model, #0 RD_model=RD_model, ME_model=VOF_model, checkMass=checkMass, epsFact=epsFact_vof, # edge based parameters STABILIZATION_TYPE=ct.STABILIZATION_TYPE_vof, ENTROPY_TYPE=ct.ENTROPY_TYPE_vof, FCT=ct.FCT, cE=ct.cE_vof, cK=ct.cK) ##################### # INITIAL CONDITION # ##################### class init_cond: def __init__(self, L): self.radius = 0.15 self.xc = 0.5
from proteus import * from proteus.default_p import * from proteus.ctransportCoefficients import smoothedHeaviside from floatingCylinder import * from proteus.mprans import VOF LevelModelType = VOF.LevelModel coefficients = VOF.Coefficients(LS_model=1,V_model=0,RD_model=3,ME_model=2,epsFact=epsFact_consrv_heaviside,checkMass=False) class Flat_H: def __init__(self,waterLevel): self.waterLevel=waterLevel def uOfXT(self,x,t): return smoothedHeaviside(epsFact_consrv_heaviside*he,x[2]-waterLevel) analyticalSolutions = None def getDBC_vof(x,flag): if altBC: if flag in [domain.boundaryTags['downstream'],domain.boundaryTags['upstream'],domain.boundaryTags['top']]: return lambda x,t: smoothedHeaviside(epsFact_consrv_heaviside*he,x[2]-waterLevel) else: if flag in [domain.boundaryTags['upstream']]: return lambda x,t: smoothedHeaviside(epsFact_consrv_heaviside*he,x[2]-waterLevel) if flag in [domain.boundaryTags['downstream']]: return lambda x,t: smoothedHeaviside(epsFact_consrv_heaviside*he,x[2]-waterLevel) dirichletConditions = {0:getDBC_vof} initialConditions = {0:Flat_H(waterLevel)}
FCT=True, num_fct_iter=1) elif useNCLS: LevelModelType = NCLS.LevelModel coefficients = NCLS.Coefficients(V_model=None, RD_model=None, ME_model=0, checkMass=False, epsFact=0.0, useMetrics=1.0) elif useVOF: LevelModelType = VOF.LevelModel coefficients = VOF.Coefficients(LS_model=None, V_model=None, RD_model=None, ME_model=0, checkMass=False, epsFact=0.0, useMetrics=1.0, FCT=False) elif useHJ: coefficients = ConstantVelocityLevelSet(b=velocity) else: coefficients = LinearVADR_ConstantCoefficients(nc=1, M=M, A=A, B=B, C=C) coefficients.variableNames = ['u'] #now define the Dirichlet boundary conditions def getDBC(x, tag): return None