Ejemplo n.º 1
0
                               final=0.5,
                               size=1.0e-5)
cuds.add([sim_time])

# solver parameters
sp = api.SolverParameter(name='solver_parameters')
sp.data[CUBA.MAXIMUM_COURANT_NUMBER] = 0.2
cuds.add([sp])

gm = api.GravityModel(name='gravitation')
gm.acceleration = (0, -9.81, 0)
cuds.add([gm])

# boundary conditions
vel_inlet = api.InletOutletVelocity((0, 0, 0), water, name='vel_inlet')
pres_inlet = api.ConstantPressureCondition(0.0, water, name='pres_inlet')
vf_inlet = api.InletOutletVolumeFraction(1.0, water, name='vf_inlet')

vel_atm = api.InletOutletVelocity((0, 0, 0), water, name='vel_atm')
pres_atm = api.ConstantPressureCondition(0.0, water, name='pres_atm')
vf_atm = api.ZeroGradientVolumeFractionCondition(0.0, water, name='vf_atm')

vel_walls = api.ConstantVelocityCondition((0, 0, 0), water, name='vel_walls')
pres_walls = api.ZeroGradientPressureCondition(0.0, water, name='pres_walls')

vf_walls = api.WettingAngle([water, air], contact_angle=45.0, name='vf_walls')

vel_frontAndBack = api.EmptyCondition(name='vel_frontAndBack')
vel_frontAndBack.data[CUBA.VARIABLE] = CUBA.VELOCITY
pres_frontAndBack = api.EmptyCondition(name='pres_frontAndBack')
pres_frontAndBack.data[CUBA.VARIABLE] = CUBA.DYNAMIC_PRESSURE
Ejemplo n.º 2
0
# this routine creates one block quad mesh
#  - boundaries have predescribed names (inlet, walls, outlet, frontAndBack)

mesh = create_quad_mesh(tempfile.mkdtemp(), mesh_name, corner_points, nex, ney,
                        1)
cuds.add([mesh])

vel_inlet = api.ConstantVelocityCondition((0.1, 0, 0), mat, name='vel_inlet')
pres_inlet = api.ZeroGradientPressureCondition(0.0, mat, name='pres_inlet')
vel_inlet.data[CUBA.VARIABLE] = CUBA.VELOCITY
pres_inlet.data[CUBA.VARIABLE] = CUBA.PRESSURE

vel_outlet = api.ZeroGradientVelocityCondition((0.0, 0.0, 0.0),
                                               mat,
                                               name='vel_outlet')
pres_outlet = api.ConstantPressureCondition(0.0, mat, name='pres_outlet')
vel_outlet.data[CUBA.VARIABLE] = CUBA.VELOCITY
pres_outlet.data[CUBA.VARIABLE] = CUBA.PRESSURE

vel_walls = api.ConstantVelocityCondition((0, 0, 0), mat, name='vel_walls')
pres_walls = api.ZeroGradientPressureCondition(0.0, mat, name='pres_walls')
vel_walls.data[CUBA.VARIABLE] = CUBA.VELOCITY
pres_walls.data[CUBA.VARIABLE] = CUBA.PRESSURE

vel_frontAndBack = api.EmptyCondition(name='vel_frontAndBack')
vel_frontAndBack.data[CUBA.VARIABLE] = CUBA.VELOCITY
pres_frontAndBack = api.EmptyCondition(name='pres_frontAndBack')
pres_frontAndBack.data[CUBA.VARIABLE] = CUBA.PRESSURE

inlet = api.Boundary(name='inlet', condition=[vel_inlet, pres_inlet])
walls = api.Boundary(name='walls', condition=[vel_walls, pres_walls])
Ejemplo n.º 3
0
cuds.add([sim_time])

# create mesh
mesh = wrapper.create_block_mesh(tempfile.mkdtemp(), mesh_name,
                                 vortex_shedding_mesh.blockMeshDict)
cuds.add([mesh])

vel_b = [None] * 6
pres_b = [None] * 6
vel_b[0] = api.ConstantVelocityCondition((1.0, 0, 0), mat, name='vel_b0')
pres_b[0] = api.ZeroGradientPressureCondition(0.0, mat, name='pres_b0')

vel_b[1] = api.ZeroGradientVelocityCondition((0.0, 0.0, 0.0),
                                             mat,
                                             name='vel_b1')
pres_b[1] = api.ConstantPressureCondition(0.0, mat, name='pres_b1')

vel_b[2] = api.FreeSlipVelocity(name='vel_b2')
pres_b[2] = api.ZeroGradientPressureCondition(0.0, mat, name='pres_b2')

vel_b[3] = api.FreeSlipVelocity(name='vel_b3')
pres_b[3] = api.ZeroGradientPressureCondition(0.0, mat, name='pres_b3')

vel_b[4] = api.ConstantVelocityCondition((0, 0, 0), mat, name='vel_b4')
pres_b[4] = api.ZeroGradientPressureCondition(0.0, mat, name='pres_b4')

vel_b[5] = api.EmptyCondition(name='vel_b5')
vel_b[5].data[CUBA.VARIABLE] = CUBA.VELOCITY
pres_b[5] = api.EmptyCondition(name='pres_b5')
pres_b[5].data[CUBA.VARIABLE] = CUBA.PRESSURE