Fix: missed inlet/outlet boundary

This commit is contained in:
L-Nafaryus 2021-12-01 16:58:06 +05:00
parent 8df065d5aa
commit 604a877b6e
No known key found for this signature in database
GPG Key ID: EF672A5303B2FA96
4 changed files with 9 additions and 8 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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()