cuds.add([cfd])

# time setting
sim_time = api.IntegrationTime(name='simulation_time',
                               current=0.0,
                               final=0.3,
                               size=0.0001)
cuds.add([sim_time])

end = time.time()
print "Time spend in initialization: ", end - start

start = time.time()
# create computational mesh
mesh = foam_controlwrapper.create_block_mesh(tempfile.mkdtemp(), mesh_name,
                                             pipe_mesh.blockMeshDict)
end = time.time()
print "Time spend in blockmesh: ", end - start

start = time.time()
cuds.add([mesh])
end = time.time()
print "Time spend in add mesh to cuds: ", end - start

start = time.time()
# boundary conditions
vel_inlet = api.Dirichlet(foam, name='vel_inlet')
vel_inlet.data[CUBA.VARIABLE] = CUBA.VELOCITY
vel_inlet.data[CUBA.VELOCITY] = (0, 0, 0.53)
pres_inlet = api.Neumann(foam, name='pres_inlet')
pres_inlet.data[CUBA.VARIABLE] = CUBA.PRESSURE
sim_time = api.IntegrationTime(name='simulation_time',
                               current=0.0,
                               final=1000,
                               size=1)
cuds.add([sim_time])

sol_par = api.SolverParameter(name='steady_state')
sol_par.data[CUBA.STEADY_STATE] = True
cuds.add([sol_par])

end = time.time()
print "Time spend in initialization: ", end-start

start = time.time()
# create computational mesh
mesh = create_block_mesh(tempfile.mkdtemp(), mesh_name,
                         pipe_mesh.blockMeshDict)
end = time.time()
print "Time spend in blockmesh: ", end-start

start = time.time()
cuds.add([mesh])
end = time.time()
print "Time spend in add mesh to cuds: ", end-start

start = time.time()
# boundary conditions
vel_inlet = api.Dirichlet(foam, name='vel_inlet')
vel_inlet.data[CUBA.VARIABLE] = CUBA.VELOCITY
vel_inlet.data[CUBA.VELOCITY] = (0, 0, 0.53)
pres_inlet = api.Neumann(foam, name='pres_inlet')
pres_inlet.data[CUBA.VARIABLE] = CUBA.PRESSURE
cfd.rheology_model = hb

cuds.add([cfd])


sol_par = api.SolverParameter(name='steady_state')
sol_par.data[CUBA.STEADY_STATE] = True
cuds.add([sol_par])

end = time.time()
print "Time spend in initialization: ", end-start

start = time.time()
# create computational mesh
mesh = foam_controlwrapper.create_block_mesh(tempfile.mkdtemp(), mesh_name,
                                             slit_mesh.blockMeshDict)
end = time.time()
print "Time spend in blockmesh: ", end-start

start = time.time()
cuds.add([mesh])
end = time.time()
print "Time spend in add mesh to cuds: ", end-start

start = time.time()
# boundary conditions
vel_inlet = api.Dirichlet(foam, name='vel_inlet')
vel_inlet.data[CUBA.VARIABLE] = CUBA.VELOCITY
vel_inlet.data[CUBA.VELOCITY] = (0.53, 0, 0)
pres_inlet = api.Neumann(foam, name='pres_inlet')
pres_inlet.data[CUBA.VARIABLE] = CUBA.PRESSURE
sim_time = api.IntegrationTime(name='simulation_time',
                               current=0.0,
                               final=1000,
                               size=1)
cuds.add([sim_time])

sol_par = api.SolverParameter(name='steady_state')
sol_par.data[CUBA.STEADY_STATE] = True
cuds.add([sol_par])

end = time.time()
print "Time spend in initialization: ", end-start

start = time.time()
# create computational mesh
mesh = create_block_mesh(tempfile.mkdtemp(), mesh_name,
                         pipe_mesh.blockMeshDict)
end = time.time()
print "Time spend in blockmesh: ", end-start

start = time.time()
cuds.add([mesh])
end = time.time()
print "Time spend in add mesh to cuds: ", end-start

start = time.time()
# boundary conditions
vel_inlet = api.Dirichlet(foam, name='vel_inlet')
vel_inlet.data[CUBA.VARIABLE] = CUBA.VELOCITY
vel_inlet.data[CUBA.VELOCITY] = (0, 0, 0.53)
pres_inlet = api.Neumann(foam, name='pres_inlet')
pres_inlet.data[CUBA.VARIABLE] = CUBA.PRESSURE
예제 #5
0
# material
mat = api.Material(name='a_material')
mat.data[CUBA.DENSITY] = 1.0
mat.data[CUBA.DYNAMIC_VISCOSITY] = 2.0e-2
cuds.add([mat])

# 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')
예제 #6
0
# material
mat = api.Material(name='a_material')
mat.data[CUBA.DENSITY] = 1.0
mat.data[CUBA.DYNAMIC_VISCOSITY] = 2.0e-2
cuds.add([mat])

# 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')