Fix: missed inlet/outlet boundary
This commit is contained in:
parent
8df065d5aa
commit
604a877b6e
@ -146,7 +146,7 @@ class BodyCentered(Periodic):
|
||||
fNorm = self.normal(face)
|
||||
fAngle = self.angle(vecFlow, fNorm)
|
||||
|
||||
if fAngle == 0:
|
||||
if fAngle == 0 or fAngle == numpy.pi:
|
||||
if (face.center.pos() == inletface.center.pos()).prod():
|
||||
face.name = "inlet"
|
||||
|
||||
|
@ -153,7 +153,7 @@ class FaceCentered(Periodic):
|
||||
fNorm = self.normal(face)
|
||||
fAngle = self.angle(vecFlow, fNorm)
|
||||
|
||||
if fAngle == 0:
|
||||
if fAngle == 0 or fAngle == numpy.pi:
|
||||
if (face.center.pos() == inletface.center.pos()).prod():
|
||||
face.name = "inlet"
|
||||
|
||||
|
@ -140,11 +140,11 @@ class Simple(Periodic):
|
||||
for face in self.cell.faces:
|
||||
fNorm = self.normal(face)
|
||||
fAngle = self.angle(vecFlow, fNorm)
|
||||
|
||||
if fAngle == 0:
|
||||
|
||||
if fAngle == 0 or fAngle == numpy.pi:
|
||||
if (face.center.pos() == inletface.center.pos()).prod():
|
||||
face.name = "inlet"
|
||||
|
||||
|
||||
else:
|
||||
face.name = "outlet"
|
||||
|
||||
|
@ -21,7 +21,8 @@ class TestCore(unittest.TestCase):
|
||||
|
||||
self.core = core
|
||||
|
||||
self.outputPath = os.path.join(os.path.abspath("."), "tests/test_core_output")
|
||||
self.currentPath = os.path.abspath(".")
|
||||
self.outputPath = os.path.join(self.currentPath, "tests/test_core_output")
|
||||
os.makedirs(self.outputPath, exist_ok = True)
|
||||
|
||||
def test_config(self):
|
||||
@ -54,12 +55,12 @@ class TestCore(unittest.TestCase):
|
||||
self.assertTrue(path.isfile(path.join(runner.casepath(), "mesh.mesh")))
|
||||
|
||||
runner.computeFlow()
|
||||
#self.assertTrue(path.isfile(path.join(runner.casepath(), "mesh.mesh")))
|
||||
self.assertTrue(path.isfile(path.join(runner.casepath(), "mesh.mesh")))
|
||||
|
||||
os.chdir(pathOld)
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
os.chdir(self.currentPath)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user