ENH: improve codeTemplates

- meshTools include/library for many (most) coded items

- add PatchFunction1 include for coded BCs to provide ready access
  to Function1 and PatchFunction1
This commit is contained in:
Mark Olesen
2021-06-01 12:07:20 +02:00
parent 2f6739b140
commit b0891824fa
28 changed files with 289 additions and 220 deletions

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -59,7 +59,6 @@ maxCo 1.2;
functions
{
// #include "catalyst"
probes
{
type probes;
@ -82,7 +81,6 @@ functions
(
(0.015 0.005 0.005)
);
}
mass
@ -114,12 +112,10 @@ functions
codeWrite
#{
const volScalarField& rho =
mesh().lookupObject<volScalarField>("rho");
Info<< "rho volume = " << rho.weightedAverage(mesh().Vsc()) << endl;
#};
}
}

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -24,19 +24,14 @@ functions
libs (utilityFunctionObjects);
enabled yes;
codeInclude
#{
#include "volFields.H"
#};
codeWrite
#{
scalar D = 0.57;
scalar UInf = 50;
scalar pInf = 101325;
scalar TInf = 224;
scalar gamma = 1.4;
scalar A = -0.3*D*UInf;
const scalar D = 0.57;
const scalar UInf = 50;
const scalar pInf = 101325;
const scalar TInf = 224;
const scalar gamma = 1.4;
const scalar A = -0.3*D*UInf;
const dimensionedScalar rhoRef("rhoRef", dimDensity, 1);
const auto& rho = mesh().lookupObject<volScalarField>("rho");