5 cf.Core.environment().options().set(
'log_level', 4)
9 domain = model.create_domain()
10 physics = model.create_physics(
'cf3.UFEM.NavierStokesPhysics')
11 solver = model.create_solver(
'cf3.UFEM.Solver')
12 hc = solver.add_direct_solver(
'cf3.UFEM.HeatConductionSteady')
16 mesh = domain.load_mesh(file = cf.URI(sys.argv[1]), name =
'Mesh')
18 hc.options().set(
'regions', [mesh.access_component(
'topology').
uri()])
19 hc.children.Update.options.relaxation_factor_hc = 1.
22 bc = hc.get_child(
'BoundaryConditions')
23 bc.add_constant_bc(region_name =
'inlet', variable_name =
'Temperature').options().set(
'value', 10)
24 bc.add_constant_bc(region_name =
'outlet', variable_name =
'Temperature').options().set(
'value', 35)
30 coords = mesh.access_component(
'geometry/coordinates')
31 temperature = mesh.access_component(
'geometry/heat_conduction_solution')
33 for i
in range(len(coords)):
38 for i
in range(len(temperature)):
39 if abs(10. + 25.*(coords[i][0] / length) - temperature[i][0]) > 1e-12:
40 raise Exception(
'Incorrect temperature ' + str(temperature[i][0]) +
' for point ' + str(coords[i][0]))
43 domain.write_mesh(cf.URI(
'atest-quadtriag_output.pvtu'))
boost::python::object create_component(ComponentWrapper &self, const std::string &name, const std::string &builder_name)
common::URI uri(ComponentWrapper &self)