COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
atest-ufem-heat3d-channel.py
Go to the documentation of this file.
1 import sys
2 import coolfluid as cf
3 
4 # Some shortcuts
5 root = cf.Core.root()
6 env = cf.Core.environment()
7 
8 # Global confifuration
9 env.options().set('assertion_throws', False)
10 env.options().set('assertion_backtrace', False)
11 env.options().set('exception_backtrace', False)
12 env.options().set('regist_signal_handlers', False)
13 env.options().set('log_level', 1)
14 
15 # setup a model
16 model = cf.Core.root().create_component('HotModel', 'cf3.solver.Model')
17 domain = model.create_domain()
18 physics = model.create_physics('cf3.UFEM.NavierStokesPhysics')
19 solver = model.create_solver('cf3.UFEM.Solver')
20 hc = solver.add_direct_solver('cf3.UFEM.HeatConductionSteady')
21 
22 # Generate a channel mesh
23 generator = domain.create_component('generator', 'cf3.mesh.BlockMesh.ChannelGenerator')
24 generator.options().set('mesh', cf.URI('//HotModel/Domain/mesh'))
25 generator.options().set('x_segments', 64)
26 generator.options().set('cell_overlap', 1)
27 generator.execute()
28 
29 hc.options().set('regions', [domain.access_component('mesh/topology').uri()])
30 
31 # Boundary conditions
32 bc = hc.get_child('BoundaryConditions')
33 bc.add_constant_bc(region_name = 'left', variable_name = 'Temperature')
34 bc.add_constant_bc(region_name = 'right', variable_name = 'Temperature')
35 bc.get_child('BCleftTemperature').options().set('value', 10)
36 bc.get_child('BCrightTemperature').options().set('value', 35)
37 
38 # run the simulation
39 model.simulate()
40 
41 # print timings
42 model.print_timing_tree()
43 
44 # Write result
45 domain.write_mesh(cf.URI('atest-ufem-heat3d-channel_output.pvtu'))
boost::python::object create_component(ComponentWrapper &self, const std::string &name, const std::string &builder_name)
common::URI uri(ComponentWrapper &self)
Send comments to:
COOLFluiD Web Admin