From 93990fe053b9f7de781187932c08a0cce694cfda Mon Sep 17 00:00:00 2001 From: L-Nafaryus Date: Thu, 10 Jun 2021 16:58:43 +0500 Subject: [PATCH] Mod: disable viscous layers --- bin/anisotropy | 12 +++++++----- conf/config.toml | 11 +++++++---- salomepl/mesh.py | 37 +++++++++++++++++++++---------------- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/bin/anisotropy b/bin/anisotropy index cc29e16..ce892d0 100755 --- a/bin/anisotropy +++ b/bin/anisotropy @@ -37,16 +37,18 @@ case $1 in source ${OPENFOAM} source env/bin/activate - mkdir ${DIR}/build && echo $$ >${DIR}/build/anisotropy.pid + mkdir "${DIR}/build" + echo $$ >"${DIR}/build/anisotropy.pid" - python ${DIR}/anisotropy/anisotropy.py ${@:2} + python "${DIR}/anisotropy/anisotropy.py" ${@:2} deactivate + + rm "${DIR}/build/anisotropy.pid" ;; kill) - pid="${DIR}/build/anisotropy.pid" - kill -9 $(cat $pid) - rm $pid + pkill -TERM -P $(cat "${DIR}/build/anisotropy.pid") + rm "${DIR}/build/anisotropy.pid" ;; help) diff --git a/conf/config.toml b/conf/config.toml index c5c793e..0975b2b 100644 --- a/conf/config.toml +++ b/conf/config.toml @@ -11,7 +11,7 @@ name = "anisotropy" format = "%(levelname)s: %(message)s" [base] -simple = true +simple = true bodyCentered = true faceCentered = true @@ -30,7 +30,7 @@ directions = [ fillet = true [simple.mesh] -fineness = 1 +fineness = 2 minSize = 0.01 maxSize = 0.1 growthRate = 0.5 @@ -45,6 +45,7 @@ useSurfaceCurvature = true fuseEdges = true checkChartBoundary = false +viscousLayers = false thickness = [0.01, 0.005] numberOfLayers = 2 stretchFactor = 1.2 @@ -65,7 +66,7 @@ directions = [ fillet = true [bodyCentered.mesh] -fineness = 1 +fineness = 2 minSize = 0.005 maxSize = 0.05 growthRate = 0.5 @@ -80,6 +81,7 @@ useSurfaceCurvature = true fuseEdges = true checkChartBoundary = false +viscousLayers = false thickness = [0.005, 0.001] numberOfLayers = 2 stretchFactor = 1.2 @@ -100,7 +102,7 @@ directions = [ fillet = true [faceCentered.mesh] -fineness = 1 +fineness = 2 minSize = 0.005 maxSize = 0.05 growthRate = 0.5 @@ -115,6 +117,7 @@ useSurfaceCurvature = true fuseEdges = true checkChartBoundary = false +viscousLayers = false thickness = [0.001, 0.0005] numberOfLayers = 2 stretchFactor = 1.2 diff --git a/salomepl/mesh.py b/salomepl/mesh.py index cdf1c82..1c45e65 100644 --- a/salomepl/mesh.py +++ b/salomepl/mesh.py @@ -88,23 +88,28 @@ def meshCreate(shape, parameters): #fineness, parameters, viscousLayers = None): ### # Viscous layers ## - vlayer = netgen.ViscousLayers( - parameters.thickness, - parameters.numberOfLayers, - parameters.stretchFactor, - parameters.facesToIgnore, - parameters.isFacesToIgnore, - parameters.extrusionMethod - ) + if parameters.viscousLayers: + vlayer = netgen.ViscousLayers( + parameters.thickness, + parameters.numberOfLayers, + parameters.stretchFactor, + parameters.facesToIgnore, + parameters.isFacesToIgnore, + parameters.extrusionMethod + ) - logger.info("""meshCreate: -viscous layers: - thickness:\t{} - number:\t{} - stretch factor:\t{}""".format( - parameters.thickness, - parameters.numberOfLayers, - parameters.stretchFactor)) + logger.info("""meshCreate: + viscous layers: + thickness:\t{} + number:\t{} + stretch factor:\t{}""".format( + parameters.thickness, + parameters.numberOfLayers, + parameters.stretchFactor)) + + else: + logger.info("""meshCreate: + viscous layers: false""") return mesh