예제 #1
0
T = ct.T

initialConditions = None

analyticalSolution = {}

nMediaTypes = len(domain.regionFlags)  # (!) should be region flags
smTypes = np.zeros((nMediaTypes + 1, 2), 'd')
smFlags = np.zeros((nMediaTypes + 1, ), 'i')
smTypes[:, 0] = 1.0  # E
smTypes[:, 1] = 0.3  # nu

LevelModelType = MoveMesh.LevelModel
coefficients = MoveMesh.Coefficients(nd=ct.domain.nd,
                                     V_model=1,
                                     modelType_block=smFlags,
                                     modelParams_block=smTypes,
                                     meIndex=0)

dirichletConditions = {
    0: lambda x, flag: domain.bc[flag].hx_dirichlet.init_cython(),
    1: lambda x, flag: domain.bc[flag].hy_dirichlet.init_cython()
}

fluxBoundaryConditions = {0: 'noFlow', 1: 'noFlow'}

advectiveFluxBoundaryConditions = {}

diffusiveFluxBoundaryConditions = {0: {}, 1: {}}

stressFluxBoundaryConditions = {
예제 #2
0
analyticalSolution = {}

nMediaTypes = 1
smTypes = numpy.zeros((nMediaTypes, 2), 'd')
smFlags = numpy.zeros((nMediaTypes, ), 'i')

smTypes[0, 0] = 1.0  ##E
smTypes[0, 1] = 0.3  ##nu

LevelModelType = MoveMesh.LevelModel
coefficients = MoveMesh.Coefficients(hullMass=hull_mass,
                                     hullCG=hull_cg,
                                     hullInertia=hull_inertia,
                                     linConstraints=RBR_linCons,
                                     angConstraints=RBR_angCons,
                                     V_model=0,
                                     modelType_block=smFlags,
                                     modelParams_block=smTypes,
                                     meIndex=5)


def getDBC_hx(x, flag):
    if flag in [
            boundaryTags['top'], boundaryTags['bottom'], boundaryTags['left'],
            boundaryTags['right'], boundaryTags['front'], boundaryTags['back']
    ]:
        return lambda x, t: 0.0
    if flag == boundaryTags['obstacle']:
        return lambda x, t: 0.0
LevelModelType = MoveMesh.LevelModel

nMediaTypes = 1
smTypes = numpy.zeros((nMediaTypes, 2), 'd')
smFlags = numpy.zeros((nMediaTypes, ), 'i')

E = he**3 / 6.0  #1.0e5 #kN/m^2 Young's modulus
nu = 0.3  #- Poisson's ratio

smTypes[0, 0] = E
smTypes[0, 1] = nu
coefficients = MoveMesh.Coefficients(hullMass=0.0,
                                     hullCG=[0.0, 0.0, 0.0],
                                     hullInertia=[[1.0, 0.0, 0.0],
                                                  [0.0, 1.0, 0.0],
                                                  [0.0, 0.0, 1.0]],
                                     modelType_block=smFlags,
                                     modelParams_block=smTypes,
                                     meIndex=5)
#coefficients = MoveMesh.Coefficients(E=10.0,nu=0.3,g=g,nd=nd,moveMesh=movingDomain)

fixedBoundary = [
    boundaryTags['bottom'], boundaryTags['top'], boundaryTags['front'],
    boundaryTags['back'], boundaryTags['upstream'], boundaryTags['downstream']
]


class TranslatingObstacle(AuxiliaryVariables.AV_base):
    def __init__(self):
        self.current_center = cylinder_center
        self.r = 0.0 * cylinder_radius
예제 #4
0
nMediaTypes = 1
smTypes = numpy.zeros((nMediaTypes + 1, 2), 'd')
smFlags = numpy.zeros((nMediaTypes + 1, ), 'i')

smTypes[0, 0] = 1.0  ##E
smTypes[0, 1] = 0.3  ##nu
smTypes[1, 0] = 1.0  ##E
smTypes[1, 1] = 0.3  ##nu

LevelModelType = MoveMesh.LevelModel
coefficients = MoveMesh.Coefficients(nd=ct.nd,
                                     hullMass=bar_mass,
                                     hullCG=bar_cg,
                                     hullInertia=bar_inertia,
                                     linConstraints=(1, 1, 1),
                                     angConstraints=(1, 1, 1),
                                     V_model=1,
                                     modelType_block=smFlags,
                                     modelParams_block=smTypes,
                                     meIndex=0)


class FloatingObstacle(AuxiliaryVariables.AV_base):
    import numpy as np

    def __init__(self):
        self.object = None

    def attachModel(self, model, ar):
        self.model = model
        return self