Exemple #1
0
from __future__ import absolute_import
from builtins import object
from math import *
from proteus import *
from proteus.default_p import *
from .NS_hotstart import *
from proteus.mprans import Pres

name = "pressure"

coefficients = Pres.Coefficients(modelIndex=2,
                                 fluidModelIndex=0,
                                 pressureIncrementModelIndex=1,
                                 useRotationalForm=False)
LevelModelType = Pres.LevelModel


def getDBC_p(x, flag):
    None


def getFlux(x, flag):
    None


class getIBC_p(object):
    def __init__(self):
        pass

    def uOfXT(self, x, t):
        return np.cos(x[0]) * np.sin(x[1])
Exemple #2
0
from __future__ import absolute_import
from builtins import object
from math import *
from proteus import *
from proteus.default_p import *
from .NS_convergence import *
from proteus.mprans import Pres

name = "pressure"
#LevelModelType = Pres.LevelModel
coefficients = Pres.Coefficients(modelIndex=PRESSURE_model,
                                 fluidModelIndex=V_model,
                                 pressureIncrementModelIndex=PINC_model,
                                 useRotationalForm=False)


def getDBC_p(x, flag):
    None


def getFlux(x, flag):
    None


class getIBC_p(object):
    def __init__(self):
        pass

    def uOfXT(self, x, t):
        return np.cos(x[0]) * np.sin(x[1])
Exemple #3
0
from math import *
from proteus import *
from proteus.default_p import *
from proteus.mprans import Pres
from proteus import Context
from tank import *

ct = Context.get()
name = "pressure"

LevelModelType = Pres.LevelModel

coefficients=Pres.Coefficients(modelIndex=ct.P_model,
                               fluidModelIndex=ct.V_model,
                               pressureIncrementModelIndex=ct.DP_model,
                               useRotationalForm=True)


class getIBC_p:
    def __init__(self,waterLevel):
        self.waterLevel=waterLevel
    def uOfXT(self,x,t):
        self.vos = ct.vos_function(x)
        self.rho_a = rho_1#(1.-self.vos)*rho_1 + (self.vos)*ct.rho_s
        self.rho_w = rho_0#(1.-self.vos)*rho_0 + (self.vos)*ct.rho_s
        if signedDistance(x) < 0:
            return -(L[1] - self.waterLevel)*self.rho_a*g[1] - (self.waterLevel - x[1])*self.rho_w*g[1]
        else:
            return -(L[1] - x[1])*self.rho_a*g[1]

initialConditions = {0:getIBC_p(waterLine_z)}