diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/Allrun b/tutorials/mesh/refineMesh/refineFieldDirs/Allrun deleted file mode 100755 index d67e23ba8c..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/Allrun +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -wmake calcRadiusField -wclean calcRadiusField - -runApplication blockMesh - -##### Procedure for special refinement over Z - -# We need the 0 folder to exist for these steps -mkdir 0 - -# Refine over Z, in 6 passes -for index in 1 2 3 4 5 6; do - - runApplication -s tier$index calcRadiusField - - runApplication -s tier$index \ - topoSet -dict topoSetDict.tier$index - - ## foamToVTK -cellSet tier$index - - runApplication -s tier$index \ - refineMesh -dict refineMeshDict.tier$index -overwrite - - rm -r 0/* - -done - -# Refine over cylindrical coordinates, in 3 passes -for index in 1 2 3; do - - runApplication -s range$index calcRadiusField -calcDirections - - runApplication -s range$index \ - topoSet -dict topoSetDict.range$index - - ## foamToVTK -cellSet tier$index - - runApplication -s range$index \ - refineMesh -dict refineMeshDict.range$index -overwrite - - rm -r 0/* - -done - -#------------------------------------------------------------------------------ diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/Make/files b/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/Make/files deleted file mode 100644 index 70a9508ff5..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -calcRadiusField.C - -EXE = $(FOAM_USER_APPBIN)/calcRadiusField diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/Make/options b/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/Make/options deleted file mode 100644 index fa15f12452..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/Make/options +++ /dev/null @@ -1,5 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = \ - -lfiniteVolume diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/calcRadiusField.C b/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/calcRadiusField.C deleted file mode 100644 index 29fdb81617..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/calcRadiusField/calcRadiusField.C +++ /dev/null @@ -1,164 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Description - Write the volScalarField "radiusFieldXY" that has the distance to the - origin over X,Y. - - And also write the direction fields based on the option "-calcDirections". - The resulting fields are: - - radialDirection - - angularDirection - - heightDirection - - Derived from: - $FOAM_UTILITIES/postProcessing/miscellaneous/writeCellCentres - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "timeSelector.H" -#include "Time.H" -#include "fvMesh.H" -#include "vectorIOField.H" -#include "volFields.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - timeSelector::addOptions(); - #include "addRegionOption.H" - - argList::addBoolOption - ( - "calcDirections", - "calculate the direction fields as well" - ); - - #include "setRootCase.H" - #include "createTime.H" - - const instantList timeDirs = timeSelector::select0(runTime, args); - const bool calcDirections = args.optionFound("calcDirections"); - - #include "createNamedMesh.H" - - forAll(timeDirs, timeI) - { - runTime.setTime(timeDirs[timeI], timeI); - - Info<< "Time = " << runTime.userTimeName() << endl; - - // Check for new mesh - mesh.readUpdate(); - - Info<< "Writing radius field over X,Y in " - << runTime.name() << endl; - - volScalarField radiusFieldXY - ( - IOobject - ( - "radiusFieldXY", - runTime.name(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - sqrt - ( - mesh.C().component(0)*mesh.C().component(0) - + mesh.C().component(1)*mesh.C().component(1) - ) - ); - radiusFieldXY.write(); - - - if(calcDirections) - { - - vectorIOField radialDirection - ( - IOobject - ( - "radialDirection", - runTime.name(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh.C()/magSqr(mesh.C()) - ); - radialDirection.replace(vector::Z, scalar(0)); - radialDirection /= sqrt(magSqr(radialDirection)); - radialDirection.write(); - - - const tensor transform2Tangencial - ( - 0, -1, 0, - 1, 0, 0, - 0, 0, 1 - ); - vectorIOField angularDirection - ( - IOobject - ( - "angularDirection", - runTime.name(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - transform2Tangencial & mesh.C() - ); - angularDirection.replace(vector::Z, scalar(0)); - angularDirection /= sqrt(magSqr(angularDirection)); - angularDirection.write(); - - vectorIOField heightDirection - ( - IOobject - ( - "heightDirection", - runTime.name(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - radialDirection ^ angularDirection - ); - heightDirection.write(); - } - } - - Info<< "\nEnd\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range1 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range1 deleted file mode 100644 index f73cf61f77..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range1 +++ /dev/null @@ -1,62 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set range1; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -//coordinateSystem global; -//coordinateSystem patchLocal; -coordinateSystem fieldBased; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch maxX; // Normal direction is facenormal of zero'th face of patch - e1 (1 -1 0); -} - -// List of directions to refine -directions -( - radialDirection - angularDirection - heightDirection -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range2 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range2 deleted file mode 100644 index 928653a7a5..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range2 +++ /dev/null @@ -1,62 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set range1; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -//coordinateSystem global; -//coordinateSystem patchLocal; -coordinateSystem fieldBased; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch maxX; // Normal direction is facenormal of zero'th face of patch - e1 (1 -1 0); -} - -// List of directions to refine -directions -( - radialDirection - angularDirection - heightDirection -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range3 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range3 deleted file mode 100644 index f73cf61f77..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.range3 +++ /dev/null @@ -1,62 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set range1; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -//coordinateSystem global; -//coordinateSystem patchLocal; -coordinateSystem fieldBased; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch maxX; // Normal direction is facenormal of zero'th face of patch - e1 (1 -1 0); -} - -// List of directions to refine -directions -( - radialDirection - angularDirection - heightDirection -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier1 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier1 deleted file mode 100644 index f2430665bd..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier1 +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set tier1; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -coordinateSystem global; -//coordinateSystem patchLocal; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch outside; // Normal direction is facenormal of zero'th face of patch - e1 (1 0 0); -} - -// List of directions to refine -directions -( - e3 -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier2 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier2 deleted file mode 100644 index 2dd05980e9..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier2 +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set tier2; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -coordinateSystem global; -//coordinateSystem patchLocal; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch outside; // Normal direction is facenormal of zero'th face of patch - e1 (1 0 0); -} - -// List of directions to refine -directions -( - e3 -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier3 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier3 deleted file mode 100644 index 99ab1db741..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier3 +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set tier3; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -coordinateSystem global; -//coordinateSystem patchLocal; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch outside; // Normal direction is facenormal of zero'th face of patch - e1 (1 0 0); -} - -// List of directions to refine -directions -( - e3 -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier4 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier4 deleted file mode 100644 index b19fc09646..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier4 +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set tier4; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -coordinateSystem global; -//coordinateSystem patchLocal; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch outside; // Normal direction is facenormal of zero'th face of patch - e1 (1 0 0); -} - -// List of directions to refine -directions -( - e3 -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier6 b/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier6 deleted file mode 100644 index a79af31387..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier6 +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object refineMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Cells to refine; name of cell set -set tier6; - -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. -coordinateSystem global; -//coordinateSystem patchLocal; - -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) -globalCoeffs -{ - e1 (1 0 0); - e2 (0 1 0); -} - -patchLocalCoeffs -{ - patch outside; // Normal direction is facenormal of zero'th face of patch - e1 (1 0 0); -} - -// List of directions to refine -directions -( - e3 -); - -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. -useHexTopology false; - -// Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology -geometricCut true; - -// Write meshes from intermediate steps -writeMesh false; - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range3 b/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range3 deleted file mode 100644 index 251c6bdfb4..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range3 +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -actions -( - { - name range1; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 3.67; - max 18.47; - } -); - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier2 b/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier2 deleted file mode 100644 index 0bf6fbb454..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier2 +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -actions -( - { - name tier2; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 0.0; - max 1.03; - } -); - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier3 b/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier3 deleted file mode 100644 index f7878f0a16..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier3 +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -actions -( - { - name tier3; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 0.0; - max 1.94; - } -); - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier4 b/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier4 deleted file mode 100644 index fb1217c105..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier4 +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -actions -( - { - name tier4; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 0.0; - max 3.67; - } -); - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier5 b/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier5 deleted file mode 100644 index fd6b7dc826..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier5 +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -actions -( - { - name tier5; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 0.0; - max 7.00; - } -); - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier6 b/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier6 deleted file mode 100644 index 76075c6848..0000000000 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier6 +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -actions -( - { - name tier6; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 0.0; - max 13.36; - } -); - -// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/Allclean b/tutorials/mesh/refineMesh/sector/Allclean similarity index 90% rename from tutorials/mesh/refineMesh/refineFieldDirs/Allclean rename to tutorials/mesh/refineMesh/sector/Allclean index dc74527b02..485ed60fcf 100755 --- a/tutorials/mesh/refineMesh/refineFieldDirs/Allclean +++ b/tutorials/mesh/refineMesh/sector/Allclean @@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions -rm -rf 0 - -cleanCase +cleanCase && rm -rf 0 #------------------------------------------------------------------------------ diff --git a/tutorials/mesh/refineMesh/sector/Allrun b/tutorials/mesh/refineMesh/sector/Allrun new file mode 100755 index 0000000000..72408ed0e5 --- /dev/null +++ b/tutorials/mesh/refineMesh/sector/Allrun @@ -0,0 +1,39 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh + +mkdir 0 + +# Refine in the z direction 6 times +min=0 +for max in 0.64 1.03 1.94 3.67 7.00 13.36 +do + runApplication -s R_z_${min}_to_${max} foamPostProcess -func R + + foamDictionary system/topoSetDict -set "min=$min, max=$max" + runApplication -s z_${min}_to_${max} topoSet + + runApplication -s z_${min}_to_${max} \ + refineMesh -dict refineMeshDict.z -overwrite +done + +# Refine in cylindrical coordinate directions 3 times +max=18.47 +for min in 13.36 7.00 3.67 +do + runApplication -s R_cyl_${min}_to_${max} foamPostProcess -func R + runApplication -s eRThetaZ_cyl_${min}_to_${max} \ + foamPostProcess -func eRThetaZ + + foamDictionary system/topoSetDict -set "min=$min, max=$max" + runApplication -s cyl_${min}_to_${max} topoSet + + runApplication -s cyl_${min}_to_${max} \ + refineMesh -dict refineMeshDict.cyl -overwrite +done + +#------------------------------------------------------------------------------ diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range2 b/tutorials/mesh/refineMesh/sector/system/R similarity index 54% rename from tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range2 rename to tutorials/mesh/refineMesh/sector/system/R index 472c682375..3c1cfed34d 100644 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range2 +++ b/tutorials/mesh/refineMesh/sector/system/R @@ -5,26 +5,32 @@ \\ / A nd | Version: dev \\/ M anipulation | \*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +type coded; -actions -( - { - name range1; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 7.00; - max 18.47; - } -); +libs ("libutilityFunctionObjects.so"); + +name generateAlpha; + +codeInclude +#{ + #include "volFields.H" +#}; + +codeWrite +#{ + const tensor XY(1, 0, 0, 0, 1, 0, 0, 0, 0); + + volScalarField + ( + IOobject + ( + "R", + mesh().time().timeName(), + mesh() + ), + mag(XY & mesh().C()) + ).write(); +#}; // ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict b/tutorials/mesh/refineMesh/sector/system/blockMeshDict similarity index 100% rename from tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict rename to tutorials/mesh/refineMesh/sector/system/blockMeshDict diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/controlDict b/tutorials/mesh/refineMesh/sector/system/controlDict similarity index 100% rename from tutorials/mesh/refineMesh/refineFieldDirs/system/controlDict rename to tutorials/mesh/refineMesh/sector/system/controlDict diff --git a/tutorials/mesh/refineMesh/sector/system/eRThetaZ b/tutorials/mesh/refineMesh/sector/system/eRThetaZ new file mode 100644 index 0000000000..9a3a1b6e79 --- /dev/null +++ b/tutorials/mesh/refineMesh/sector/system/eRThetaZ @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ + +type coded; + +libs ("libutilityFunctionObjects.so"); + +name generateAlpha; + +codeInclude +#{ + #include "volFields.H" +#}; + +codeWrite +#{ + const tensor XY(1, 0, 0, 0, 1, 0, 0, 0, 0); + + const vectorField xy(XY & mesh().C().primitiveField()); + + const vectorField z((tensor::I - XY) & mesh().C().primitiveField()); + const vector zLow(0, 0, 2*min(z.component(2)) - max(z.component(2))); + const vectorField zStar(z - zLow); + + vectorIOField + ( + IOobject("eR", mesh().time().timeName(), mesh()), + xy/mag(xy) + ).write(); + + vectorIOField + ( + IOobject("eTheta", mesh().time().timeName(), mesh()), + (zStar ^ xy)/mag(zStar ^ xy) + ).write(); + + vectorIOField + ( + IOobject("eZ", mesh().time().timeName(), mesh()), + zStar/mag(zStar) + ).write(); +#}; + +// ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range1 b/tutorials/mesh/refineMesh/sector/system/refineMeshDict.cyl similarity index 55% rename from tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range1 rename to tutorials/mesh/refineMesh/sector/system/refineMeshDict.cyl index 399887cfc7..53be8ab64d 100644 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.range1 +++ b/tutorials/mesh/refineMesh/sector/system/refineMeshDict.cyl @@ -9,22 +9,32 @@ FoamFile { format ascii; class dictionary; - object topoSetDict; + object refineMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Name of cell set to refine +set refine; -actions +// Type of coordinate system +coordinateSystem fieldBased; + +// List of directions to refine. These are all vector fields. +directions ( - { - name range1; - type cellSet; - action new; - source fieldToCell; - field radiusFieldXY; - min 13.36; - max 18.47; - } + eR + eTheta + eZ ); +// Whether or not to use hex topology +useHexTopology false; + +// Cut purely geometric (will cut hexes through vertices) or take topology +// into account. Incompatible with useHexTopology. +geometricCut true; + +// Write meshes from intermediate steps +writeMesh false; + // ************************************************************************* // diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier5 b/tutorials/mesh/refineMesh/sector/system/refineMeshDict.z similarity index 55% rename from tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier5 rename to tutorials/mesh/refineMesh/sector/system/refineMeshDict.z index f49f13cd41..9708b31eb8 100644 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/refineMeshDict.tier5 +++ b/tutorials/mesh/refineMesh/sector/system/refineMeshDict.z @@ -13,44 +13,31 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Cells to refine; name of cell set -set tier5; +// Name of cell set to refine +set refine; -// Type of coordinate system: -// - global : coordinate system same for every cell. Usually aligned with -// x,y,z axis. Specify in globalCoeffs section below. -// - patchLocal : coordinate system different for every cell. Specify in -// patchLocalCoeffs section below. +// Type of coordinate system ... coordinateSystem global; -//coordinateSystem patchLocal; -// .. and its coefficients. x,y in this case. (normal direction is calculated -// as e1 ^e2 ) +// ... and its coefficients. x, y in this case. The normal direction is +// calculated as e1^e2. globalCoeffs { e1 (1 0 0); e2 (0 1 0); } -patchLocalCoeffs -{ - patch outside; // Normal direction is facenormal of zero'th face of patch - e1 (1 0 0); -} - // List of directions to refine directions ( e3 ); -// Whether to use hex topology. This will -// - if patchLocal: all cells on selected patch should be hex -// - split all hexes in 2x2x2 through the middle of edges. +// Whether or not to use hex topology useHexTopology false; // Cut purely geometric (will cut hexes through vertices) or take topology -// into account. Incompatible with useHexTopology +// into account. Incompatible with useHexTopology. geometricCut true; // Write meshes from intermediate steps diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier1 b/tutorials/mesh/refineMesh/sector/system/topoSetDict.orig similarity index 83% rename from tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier1 rename to tutorials/mesh/refineMesh/sector/system/topoSetDict.orig index 108cf66d68..b1c0d1fc5a 100644 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/topoSetDict.tier1 +++ b/tutorials/mesh/refineMesh/sector/system/topoSetDict.orig @@ -13,17 +13,19 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +min ; +max ; actions ( { - name tier1; + name refine; type cellSet; action new; - source fieldToCell; - field radiusFieldXY; - min 0.0; - max 0.64; + source fieldToCell; + field R; + min $min; + max $max; } );