COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
atest-ufem-heat3d-sphere.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 mesh = domain.load_mesh(file = cf.URI(sys.argv[1]), name = 'Mesh')
24 
25 hc.options().set('regions', [mesh.access_component('topology').uri()])
26 
27 # Boundary conditions
28 bc = hc.get_child('BoundaryConditions')
29 bc.add_constant_bc(region_name = 'inner', variable_name = 'Temperature')
30 bc.add_constant_bc(region_name = 'outer', variable_name = 'Temperature')
31 bc.get_child('BCinnerTemperature').options().set('value', 10)
32 bc.get_child('BCouterTemperature').options().set('value', 35)
33 
34 # run the simulation
35 model.simulate()
36 
37 # print timings
38 model.print_timing_tree()
39 
40 # Write result
41 domain.write_mesh(cf.URI('atest-ufem-heat3d-sphere_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