From 81ec2012be0133d0aed90029becb2fb097004f75 Mon Sep 17 00:00:00 2001 From: Jakub Knir Date: Tue, 9 Feb 2021 15:13:33 +0000 Subject: [PATCH] titaniaSynthesis: Removed blockMeshDict.m4 and replaced by titaniaSynthesis dictionary. --- .../laminar/titaniaSynthesis/Allrun | 3 +- .../laminar/titaniaSynthesisSurface/Allrun | 3 +- .../system/blockMeshDict.m4 | 136 ------------------ .../blockMesh/titaniaSynthesis} | 62 +++----- 4 files changed, 20 insertions(+), 184 deletions(-) delete mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/blockMeshDict.m4 rename tutorials/{multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/blockMeshDict.m4 => resources/blockMesh/titaniaSynthesis} (58%) diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/Allrun b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/Allrun index e9e7ce4097..79596b1f1d 100755 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/Allrun +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/Allrun @@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # run from this directory # Set application name application=$(getApplication) -m4 system/blockMeshDict.m4 > system/blockMeshDict -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/titaniaSynthesis runApplication topoSet runApplication decomposePar runParallel $application diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/Allrun b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/Allrun index e9e7ce4097..79596b1f1d 100755 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/Allrun +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/Allrun @@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # run from this directory # Set application name application=$(getApplication) -m4 system/blockMeshDict.m4 > system/blockMeshDict -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/titaniaSynthesis runApplication topoSet runApplication decomposePar runParallel $application diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/blockMeshDict.m4 b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/blockMeshDict.m4 deleted file mode 100644 index e758cc467e..0000000000 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/blockMeshDict.m4 +++ /dev/null @@ -1,136 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// General m4 macros - -changecom(//)changequote([,]) -define(calc, [esyscmd(perl -e 'print ($1)')]) -define(VCOUNT, 0) -define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) -define(pi, 3.1415926536) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// User-defined parameters - -convertToMeters 1; - -// Pipe radius (z-axis) -define(radius, 0.015875) - -// Pipe length (x-axis) -define(length, 0.44) - -// Center (wedge) angle -define(angle, 1) - -// Axis origin -define(x0, 0.0) -define(y0, 0.0) -define(z0, 0.0) - -// Number of cells -define(nx, 220) -define(ny, 1) -define(nz, 16) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Derived parameters - -define(deg,angle/2) -define(zr,calc(z0 + (radius*cos((pi/180)*deg)))) -define(yp,calc(y0 + (radius*sin((pi/180)*deg)))) -define(ym,calc(y0 - (radius*sin((pi/180)*deg)))) -define(xl,calc(x0 + length)) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Parametric description - -vertices -( - (x0 y0 z0) - (xl y0 z0) - (xl y0 z0) - (x0 y0 z0) - (x0 ym zr) - (xl ym zr) - (xl yp zr) - (x0 yp zr) -); - -blocks -( - hex (0 1 1 0 4 5 6 7) (nx ny nz) simpleGrading (1 1 1) -); - -edges -(); - -boundary -( - inlet - { - type patch; - faces - ( - (0 4 7 0) - ); - } - outlet - { - type patch; - faces - ( - (1 1 6 5) - ); - } - walls - { - type wall; - faces - ( - (4 5 6 7) - ); - } - front - { - type wedge; - faces - ( - (0 1 5 4) - ); - } - back - { - type wedge; - faces - ( - (0 7 6 1) - ); - } - axis - { - type empty; - faces - ( - (0 0 1 1) - ); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/blockMeshDict.m4 b/tutorials/resources/blockMesh/titaniaSynthesis similarity index 58% rename from tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/blockMeshDict.m4 rename to tutorials/resources/blockMesh/titaniaSynthesis index e758cc467e..c552ab197c 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/blockMeshDict.m4 +++ b/tutorials/resources/blockMesh/titaniaSynthesis @@ -13,65 +13,39 @@ FoamFile object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// General m4 macros - -changecom(//)changequote([,]) -define(calc, [esyscmd(perl -e 'print ($1)')]) -define(VCOUNT, 0) -define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) -define(pi, 3.1415926536) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// User-defined parameters - convertToMeters 1; -// Pipe radius (z-axis) -define(radius, 0.015875) - -// Pipe length (x-axis) -define(length, 0.44) - -// Center (wedge) angle -define(angle, 1) - -// Axis origin -define(x0, 0.0) -define(y0, 0.0) -define(z0, 0.0) +radius 0.015875; // Pipe radius (z-axis) +length 0.44; // Pipe length (x-axis) +angle 1; // Center (wedge) angle // Number of cells -define(nx, 220) -define(ny, 1) -define(nz, 16) +xCells 220; +yCells 1; +zCells 16; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Derived parameters - -define(deg,angle/2) -define(zr,calc(z0 + (radius*cos((pi/180)*deg)))) -define(yp,calc(y0 + (radius*sin((pi/180)*deg)))) -define(ym,calc(y0 - (radius*sin((pi/180)*deg)))) -define(xl,calc(x0 + length)) +zr #calc "$radius*cos(degToRad(0.5*$angle))"; +halfWidth #calc "$radius*sin(degToRad(0.5*$angle))"; +negHalfWidth #neg $halfWidth; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Parametric description vertices ( - (x0 y0 z0) - (xl y0 z0) - (xl y0 z0) - (x0 y0 z0) - (x0 ym zr) - (xl ym zr) - (xl yp zr) - (x0 yp zr) + (0.0 0.0 0.0) + ($length 0.0 0.0) + ($length 0.0 0.0) + (0.0 0.0 0.0) + (0.0 $negHalfWidth $zr) + ($length $negHalfWidth $zr) + ($length $halfWidth $zr) + (0.0 $halfWidth $zr) ); blocks ( - hex (0 1 1 0 4 5 6 7) (nx ny nz) simpleGrading (1 1 1) + hex (0 1 1 0 4 5 6 7) ($xCells $yCells $zCells) simpleGrading (1 1 1) ); edges