zeroDimensionalFvMesh: New utility to create zero dimensional mesh

This utility can be run with no arguments or configuration, and will
create a unit cube mesh with empty patches on all sides.
This commit is contained in:
Will Bainbridge
2023-01-26 14:39:08 +00:00
parent 1b80fd35e4
commit 099505df9c
21 changed files with 77 additions and 396 deletions

View File

@ -0,0 +1,3 @@
zeroDimensionalMesh.C
EXE = $(FOAM_APPBIN)/zeroDimensionalMesh

View File

@ -0,0 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 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 <http://www.gnu.org/licenses/>.
Application
zeroDimensionalMesh
Description
Creates a zero-dimensional mesh
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "zeroDimensionalFvMesh.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::noParallel();
#include "setRootCase.H"
#include "createTime.H"
fvMesh mesh(zeroDimensionalFvMesh(runTime));
mesh.setInstance(runTime.constant());
mesh.write();
Info<< "End" << nl << endl;
return 0;
}
// ************************************************************************* //

View File

@ -9,7 +9,7 @@ cd ${0%/*} || exit 1
gYs="air.gas H2O.gas C3H8O.gas"
lYs="H2O.liquid C3H8O.liquid"
runApplication blockMesh
runApplication zeroDimensionalMesh
setInertY()
{

View File

@ -1,47 +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 blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-1 -1 -1)
(1 -1 -1)
(1 1 -1)
(-1 1 -1)
(-1 -1 1)
(1 -1 1)
(1 1 1)
(-1 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
defaultPatch
{
name defaultPatch;
type empty;
}
boundary
(
);
// ************************************************************************* //

View File

@ -47,7 +47,7 @@ setThermoAndEnergy()
constant/physicalProperties.$phase
}
runApplication blockMesh
runApplication zeroDimensionalMesh
for gY in $gYs
do

View File

@ -1,47 +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 blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-1 -1 -1)
(1 -1 -1)
(1 1 -1)
(-1 1 -1)
(-1 -1 1)
(1 -1 1)
(1 1 1)
(-1 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
defaultPatch
{
name defaultPatch;
type empty;
}
boundary
(
);
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit 1
# Source run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication zeroDimensionalMesh
runApplication $(getApplication)
( cd validation && ./createGraphs )

View File

@ -1,41 +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;
location "system";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 1)
(1 0 1)
(1 1 1)
(0 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
boundary
(
);
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit 1
# Source run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication zeroDimensionalMesh
runApplication $(getApplication)
( cd validation && ./createGraphs )

View File

@ -1,41 +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;
location "system";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 1)
(1 0 1)
(1 1 1)
(0 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
boundary
(
);
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit 1
# Source run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication zeroDimensionalMesh
runApplication $(getApplication)
( cd validation && ./createGraphs )

View File

@ -1,41 +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;
location "system";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 1)
(1 0 1)
(1 1 1)
(0 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
boundary
(
);
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit 1
# Source run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication zeroDimensionalMesh
runApplication $(getApplication)
( cd validation && ./createGraphs )

View File

@ -1,41 +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;
location "system";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 1)
(1 0 1)
(1 1 1)
(0 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
boundary
(
);
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit 1
# Source run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication zeroDimensionalMesh
runApplication $(getApplication)
( cd validation && ./createGraphs )

View File

@ -1,41 +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;
location "system";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 1)
(1 0 1)
(1 1 1)
(0 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
boundary
(
);
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit 1
# Source run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication zeroDimensionalMesh
runApplication $(getApplication)
( cd validation && ./createGraphs )

View File

@ -1,41 +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;
location "system";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 1)
(1 0 1)
(1 1 1)
(0 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
boundary
(
);
// ************************************************************************* //

View File

@ -25,7 +25,7 @@ setThermoAndEnergy()
constant/physicalProperties.$phase
}
runApplication blockMesh
runApplication zeroDimensionalMesh
for gHe in $gHes
do

View File

@ -1,47 +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 blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-1 -1 -1)
(1 -1 -1)
(1 1 -1)
(-1 1 -1)
(-1 -1 1)
(1 -1 1)
(1 1 1)
(-1 1 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
defaultPatch
{
name defaultPatch;
type empty;
}
boundary
(
);
// ************************************************************************* //