예제 #1
0
def applyOverlap():
    if CTK.t == []: return
    CTK.saveTree()
    depth = VARS[7].get()
    depth = int(depth)
    CTK.t = X.applyBCOverlaps(CTK.t, depth=depth)
    CTK.t = X.setDoublyDefinedBC(CTK.t, depth=depth)
    CTK.TXT.insert('START', 'cellN variable modified near overlap BCs.\n')
    CTK.TKTREE.updateApp()
    CTK.display(CTK.t)
예제 #2
0
# - setDoublyDefinedBC (pyTree) -
import Converter.PyTree as C
import Connector.PyTree as X
import Generator.PyTree as G
import KCore.test as test

a = G.cart((0, 0, 0), (1, 1, 1), (10, 10, 10))
b = G.cart((2.5, 2.5, -2.5), (0.5, 0.5, 0.5), (10, 10, 30))
b[0] = 'fente'
a = C.addBC2Zone(a, 'overlap1', 'BCOverlap', 'kmin', [b], 'doubly_defined')
t = C.newPyTree(['Base1', 'Base2'])
t[2][1][2].append(a)
t[2][2][2].append(b)
t[2][1] = C.addState(t[2][1], 'EquationDimension', 3)
t[2][2] = C.addState(t[2][2], 'EquationDimension', 3)
t = C.initVars(t, 'Density', 1.)
t = C.initVars(t, 'centers:Pressure', 1.)
t2 = X.applyBCOverlaps(t, depth=1)
t2 = X.setDoublyDefinedBC(t2, depth=1)
test.testT(t2, 1)
t2 = X.applyBCOverlaps(t, depth=2)
t2 = X.setDoublyDefinedBC(t2, depth=2)
test.testT(t2, 2)
              rangeDonor='doubly_defined')  #dd
#
C._addBC2Zone(b, 'overlap', 'BCOverlap', 'kmax')
C._fillEmptyBCWith(b, "wall", "BCWall")
for rangel in ['imin', 'imax', 'jmin', 'jmax']:
    C._addBC2Zone(b,
                  'overlapdd',
                  'BCOverlap',
                  rangel,
                  zoneDonor=[a],
                  rangeDonor='doubly_defined')

import Converter.elsAProfile as CE
CE._addPeriodicDataInSolverParam(b,
                                 rotationCenter=[0., 0., 0.],
                                 rotationAngle=[0., 0., 1.],
                                 NAzimutalSectors=3,
                                 isChimera=True)
T._rotate(b, (0, 0, 0), (0, 0, 1), 60.)
#
t = C.newPyTree(['Base', a, 'Base2', b])
C._initVars(t, 'Density', 1.)
C._initVars(t, 'centers:cellN', 1)
t = X.applyBCOverlaps(t, depth=1)
t = X.setDoublyDefinedBC(t, depth=1)
t = X.setInterpolations(t,
                        double_wall=1,
                        storage='direct',
                        prefixFile=LOCAL + '/chm')
test.testT(t, 2)
예제 #4
0
# - setDoublyDefinedBC (pyTree) -
import Converter.PyTree as C
import Connector.PyTree as X
import Generator.PyTree as G
import Transform.PyTree as T
import Converter.Internal as Internal
a = G.cart((0, 0, 0), (1, 1, 1), (10, 10, 10))
b = G.cart((2.5, 2.5, -2.5), (0.5, 0.5, 0.5), (10, 10, 30))
b[0] = 'fente'
b = T.splitNParts(b, 2)
C._addBC2Zone(a,
              'overlap1',
              'BCOverlap',
              'kmin',
              zoneDonor=['FamilySpecified:FENTE'],
              rangeDonor='doubly_defined')
t = C.newPyTree(['Base1', 'Base2'])
t[2][1][2].append(a)
t[2][2][2] += b
C._addFamily2Base(t[2][2], 'FENTE')
for z in Internal.getZones(t[2][2]):
    C._tagWithFamily(z, 'FENTE')
C._initVars(t, 'centers:cellN', 1)
t = X.applyBCOverlaps(t)
t = X.setDoublyDefinedBC(t)
C.convertPyTree2File(t, 'out.cgns')