COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-solver-actions-twopointcorr.py
Go to the documentation of this file.
1 import coolfluid as cf
2 
3 env = cf.Core.environment()
4 env.log_level = 3
5 
6 root = cf.Core.root()
7 domain = root.create_component('Domain', 'cf3.mesh.Domain')
8 mesh = domain.create_component('OriginalMesh','cf3.mesh.Mesh')
9 
10 blocks = root.create_component('model', 'cf3.mesh.BlockMesh.BlockArrays')
11 points = blocks.create_points(dimensions = 2, nb_points = 4)
12 points[0] = [0., 0.]
13 points[1] = [1., 0.]
14 points[2] = [1., 1.]
15 points[3] = [0., 1.]
16 block_nodes = blocks.create_blocks(1)
17 block_nodes[0] = [0, 1, 2, 3]
18 block_subdivs = blocks.create_block_subdivisions()
19 block_subdivs[0] = [16,16]
20 gradings = blocks.create_block_gradings()
21 gradings[0] = [1., 1., 1., 1.]
22 blocks.create_patch_nb_faces(name = 'bottom', nb_faces = 1)[0] = [0, 1]
23 blocks.create_patch_nb_faces(name = 'right', nb_faces = 1)[0] = [1, 2]
24 blocks.create_patch_nb_faces(name = 'top', nb_faces = 1)[0] = [2, 3]
25 blocks.create_patch_nb_faces(name = 'left', nb_faces = 1)[0] = [3, 0]
26 blocks.extrude_blocks(positions=[1.], nb_segments=[4], gradings=[1.])
27 blocks.partition_blocks(nb_partitions = cf.Core.nb_procs(), direction = 0)
28 blocks.create_mesh(mesh.uri())
29 
30 coords = mesh.geometry.coordinates
31 for i in range(len(coords)):
32  coords[i][0] += 1
33  coords[i][1] += 1
34  coords[i][2] += 1
35 
36 corr = domain.create_component('TwoPointCorrelation', 'cf3.solver.actions.TwoPointCorrelation')
37 corr.normal = 0
38 corr.field = coords
39 corr.coordinate = 1.75
40 corr.file = cf.URI('two-point-correlation01-{iteration}.txt')
41 corr.interval = 5
42 
43 corr2 = domain.create_component('TwoPointCorrelation', 'cf3.solver.actions.TwoPointCorrelation')
44 corr2.normal = 1
45 corr2.field = coords
46 corr2.coordinate = 1.75
47 corr2.file = cf.URI('two-point-correlation02-{iteration}.txt')
48 corr2.interval = 10
49 
50 for i in range(20):
51  corr.execute()
52  corr2.execute()
Send comments to:
COOLFluiD Web Admin