Ejemplo n.º 1
0
                 (0.0, 1.0e-3, 0.0), (0.0, 0.0, 0.1e-3),
                 (20.0e-3, 0.0, 0.1e-3), (20.0e-3, 1.0e-3, 0.1e-3),
                 (0.0, 1.0e-3, 0.1e-3)]
# elements in x -direction
nex = 8
# elements in y -direction
ney = 4
# 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
Ejemplo n.º 2
0
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
vf_frontAndBack = api.EmptyCondition(name='vf_frontAndBack')
vf_frontAndBack.data[CUBA.VARIABLE] = CUBA.VOLUME_FRACTION

inlet = api.Boundary(name='inlet', condition=[vel_inlet, pres_inlet, vf_inlet])
walls = api.Boundary(name='walls', condition=[vel_walls, pres_walls, vf_walls])
atm = api.Boundary(name='atmosphere', condition=[vel_atm, pres_atm,
                                                 vf_atm])
frontAndBack = api.Boundary(name='frontAndBack', condition=[vel_frontAndBack,
Ejemplo n.º 3
0
sm = api.StandardStressModel(name='standard_stress_model')
cuds.add([sm])

rvm = api.SimpleRelativeVelocityModel(name='simple_rel_vel_model')
rvm.diffusion_velocity = (0, -0.002, 0)
rvm.linear_constant = 285.0
cuds.add([rvm])

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

# boundary condtitions
vel_inlet = api.ConstantVelocityCondition((0.0191, 0, 0), water,
                                          name='vel_inlet')
pres_inlet = api.ZeroGradientPressureCondition(0.0, water, name='pres_inlet')
vf_inlet = api.ConstantVolumeFractionCondition(0.001, water, name='vf_inlet')

vel_outlet = api.InletOutletVelocity((0, 0, 0), water, name='vel_outlet')

pres_outlet = api.ConstantPressureCondition(0.0, water, name='pres_outlet')
vf_outlet = api.InletOutletVolumeFraction(0.001, water, name='vf_outlet')

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

vel_top = api.FreeSlipVelocity(name='vel_top')
pres_top = api.ZeroGradientPressureCondition(0.0, water, name='pres_top')
vf_top = api.ZeroGradientVolumeFractionCondition(0.0, water, name='vf_top')
Ejemplo n.º 4
0
# time setting
sim_time = api.IntegrationTime(name='simulation_time',
                               current=0.0,
                               final=150.0,
                               size=0.025)
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')