Compare commits
37 Commits
develop.me
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| 45fe65f83e | |||
| cdce0585f2 | |||
| 714040678a | |||
| b8ec4e12e1 | |||
| e9a9d4c297 | |||
| c6a651cc46 | |||
| be3eee6c12 | |||
| 07fd1aec5b | |||
| 7f646223bb | |||
| c24a8c26ee | |||
| d88d1d53aa | |||
| 74248c7469 | |||
| 70873eb647 | |||
| 219c520f0b | |||
| ad00fed4aa | |||
| 198a215445 | |||
| c8da996ace | |||
| 1e3cf9630e | |||
| e35df56231 | |||
| 1c0af6ecbc | |||
| d36f988d97 | |||
| 680baba1b5 | |||
| 346770e0d9 | |||
| b28502b3a8 | |||
| 9e123313a7 | |||
| 92fa08cf12 | |||
| 21301e3aba | |||
| c9b6b090ca | |||
| 838d6bc0b0 | |||
| 5dbd697db5 | |||
| a0721f7d00 | |||
| 68fe3cc35c | |||
| 860b7f503d | |||
| 2ba590ec0b | |||
| 84aa61e650 | |||
| e9df8d9366 | |||
| 4645a440e1 |
9
META-INFO/.gitignore
vendored
Normal file
9
META-INFO/.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Do not track build information
|
||||||
|
build-info
|
||||||
|
|
||||||
|
# Do not track time-stamp
|
||||||
|
time-stamp
|
||||||
|
|
||||||
|
# Do not track any manifest files
|
||||||
|
Manifest.txt
|
||||||
|
manifest.txt
|
||||||
5
META-INFO/README.md
Normal file
5
META-INFO/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# META-INFO
|
||||||
|
|
||||||
|
Meta-information is for OpenFOAM internal use only.
|
||||||
|
|
||||||
|
(Backport from 1812)
|
||||||
2
META-INFO/api-info
Normal file
2
META-INFO/api-info
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
api=1706
|
||||||
|
patch=180618
|
||||||
@ -16,17 +16,20 @@
|
|||||||
|
|
||||||
fvOptions.constrain(UEqn);
|
fvOptions.constrain(UEqn);
|
||||||
|
|
||||||
solve
|
if (momentumPredictor)
|
||||||
(
|
{
|
||||||
UEqn
|
solve
|
||||||
==
|
|
||||||
fvc::reconstruct
|
|
||||||
(
|
(
|
||||||
|
UEqn
|
||||||
|
==
|
||||||
|
fvc::reconstruct
|
||||||
(
|
(
|
||||||
- ghf*fvc::snGrad(rho)
|
(
|
||||||
- fvc::snGrad(p_rgh)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*mesh.magSf()
|
- fvc::snGrad(p_rgh)
|
||||||
)
|
)*mesh.magSf()
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
|
}
|
||||||
|
|||||||
@ -2,3 +2,6 @@
|
|||||||
|
|
||||||
const int nNonOrthCorr =
|
const int nNonOrthCorr =
|
||||||
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||||
|
|
||||||
|
const bool momentumPredictor =
|
||||||
|
simple.lookupOrDefault("momentumPredictor", true);
|
||||||
|
|||||||
@ -15,12 +15,16 @@
|
|||||||
)
|
)
|
||||||
: -dpdt
|
: -dpdt
|
||||||
)
|
)
|
||||||
- fvm::laplacian(alphaEff, he)
|
|
||||||
==
|
==
|
||||||
radiation->Sh(thermo, he)
|
radiation->Sh(thermo, he)
|
||||||
+ fvOptions(rho, he)
|
+ fvOptions(rho, he)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (turbulence.valid())
|
||||||
|
{
|
||||||
|
EEqn -= fvm::laplacian(turbulence->alphaEff(), he);
|
||||||
|
}
|
||||||
|
|
||||||
EEqn.relax();
|
EEqn.relax();
|
||||||
|
|
||||||
fvOptions.constrain(EEqn);
|
fvOptions.constrain(EEqn);
|
||||||
|
|||||||
@ -35,7 +35,31 @@ volVectorField U
|
|||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
#include "setAlphaEff.H"
|
autoPtr<compressible::turbulenceModel> turbulence;
|
||||||
|
|
||||||
|
IOobject turbulencePropertiesHeader
|
||||||
|
(
|
||||||
|
"turbulenceProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))
|
||||||
|
{
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
|
||||||
|
turbulence =
|
||||||
|
compressible::turbulenceModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#include "createDpdt.H"
|
#include "createDpdt.H"
|
||||||
|
|
||||||
|
|||||||
@ -1,47 +0,0 @@
|
|||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
tmp<volScalarField> talphaEff;
|
|
||||||
|
|
||||||
IOobject turbulencePropertiesHeader
|
|
||||||
(
|
|
||||||
"turbulenceProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))
|
|
||||||
{
|
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::turbulenceModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
talphaEff = turbulence->alphaEff();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
talphaEff = tmp<volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"alphaEff",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("0", dimMass/dimLength/dimTime, 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -54,8 +54,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|
||||||
const volScalarField& alphaEff = talphaEff();
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nEvolving thermodynamics\n" << endl;
|
Info<< "\nEvolving thermodynamics\n" << endl;
|
||||||
|
|||||||
@ -23,3 +23,8 @@ bool ddtCorr
|
|||||||
(
|
(
|
||||||
pimple.dict().lookupOrDefault("ddtCorr", true)
|
pimple.dict().lookupOrDefault("ddtCorr", true)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
bool adjustFringe
|
||||||
|
(
|
||||||
|
pimple.dict().lookupOrDefault("oversetAdjustPhi", false)
|
||||||
|
);
|
||||||
|
|||||||
@ -53,6 +53,7 @@ Description
|
|||||||
#include "interpolationCellPoint.H"
|
#include "interpolationCellPoint.H"
|
||||||
#include "transform.H"
|
#include "transform.H"
|
||||||
#include "fvMeshSubset.H"
|
#include "fvMeshSubset.H"
|
||||||
|
#include "oversetAdjustPhi.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createControl.H"
|
pimpleControl pimple(mesh);
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createDyMControls.H"
|
#include "createDyMControls.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
|
|||||||
@ -38,6 +38,13 @@
|
|||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
if (adjustFringe)
|
||||||
|
{
|
||||||
|
fvc::makeRelative(phiHbyA, U);
|
||||||
|
oversetAdjustPhi(phiHbyA, U);
|
||||||
|
fvc::makeAbsolute(phiHbyA, U);
|
||||||
|
}
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
// Update the pressure BCs to ensure flux consistency
|
||||||
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
|
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
|
||||||
|
|
||||||
@ -64,7 +71,8 @@
|
|||||||
"minGradP",
|
"minGradP",
|
||||||
fvc::reconstruct((phig - p_rghEqn.flux())/rAUf)
|
fvc::reconstruct((phig - p_rghEqn.flux())/rAUf)
|
||||||
);
|
);
|
||||||
U = HbyA + rAU*cellMask*minGradP;
|
//U = HbyA + rAU*cellMask*minGradP;
|
||||||
|
U = fvc::reconstruct(phi);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,5 +11,6 @@ moveMeshOuterCorrectors =
|
|||||||
massFluxInterpolation =
|
massFluxInterpolation =
|
||||||
pimple.dict().lookupOrDefault("massFluxInterpolation", false);
|
pimple.dict().lookupOrDefault("massFluxInterpolation", false);
|
||||||
|
|
||||||
ddtCorr =
|
ddtCorr = pimple.dict().lookupOrDefault("ddtCorr", true);
|
||||||
pimple.dict().lookupOrDefault("ddtCorr", true);
|
|
||||||
|
adjustFringe = pimple.dict().lookupOrDefault("oversetAdjustPhi", false);
|
||||||
|
|||||||
@ -63,7 +63,7 @@ Foam::dragModels::Ergun::~Ergun()
|
|||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
|
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(4/3)
|
(4.0/3.0)
|
||||||
*(
|
*(
|
||||||
150
|
150
|
||||||
*max
|
*max
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::CdRe() const
|
|||||||
);
|
);
|
||||||
|
|
||||||
return
|
return
|
||||||
(4/3)
|
(4.0/3.0)
|
||||||
*(17.3/alpha2 + 0.336*pair_.Re())
|
*(17.3/alpha2 + 0.336*pair_.Re())
|
||||||
*max(pair_.continuous(), pair_.continuous().residualAlpha())
|
*max(pair_.continuous(), pair_.continuous().residualAlpha())
|
||||||
*pow(alpha2, -2.8);
|
*pow(alpha2, -2.8);
|
||||||
|
|||||||
@ -63,7 +63,7 @@ Foam::dragModels::Ergun::~Ergun()
|
|||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
|
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(4/3)
|
(4.0/3.0)
|
||||||
*(
|
*(
|
||||||
150
|
150
|
||||||
*max
|
*max
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::CdRe() const
|
|||||||
);
|
);
|
||||||
|
|
||||||
return
|
return
|
||||||
(4/3)
|
(4.0/3.0)
|
||||||
*(17.3/alpha2 + 0.336*pair_.Re())
|
*(17.3/alpha2 + 0.336*pair_.Re())
|
||||||
*max(pair_.continuous(), pair_.continuous().residualAlpha())
|
*max(pair_.continuous(), pair_.continuous().residualAlpha())
|
||||||
*pow(alpha2, -2.8);
|
*pow(alpha2, -2.8);
|
||||||
|
|||||||
@ -45,7 +45,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "addToolOption.H"
|
#include "addToolOption.H"
|
||||||
|
|
||||||
// Intercept request for help
|
// Intercept request for help
|
||||||
if ((argc > 0) && (strcmp(argv[1], "-help") == 0))
|
if ((argc > 1) && (strcmp(argv[1], "-help") == 0))
|
||||||
{
|
{
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,7 +91,7 @@ void Foam::tabulatedWallFunctions::SpaldingsLaw::invertFunction()
|
|||||||
(
|
(
|
||||||
2*E_*uPlus
|
2*E_*uPlus
|
||||||
+ exp(kUPlus)*(kUPlus + 1)
|
+ exp(kUPlus)*(kUPlus + 1)
|
||||||
- 2/3*pow3(kUPlus)
|
- 2.0/3.0*pow3(kUPlus)
|
||||||
- 1.5*sqr(kUPlus)
|
- 1.5*sqr(kUPlus)
|
||||||
- 2*kUPlus
|
- 2*kUPlus
|
||||||
- 1
|
- 1
|
||||||
|
|||||||
316
bin/foamEtcFile
316
bin/foamEtcFile
@ -3,38 +3,34 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2008-2011, 2017-2018 OpenCFD Ltd.
|
||||||
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
# | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||||
#
|
# <http://www.gnu.org/licenses/>.
|
||||||
# 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/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# foamEtcFile
|
# foamEtcFile
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Locate user/group/other files with semantics similar to the
|
# Locate user/group/other file as per '#includeEtc'.
|
||||||
# ~OpenFOAM/fileName expansion.
|
|
||||||
#
|
#
|
||||||
# The -mode option can be used to allow chaining from
|
# The -mode option can be used to allow chaining from personal settings
|
||||||
# personal settings to site-wide settings.
|
# to site-wide settings.
|
||||||
#
|
#
|
||||||
# For example, within the user ~/.OpenFOAM/<VER>/prefs.sh:
|
# For example, within the user ~/.OpenFOAM/<VER>/config.sh/compiler:
|
||||||
# \code
|
# \code
|
||||||
# eval $(foamEtcFile -sh -mode=go prefs.sh)
|
# eval $(foamEtcFile -sh -mode=go config.sh/compiler)
|
||||||
|
# \endcode
|
||||||
|
#
|
||||||
|
# The -mode option is similarly used within etc/{bashrc,cshrc} to ensure
|
||||||
|
# that system prefs are respected:
|
||||||
|
# \code
|
||||||
|
# eval $(foamEtcFile -sh -mode=o prefs.sh)
|
||||||
|
# eval $(foamEtcFile -sh -mode=ug prefs.sh)
|
||||||
# \endcode
|
# \endcode
|
||||||
#
|
#
|
||||||
# Environment
|
# Environment
|
||||||
@ -46,42 +42,42 @@
|
|||||||
# This script must exist in one of these locations:
|
# This script must exist in one of these locations:
|
||||||
# - $WM_PROJECT_INST_DIR/OpenFOAM-<VERSION>/bin
|
# - $WM_PROJECT_INST_DIR/OpenFOAM-<VERSION>/bin
|
||||||
# - $WM_PROJECT_INST_DIR/openfoam-<VERSION>/bin
|
# - $WM_PROJECT_INST_DIR/openfoam-<VERSION>/bin
|
||||||
# - $WM_PROJECT_INST_DIR/OpenFOAM+<VERSION>/bin
|
|
||||||
# - $WM_PROJECT_INST_DIR/openfoam+<VERSION>/bin
|
|
||||||
# - $WM_PROJECT_INST_DIR/openfoam<VERSION>/bin (debian version)
|
# - $WM_PROJECT_INST_DIR/openfoam<VERSION>/bin (debian version)
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
unset optQuiet optSilent
|
printHelp() {
|
||||||
usage() {
|
|
||||||
[ "${optQuiet:-$optSilent}" = true ] && exit 1
|
|
||||||
exec 1>&2
|
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
Usage: foamEtcFile [OPTION] fileName
|
Usage: foamEtcFile [OPTION] fileName [-- args]
|
||||||
foamEtcFile [OPTION] [-list|-list-test] [fileName]
|
foamEtcFile [OPTION] [-list|-list-test] [fileName]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-a, -all Return all files (otherwise stop after the first match)
|
-all (-a) Return all files (otherwise stop after the first match)
|
||||||
-l, -list List directories or files to be checked
|
-list (-l) List directories or files to be checked
|
||||||
-list-test List (existing) directories or files to be checked
|
-list-test List (existing) directories or files to be checked
|
||||||
-mode=MODE Any combination of u(user), g(group), o(other)
|
-mode=MODE Any combination of u(user), g(group), o(other)
|
||||||
-prefix=DIR Specify an alternative installation prefix
|
-prefix=DIR Specify an alternative installation prefix
|
||||||
-version=VER Specify alternative OpenFOAM version (eg, 3.0, 1612, ...)
|
-version=VER Specify alternative OpenFOAM version (eg, 3.0, 1612, ...)
|
||||||
-csh | -sh Produce output suitable for a csh or sh 'eval'
|
-csh Produce 'source FILE' output for a csh eval
|
||||||
-csh-verbose | -sh-verbose
|
-sh Produce '. FILE' output for a sh eval
|
||||||
As per -csh | -sh, with additional verbosity
|
-csh-verbose As per -csh, with additional verbosity
|
||||||
-q, -quiet Suppress all normal output
|
-sh-verbose As per -sh, with additional verbosity
|
||||||
-s, -silent Suppress stderr, except -csh-verbose, -sh-verbose output
|
-config Add config directory prefix for shell type:
|
||||||
|
with -csh* for a config.csh/ prefix
|
||||||
|
with -sh* for a config.sh/ prefix
|
||||||
|
-show-api Print api value from wmake/rules, or meta-info and exit
|
||||||
|
-show-patch Print patch value from meta-info and exit
|
||||||
|
-quiet (-q) Suppress all normal output
|
||||||
|
-silent (-s) Suppress stderr, except -csh-verbose, -sh-verbose output
|
||||||
-help Print the usage
|
-help Print the usage
|
||||||
|
|
||||||
Locate user/group/other file with semantics similar to the
|
Locate user/group/other file as per '#includeEtc'
|
||||||
~OpenFOAM/fileName expansion.
|
|
||||||
|
|
||||||
Single character options must not be grouped. Equivalent options:
|
Do not group single character options.
|
||||||
-mode=MODE, -mode MODE, -m MODE
|
Equivalent options:
|
||||||
-prefix=DIR, -prefix DIR, -p DIR
|
| -mode=MODE | -mode MODE | -m MODE
|
||||||
-version=VER, -version VER, -v VER
|
| -prefix=DIR | -prefix DIR | -p DIR
|
||||||
|
| -version=VER | -version VER | -v VER
|
||||||
|
|
||||||
Exit status
|
Exit status
|
||||||
0 when the file is found. Print resolved path to stdout.
|
0 when the file is found. Print resolved path to stdout.
|
||||||
@ -89,9 +85,10 @@ Exit status
|
|||||||
2 when the file is not found.
|
2 when the file is not found.
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 0 # A clean exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset optQuiet optSilent
|
||||||
# Report error and exit
|
# Report error and exit
|
||||||
die()
|
die()
|
||||||
{
|
{
|
||||||
@ -146,13 +143,6 @@ guessVersion()
|
|||||||
version="${version%%*-}" # Extra safety, eg openfoam-version-packager
|
version="${version%%*-}" # Extra safety, eg openfoam-version-packager
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(OpenFOAM+* | openfoam+*)
|
|
||||||
# Alternative naming: OpenFOAM+<VERSION> or openfoam+<VERSION>
|
|
||||||
dirBase="${projectDirName%%+*}+"
|
|
||||||
version="${projectDirName#*+}"
|
|
||||||
version="${version%%*-}" # Extra safety, eg openfoam-version-packager
|
|
||||||
;;
|
|
||||||
|
|
||||||
(openfoam[0-9]*)
|
(openfoam[0-9]*)
|
||||||
# Debian naming: openfoam<VERSION>
|
# Debian naming: openfoam<VERSION>
|
||||||
dirBase="openfoam"
|
dirBase="openfoam"
|
||||||
@ -198,31 +188,103 @@ setVersion()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The API locations. See wmake/wmakeBuildInfo
|
||||||
|
rulesFile="$projectDir/wmake/rules/General/general"
|
||||||
|
metaInfoDir="$projectDir/META-INFO"
|
||||||
|
|
||||||
|
# Get api from rules/General/general
|
||||||
|
#
|
||||||
|
# Failure modes:
|
||||||
|
# - No api information (can't find file etc).
|
||||||
|
# -> Fatal for building, but could be OK for a stripped down version
|
||||||
|
#
|
||||||
|
# Fallback. Get from api-info
|
||||||
|
#
|
||||||
|
getApi()
|
||||||
|
{
|
||||||
|
local value
|
||||||
|
|
||||||
|
value="$(sed -ne '/^ *#/!{ /WM_VERSION.*OPENFOAM=/{ s@^.*OPENFOAM= *\([0-9][0-9]*\).*@\1@p; q }}' $rulesFile 2>/dev/null)"
|
||||||
|
if [ -z "$value" ] && [ -f "$metaInfoDir/api-info" ]
|
||||||
|
then
|
||||||
|
# Fallback. Get from api-info
|
||||||
|
value="$(sed -ne 's@^ *api *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$value" ]
|
||||||
|
then
|
||||||
|
echo "$value"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Get patch from meta-info / api-info
|
||||||
|
#
|
||||||
|
# Failure modes:
|
||||||
|
# - No patch information (can't find file etc).
|
||||||
|
#
|
||||||
|
getPatchLevel()
|
||||||
|
{
|
||||||
|
local value
|
||||||
|
|
||||||
|
# Fallback. Get from api-info
|
||||||
|
value="$(sed -ne 's@^ *patch *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
|
||||||
|
|
||||||
|
if [ -n "$value" ]
|
||||||
|
then
|
||||||
|
echo "$value"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
optMode=ugo # Default mode is always 'ugo'
|
optMode=ugo # Default mode is always 'ugo'
|
||||||
unset optAll optList optShell optVersion
|
unset shellOutput verboseOutput
|
||||||
|
unset optAll optConfig optList optVersion
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help)
|
-h | -help*)
|
||||||
usage
|
printHelp
|
||||||
|
;;
|
||||||
|
-show-api)
|
||||||
|
# Show API and exit
|
||||||
|
getApi
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-show-patch)
|
||||||
|
# Show patch level and exit
|
||||||
|
getPatchLevel
|
||||||
|
exit $?
|
||||||
;;
|
;;
|
||||||
-a | -all)
|
-a | -all)
|
||||||
optAll=true
|
optAll=true
|
||||||
unset optShell
|
unset shellOutput verboseOutput
|
||||||
;;
|
;;
|
||||||
-l | -list)
|
-l | -list)
|
||||||
optList=true
|
optList=true
|
||||||
unset optShell
|
|
||||||
;;
|
;;
|
||||||
-list-test)
|
-list-test)
|
||||||
optList='test'
|
optList='test'
|
||||||
unset optShell
|
|
||||||
;;
|
;;
|
||||||
-csh | -sh | -csh-verbose | -sh-verbose)
|
-csh | -sh)
|
||||||
optShell="${1#-}"
|
shellOutput="${1#-}"
|
||||||
unset optAll
|
unset verboseOutput
|
||||||
|
;;
|
||||||
|
-csh-verbose | -sh-verbose)
|
||||||
|
shellOutput="${1#-}"
|
||||||
|
verboseOutput="source " # Report: "source FILE"
|
||||||
|
;;
|
||||||
|
-config)
|
||||||
|
optConfig=true
|
||||||
;;
|
;;
|
||||||
-mode=[ugo]*)
|
-mode=[ugo]*)
|
||||||
optMode="${1#*=}"
|
optMode="${1#*=}"
|
||||||
@ -276,9 +338,33 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Split arguments into filename (for searching) and trailing bits for shell eval
|
||||||
|
# Silently remove leading ~OpenFOAM/ (as per Foam::findEtcFile)
|
||||||
|
nArgs=$#
|
||||||
|
fileName="${1#~OpenFOAM/}"
|
||||||
|
unset evalArgs
|
||||||
|
|
||||||
|
if [ "$nArgs" -eq 1 ]
|
||||||
|
then
|
||||||
|
if [ "$1" = "--" ]
|
||||||
|
then
|
||||||
|
nArgs=0
|
||||||
|
unset fileName
|
||||||
|
fi
|
||||||
|
elif [ "$nArgs" -ge 2 ]
|
||||||
|
then
|
||||||
|
if [ "$2" = "--" ]
|
||||||
|
then
|
||||||
|
nArgs=1
|
||||||
|
shift 2
|
||||||
|
evalArgs="$@"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Get version information
|
||||||
if [ -n "$optVersion" ]
|
if [ -n "$optVersion" ]
|
||||||
then
|
then
|
||||||
setVersion $optVersion
|
setVersion $optVersion
|
||||||
@ -301,12 +387,6 @@ groupDir="${WM_PROJECT_SITE:-$prefixDir/site}"
|
|||||||
# eval echo "$i=\$$i" 1>&2
|
# eval echo "$i=\$$i" 1>&2
|
||||||
# done
|
# done
|
||||||
|
|
||||||
|
|
||||||
# Save the essential bits of information
|
|
||||||
# silently remove leading ~OpenFOAM/ (used in Foam::findEtcFile)
|
|
||||||
nArgs=$#
|
|
||||||
fileName="${1#~OpenFOAM/}"
|
|
||||||
|
|
||||||
# Define the various places to be searched:
|
# Define the various places to be searched:
|
||||||
unset dirList
|
unset dirList
|
||||||
case "$optMode" in (*u*) # (U)ser
|
case "$optMode" in (*u*) # (U)ser
|
||||||
@ -325,27 +405,61 @@ case "$optMode" in (*o*) # (O)ther == shipped
|
|||||||
esac
|
esac
|
||||||
set -- $dirList
|
set -- $dirList
|
||||||
|
|
||||||
|
[ "$#" -ge 1 ] || die "No directories to scan. Programming error?"
|
||||||
|
exitCode=2 # Fallback is a FileNotFound error
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Preliminaries
|
||||||
|
#
|
||||||
|
|
||||||
|
# Special handling of config.sh/ , config.csh/ directories
|
||||||
|
if [ -n "$optConfig" -a -n "$shellOutput" -a -n "$fileName" ]
|
||||||
|
then
|
||||||
|
case "$shellOutput" in
|
||||||
|
csh*)
|
||||||
|
optConfig="config.csh/"
|
||||||
|
;;
|
||||||
|
sh*)
|
||||||
|
optConfig="config.sh/"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
unset optConfig
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "$optConfig" ]
|
||||||
|
then
|
||||||
|
case "$fileName" in
|
||||||
|
/* | config.csh* | config.sh*)
|
||||||
|
# Does not need or cannot add a prefix
|
||||||
|
unset optConfig
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fileName="$optConfig$fileName"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# The main routine
|
# The main routine
|
||||||
#
|
#
|
||||||
|
|
||||||
exitCode=0
|
|
||||||
if [ -n "$optList" ]
|
if [ -n "$optList" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
# List directories, or potential file locations
|
# List directories, or potential file locations
|
||||||
[ "$nArgs" -le 1 ] || \
|
[ "$nArgs" -le 1 ] || \
|
||||||
die "-list expects 0 or 1 filename, but $nArgs provided"
|
die "-list options expect 0 or 1 filename, but $nArgs provided"
|
||||||
|
|
||||||
# A silly combination, but -quiet does have precedence
|
# A silly combination, but -quiet has absolute precedence
|
||||||
[ -n "$optQuiet" ] && exit 0
|
[ -n "$optQuiet" ] && exit 0
|
||||||
|
|
||||||
# Test for directory or file too?
|
# Test for directory or file too?
|
||||||
if [ "$optList" = "test" ]
|
if [ "$optList" = "test" ]
|
||||||
then
|
then
|
||||||
exitCode=2 # Fallback to a general error (file not found)
|
|
||||||
|
|
||||||
if [ "$nArgs" -eq 1 ]
|
if [ "$nArgs" -eq 1 ]
|
||||||
then
|
then
|
||||||
for dir
|
for dir
|
||||||
@ -368,6 +482,7 @@ then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
exitCode=0 # OK, already verified that $# != 0
|
||||||
for dir
|
for dir
|
||||||
do
|
do
|
||||||
echo "$dir${fileName:+/}$fileName"
|
echo "$dir${fileName:+/}$fileName"
|
||||||
@ -378,35 +493,44 @@ else
|
|||||||
|
|
||||||
[ "$nArgs" -eq 1 ] || die "One filename expected - $nArgs provided"
|
[ "$nArgs" -eq 1 ] || die "One filename expected - $nArgs provided"
|
||||||
|
|
||||||
exitCode=2 # Fallback to a general error (file not found)
|
# Output for sourcing files ("source" for csh, "." for POSIX shell)
|
||||||
|
# Only allow sourcing a single file (disallow combination with -all)
|
||||||
|
case "$shellOutput" in
|
||||||
|
csh*)
|
||||||
|
shellOutput="source " # eg, "source FILE"
|
||||||
|
;;
|
||||||
|
sh*)
|
||||||
|
shellOutput=". " # eg, ". FILE"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Anti-pattern: -all disables shell commands
|
||||||
|
if [ -n "$optAll" ]
|
||||||
|
then
|
||||||
|
unset shellOutput verboseOutput
|
||||||
|
fi
|
||||||
|
|
||||||
for dir
|
for dir
|
||||||
do
|
do
|
||||||
if [ -f "$dir/$fileName" ]
|
resolved="$dir/$fileName"
|
||||||
|
if [ -f "$resolved" ]
|
||||||
then
|
then
|
||||||
exitCode=0
|
exitCode=0 # OK
|
||||||
[ -n "$optQuiet" ] && break
|
if [ -n "$optQuiet" ]
|
||||||
|
then
|
||||||
case "$optShell" in
|
|
||||||
(*verbose)
|
|
||||||
echo "Using: $dir/$fileName" 1>&2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$optShell" in
|
|
||||||
csh*)
|
|
||||||
echo "source $dir/$fileName"
|
|
||||||
break
|
break
|
||||||
;;
|
elif [ -n "$verboseOutput" ]
|
||||||
sh*)
|
then
|
||||||
echo ". $dir/$fileName"
|
echo "$verboseOutput$resolved" 1>&2
|
||||||
break
|
fi
|
||||||
;;
|
|
||||||
*)
|
if [ -n "$shellOutput" ]
|
||||||
echo "$dir/$fileName"
|
then
|
||||||
[ -n "$optAll" ] || break
|
echo "$shellOutput$resolved $evalArgs"
|
||||||
;;
|
else
|
||||||
esac
|
echo "$resolved"
|
||||||
|
fi
|
||||||
|
[ -n "$optAll" ] || break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ PROJECT_BRIEF = "The open source CFD toolbox"
|
|||||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
||||||
# the logo to the output directory.
|
# the logo to the output directory.
|
||||||
|
|
||||||
PROJECT_LOGO = OpenFOAM-logo2-55x55.png
|
PROJECT_LOGO = OpenFOAMlogo.png
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||||
# into which the generated documentation will be written. If a relative path is
|
# into which the generated documentation will be written. If a relative path is
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.1 KiB |
@ -41,7 +41,7 @@ flowSpecification
|
|||||||
U
|
U
|
||||||
{
|
{
|
||||||
type flowRateInletVelocity;
|
type flowRateInletVelocity;
|
||||||
volumeFlowRate ${:VALUE.volumeFlowRate};
|
volumetricFlowRate ${:VALUE.volumetricFlowRate};
|
||||||
value ${:VALUE.U};
|
value ${:VALUE.U};
|
||||||
}
|
}
|
||||||
p
|
p
|
||||||
|
|||||||
@ -231,12 +231,10 @@ Foam::List<T>::List(const PtrList<T>& lst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Note: using first/last is not entirely accurate.
|
|
||||||
// But since the list size is correct, last() is actually ignored.
|
|
||||||
template<class T>
|
template<class T>
|
||||||
Foam::List<T>::List(const SLList<T>& lst)
|
Foam::List<T>::List(const SLList<T>& lst)
|
||||||
:
|
:
|
||||||
List<T>(lst.first(), lst.last(), lst.size())
|
List<T>(lst.begin(), lst.end(), lst.size())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -724,7 +724,8 @@ bool Foam::functionObjects::timeControl::read(const dictionary& dict)
|
|||||||
executeControl_.read(dict);
|
executeControl_.read(dict);
|
||||||
readControls();
|
readControls();
|
||||||
|
|
||||||
return true;
|
// Forward to underlying function object
|
||||||
|
return foPtr_->read(dict);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -373,7 +373,8 @@ kOmegaSSTLM<BasicTurbulenceModel>::kOmegaSSTLM
|
|||||||
alphaRhoPhi,
|
alphaRhoPhi,
|
||||||
phi,
|
phi,
|
||||||
transport,
|
transport,
|
||||||
propertiesName
|
propertiesName,
|
||||||
|
typeName
|
||||||
),
|
),
|
||||||
|
|
||||||
ca1_
|
ca1_
|
||||||
@ -477,7 +478,12 @@ kOmegaSSTLM<BasicTurbulenceModel>::kOmegaSSTLM
|
|||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar("0", dimless, 0)
|
dimensionedScalar("0", dimless, 0)
|
||||||
)
|
)
|
||||||
{}
|
{
|
||||||
|
if (type == typeName)
|
||||||
|
{
|
||||||
|
this->printCoeffs(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -245,7 +245,7 @@ Foam::vtk::patchWriter::patchWriter
|
|||||||
nFaces_(0)
|
nFaces_(0)
|
||||||
{
|
{
|
||||||
outputOptions opts(outOpts);
|
outputOptions opts(outOpts);
|
||||||
opts.append(false); // No append
|
opts.append(false); // No append supported
|
||||||
|
|
||||||
os_.open((baseName + (legacy_ ? ".vtk" : ".vtp")).c_str());
|
os_.open((baseName + (legacy_ ? ".vtk" : ".vtp")).c_str());
|
||||||
format_ = opts.newFormatter(os_);
|
format_ = opts.newFormatter(os_);
|
||||||
|
|||||||
@ -193,7 +193,7 @@ Foam::vtk::surfaceMeshWriter::surfaceMeshWriter
|
|||||||
os_()
|
os_()
|
||||||
{
|
{
|
||||||
outputOptions opts(outOpts);
|
outputOptions opts(outOpts);
|
||||||
opts.legacy(true); // No append supported
|
opts.append(false); // No append supported
|
||||||
|
|
||||||
os_.open((baseName + (legacy_ ? ".vtk" : ".vtp")).c_str());
|
os_.open((baseName + (legacy_ ? ".vtk" : ".vtp")).c_str());
|
||||||
format_ = opts.newFormatter(os_);
|
format_ = opts.newFormatter(os_);
|
||||||
|
|||||||
@ -34,28 +34,33 @@ Foam::fileFormats::NASCore::NASCore()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::fileFormats::NASCore::parseNASCoord
|
Foam::scalar Foam::fileFormats::NASCore::parseNASCoord(const string& s)
|
||||||
(
|
|
||||||
const string& s
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
size_t expSign = s.find_last_of("+-");
|
scalar value = 0;
|
||||||
|
|
||||||
if (expSign != string::npos && expSign > 0 && !isspace(s[expSign-1]))
|
const size_t expSign = s.find_last_of("+-");
|
||||||
|
|
||||||
|
if (expSign != std::string::npos && expSign > 0 && !isspace(s[expSign-1]))
|
||||||
{
|
{
|
||||||
scalar mantissa = readScalar(IStringStream(s.substr(0, expSign))());
|
scalar exponent = 0;
|
||||||
scalar exponent = readScalar(IStringStream(s.substr(expSign+1))());
|
|
||||||
|
// Parse as per strtod/strtof - allowing trailing space or [Ee]
|
||||||
|
readScalar(s.substr(0, expSign).c_str(), value); // mantissa
|
||||||
|
readScalar(s.substr(expSign+1).c_str(), exponent);
|
||||||
|
|
||||||
if (s[expSign] == '-')
|
if (s[expSign] == '-')
|
||||||
{
|
{
|
||||||
exponent = -exponent;
|
exponent = -exponent;
|
||||||
}
|
}
|
||||||
return mantissa * pow(10, exponent);
|
|
||||||
|
value *= ::pow(10, exponent);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return readScalar(IStringStream(s)());
|
readScalar(s.c_str(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -55,8 +55,8 @@ public:
|
|||||||
|
|
||||||
// Public Member Functions
|
// Public Member Functions
|
||||||
|
|
||||||
//- Do weird things to extract number
|
//- Extract numbers from things like "-2.358-8" (same as "-2.358e-8")
|
||||||
static scalar parseNASCoord(const string&);
|
static scalar parseNASCoord(const string& s);
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,7 +49,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(p, iF),
|
uniformJumpFvPatchField<Type>(p, iF),
|
||||||
phiName_("phi"),
|
phiName_("phi"),
|
||||||
rhoName_("rho"),
|
rhoName_("rho"),
|
||||||
uniformJump_(false)
|
uniformJump_(false),
|
||||||
|
nonDimensional_(false),
|
||||||
|
rpm_(0.0),
|
||||||
|
dm_(0.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -64,8 +67,17 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(p, iF, dict),
|
uniformJumpFvPatchField<Type>(p, iF, dict),
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false))
|
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false)),
|
||||||
{}
|
nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)),
|
||||||
|
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)),
|
||||||
|
dm_(dict.lookupOrDefault<scalar>("dm", 0.0))
|
||||||
|
{
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
dict.lookup("rpm") >> rpm_;
|
||||||
|
dict.lookup("dm") >> dm_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -80,7 +92,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper),
|
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_)
|
uniformJump_(ptf.uniformJump_),
|
||||||
|
nonDimensional_(ptf.nonDimensional_),
|
||||||
|
rpm_(ptf.rpm_),
|
||||||
|
dm_(ptf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +108,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(ptf),
|
uniformJumpFvPatchField<Type>(ptf),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_)
|
uniformJump_(ptf.uniformJump_),
|
||||||
|
nonDimensional_(ptf.nonDimensional_),
|
||||||
|
rpm_(ptf.rpm_),
|
||||||
|
dm_(ptf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +125,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(ptf, iF),
|
uniformJumpFvPatchField<Type>(ptf, iF),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_)
|
uniformJump_(ptf.uniformJump_),
|
||||||
|
nonDimensional_(ptf.nonDimensional_),
|
||||||
|
rpm_(ptf.rpm_),
|
||||||
|
dm_(ptf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -138,6 +159,12 @@ void Foam::fanFvPatchField<Type>::write(Ostream& os) const
|
|||||||
(
|
(
|
||||||
os, "uniformJump", false, uniformJump_
|
os, "uniformJump", false, uniformJump_
|
||||||
);
|
);
|
||||||
|
this->template writeEntryIfDifferent<bool>
|
||||||
|
(
|
||||||
|
os, "nonDimensional", false, nonDimensional_
|
||||||
|
);
|
||||||
|
this->template writeEntryIfDifferent<scalar>(os, "rpm", 0, rpm_);
|
||||||
|
this->template writeEntryIfDifferent<scalar>(os, "dm", 0, dm_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,6 +34,24 @@ Description
|
|||||||
The jump is specified as a \c Function1 type, to enable the use of, e.g.
|
The jump is specified as a \c Function1 type, to enable the use of, e.g.
|
||||||
contant, polynomial, table values.
|
contant, polynomial, table values.
|
||||||
|
|
||||||
|
The switch nonDimensional can be used for a non-dimensional table. It needs
|
||||||
|
inputs rpm and dm of the fan. It should be used with uniformJump true.
|
||||||
|
|
||||||
|
The nonDimensional flux for the table is calculate as :
|
||||||
|
|
||||||
|
phi = 4.0*mDot/(rho*sqr(PI)*dm^3*omega)
|
||||||
|
where:
|
||||||
|
dm is the mean diameter.
|
||||||
|
omega is rad/sec.
|
||||||
|
|
||||||
|
The nonDimensinal pressure :
|
||||||
|
|
||||||
|
Psi = 2 deltaP/(rho*(sqr(PI*omega*dm)))
|
||||||
|
where:
|
||||||
|
deltaP is the pressure drop
|
||||||
|
|
||||||
|
The non-dimensional table should be given as Psi = F(phi).
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
@ -43,6 +61,9 @@ Usage
|
|||||||
rho | density field name | no | none
|
rho | density field name | no | none
|
||||||
uniformJump | applies a uniform pressure based on the averaged
|
uniformJump | applies a uniform pressure based on the averaged
|
||||||
velocity | no | false
|
velocity | no | false
|
||||||
|
nonDimensional | uses non-dimensional table | no | false
|
||||||
|
rpm | fan rpm for non-dimensional table | no | 0.0
|
||||||
|
dm | mean diameter for non-dimensional table | no | 0.0
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -114,6 +135,17 @@ class fanFvPatchField
|
|||||||
//- Uniform pressure drop
|
//- Uniform pressure drop
|
||||||
bool uniformJump_;
|
bool uniformJump_;
|
||||||
|
|
||||||
|
//- Swtich for using non-dimensional curve
|
||||||
|
Switch nonDimensional_;
|
||||||
|
|
||||||
|
// Parameters for non-dimensional table
|
||||||
|
|
||||||
|
//- Fan rpm
|
||||||
|
scalar rpm_;
|
||||||
|
|
||||||
|
//- Fan mean diameter
|
||||||
|
scalar dm_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -48,6 +48,15 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
|||||||
{
|
{
|
||||||
scalar area = gSum(patch().magSf());
|
scalar area = gSum(patch().magSf());
|
||||||
Un = gSum(Un*patch().magSf())/area;
|
Un = gSum(Un*patch().magSf())/area;
|
||||||
|
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
// Create an adimensional volumetric flow rate
|
||||||
|
Un =
|
||||||
|
120.0*Un/pow3(constant::mathematical::pi)
|
||||||
|
* patch().magSf()
|
||||||
|
/ pow3(dm_)/rpm_;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
@ -55,7 +64,18 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
|||||||
Un /= patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
Un /= patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->jump_ = max(this->jumpTable_->value(Un), scalar(0));
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
scalarField deltap = this->jumpTable_->value(Un);
|
||||||
|
// Convert adimensional deltap from curve into deltaP
|
||||||
|
scalarField pdFan =
|
||||||
|
deltap*pow4(constant::mathematical::pi)*sqr(dm_*rpm_)/1800;
|
||||||
|
this->jump_ = max(pdFan, scalar(0));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->jump_ = max(this->jumpTable_->value(Un), scalar(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +93,10 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<scalar>(p, iF),
|
uniformJumpFvPatchField<scalar>(p, iF),
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false))
|
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false)),
|
||||||
|
nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)),
|
||||||
|
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)),
|
||||||
|
dm_(dict.lookupOrDefault<scalar>("dm", 0.0))
|
||||||
{
|
{
|
||||||
if (this->cyclicPatch().owner())
|
if (this->cyclicPatch().owner())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -181,7 +181,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
{
|
{
|
||||||
// Create an adimensional flow rate
|
// Create an adimensional flow rate
|
||||||
volFlowRate =
|
volFlowRate =
|
||||||
120.0*volFlowRate/pow3(constant::mathematical::pi)/pow3(dm_);
|
120.0*volFlowRate/pow3(constant::mathematical::pi)/pow3(dm_)/rpm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pressure drop for this flow rate
|
// Pressure drop for this flow rate
|
||||||
@ -190,7 +190,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
// Convert the adimensional deltap from curve into deltaP
|
// Convert the adimensional deltap from curve into deltaP
|
||||||
pdFan = pdFan*pow4(constant::mathematical::pi)*rpm_*sqr(dm_)/1800;
|
pdFan = pdFan*pow4(constant::mathematical::pi)*sqr(dm_*rpm_)/1800;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalPressureFvPatchScalarField::updateCoeffs
|
totalPressureFvPatchScalarField::updateCoeffs
|
||||||
|
|||||||
@ -280,7 +280,7 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -299,6 +299,10 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -310,7 +314,7 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
const fluxFieldType& phi
|
const fluxFieldType& phi
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -329,6 +333,10 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -341,7 +349,7 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -362,6 +370,10 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -374,7 +386,7 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
const fluxFieldType& phi
|
const fluxFieldType& phi
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -395,6 +407,10 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ Foam::isoAdvection::isoAdvection
|
|||||||
|
|
||||||
// Tolerances and solution controls
|
// Tolerances and solution controls
|
||||||
nAlphaBounds_(dict_.lookupOrDefault<label>("nAlphaBounds", 3)),
|
nAlphaBounds_(dict_.lookupOrDefault<label>("nAlphaBounds", 3)),
|
||||||
vof2IsoTol_(dict_.lookupOrDefault<scalar>("vof2IsoTol", 1e-8)),
|
isoFaceTol_(dict_.lookupOrDefault<scalar>("isoFaceTol", 1e-8)),
|
||||||
surfCellTol_(dict_.lookupOrDefault<scalar>("surfCellTol", 1e-8)),
|
surfCellTol_(dict_.lookupOrDefault<scalar>("surfCellTol", 1e-8)),
|
||||||
gradAlphaBasedNormal_
|
gradAlphaBasedNormal_
|
||||||
(
|
(
|
||||||
@ -249,7 +249,7 @@ void Foam::isoAdvection::timeIntegratedFlux()
|
|||||||
(
|
(
|
||||||
celli,
|
celli,
|
||||||
alpha1In_[celli],
|
alpha1In_[celli],
|
||||||
vof2IsoTol_,
|
isoFaceTol_,
|
||||||
maxIter
|
maxIter
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ class isoAdvection
|
|||||||
label nAlphaBounds_;
|
label nAlphaBounds_;
|
||||||
|
|
||||||
//- Tolerance for search of isoFace giving specified VOF value
|
//- Tolerance for search of isoFace giving specified VOF value
|
||||||
scalar vof2IsoTol_;
|
scalar isoFaceTol_;
|
||||||
|
|
||||||
//- Tolerance for marking of surface cells:
|
//- Tolerance for marking of surface cells:
|
||||||
// Those with surfCellTol_ < alpha1 < 1 - surfCellTol_
|
// Those with surfCellTol_ < alpha1 < 1 - surfCellTol_
|
||||||
|
|||||||
@ -361,6 +361,23 @@ Foam::label Foam::isoCutCell::calcSubCell
|
|||||||
// Cell cut at least at one face
|
// Cell cut at least at one face
|
||||||
cellStatus_ = 0;
|
cellStatus_ = 0;
|
||||||
calcIsoFaceCentreAndArea();
|
calcIsoFaceCentreAndArea();
|
||||||
|
|
||||||
|
// In the rare but occuring cases where a cell is only touched at a
|
||||||
|
// point or a line the isoFaceArea_ will have zero length and here the
|
||||||
|
// cell should be treated as either completely empty or full.
|
||||||
|
if (mag(isoFaceArea_) < 10*SMALL)
|
||||||
|
{
|
||||||
|
if (fullySubFaces_.empty())
|
||||||
|
{
|
||||||
|
// Cell fully above isosurface
|
||||||
|
cellStatus_ = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Cell fully below isosurface
|
||||||
|
cellStatus_ = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (fullySubFaces_.empty())
|
else if (fullySubFaces_.empty())
|
||||||
{
|
{
|
||||||
|
|||||||
97
src/functionObjects/doc/functionObjects.dox
Normal file
97
src/functionObjects/doc/functionObjects.dox
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
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/>.
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
\page pagePostProcessing Post-processing
|
||||||
|
|
||||||
|
\section secFunctionObjects Function objects
|
||||||
|
|
||||||
|
OpenFOAM includes a collection of \ref grpFunctionObjects that offer users the
|
||||||
|
opportunity to closely manage their computational analyses. These objects can
|
||||||
|
be applied to manipulate the workflow process, and provide a mechanism to
|
||||||
|
extract predicted field and derived quantities at run-time. Alternatively,
|
||||||
|
the actions can be executed afterwards using the \c execFlowFunctionObjects
|
||||||
|
utility.
|
||||||
|
|
||||||
|
\linebreak
|
||||||
|
The current range of features comprises of:
|
||||||
|
- \ref grpFieldFunctionObjects
|
||||||
|
- \ref grpForcesFunctionObjects
|
||||||
|
- \ref grpGraphicsFunctionObjects
|
||||||
|
- \ref grpLagrangianFunctionObjects
|
||||||
|
- \ref grpSolversFunctionObjects
|
||||||
|
- \ref grpUtilitiesFunctionObjects
|
||||||
|
|
||||||
|
\linebreak
|
||||||
|
\subsection secFieldFunctionObjectUsage Using function objects
|
||||||
|
|
||||||
|
Function objects are defined by additional entries in the
|
||||||
|
$FOAM_CASE/system/controlDict input dictionary. Each object is listed in a
|
||||||
|
\c functions sub-dictionary entry, e.g. the following shows the input options
|
||||||
|
applicable to `output' -type objects:
|
||||||
|
|
||||||
|
\verbatim
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
myFunctionObject // user-defined name of function object entry
|
||||||
|
{
|
||||||
|
type functionObjectType;
|
||||||
|
libs ("libMyFunctionObjectlib.so");
|
||||||
|
region defaultRegion;
|
||||||
|
enabled yes;
|
||||||
|
timeStart 0;
|
||||||
|
timeEnd 10;
|
||||||
|
evaluateControl timeStep;
|
||||||
|
evaluateInterval 1;
|
||||||
|
writeControl outputTime;
|
||||||
|
writeInterval 1;
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
Where:
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
type | type of function object | yes |
|
||||||
|
libs | libraries containing object implementation | yes |
|
||||||
|
region | name of region for multi-region cases | no |
|
||||||
|
enabled | on/off switch | no | yes
|
||||||
|
timeStart| start time | no |
|
||||||
|
timeEnd | end time | no |
|
||||||
|
evaluateControl | when to evaluate: either 'writeTime' or 'timeStep'| no | timeStep
|
||||||
|
evaluateInterval| steps between evaluation when evaluateControl=timeStep | no | 1
|
||||||
|
writeControl | when to output: either 'writeTime' or 'timeStep'| no | timeStep
|
||||||
|
writeInterval| steps between output when writeControl=timeStep | no | 1
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
The sub-dictionary name \c myFunctionObject is chosen by the user, and is
|
||||||
|
typically used as the name of the output directory for any derived data. The
|
||||||
|
\c type entry defines the type of function object properties that follow.
|
||||||
|
Since the function objects are packaged into separate libraries, the user must
|
||||||
|
tell the code where to find the function object implementation, identified
|
||||||
|
using the \c functionObjectLibs entry.
|
||||||
|
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -99,7 +99,7 @@ bool Foam::functionObjects::Curle::calc()
|
|||||||
|
|
||||||
volScalarField& pDash = tpDash.ref();
|
volScalarField& pDash = tpDash.ref();
|
||||||
const volVectorField d(scopedName("d"), C - x0_);
|
const volVectorField d(scopedName("d"), C - x0_);
|
||||||
pDash = 4*mathematical::pi/c0_*(d/magSqr(d) & dfdt);
|
pDash = (d/magSqr(d) & dfdt)/(4.0*mathematical::pi*c0_);
|
||||||
|
|
||||||
return store(resultName_, tpDash);
|
return store(resultName_, tpDash);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Description
|
|||||||
Curle's analogy is implemented as:
|
Curle's analogy is implemented as:
|
||||||
|
|
||||||
\f[
|
\f[
|
||||||
p' = 4 \frac{\pi}{c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)}
|
p' = \frac{1}{4 \pi c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)}
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
|
|
||||||
@ -68,8 +68,8 @@ Usage
|
|||||||
type | Type name: Curle | yes |
|
type | Type name: Curle | yes |
|
||||||
field | Pressure field name | no | p
|
field | Pressure field name | no | p
|
||||||
result | Acoustic pressure field name | no | Curle
|
result | Acoustic pressure field name | no | Curle
|
||||||
patches | Sound generation patch names | yes |
|
patches | Sound generation patch names | yes |
|
||||||
c0 | Reference speed of sound | yes |
|
c0 | Reference speed of sound | yes |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -172,6 +172,8 @@ bool Foam::functionObjects::DESModelRegions::write()
|
|||||||
<< " writing field " << DESModelRegions.name() << nl
|
<< " writing field " << DESModelRegions.name() << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
DESModelRegions.write();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -196,7 +196,7 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
|
|||||||
const scalarField Tc(patchInternalField());
|
const scalarField Tc(patchInternalField());
|
||||||
|
|
||||||
// Heat transfer coefficient [W/m2/K]
|
// Heat transfer coefficient [W/m2/K]
|
||||||
const scalarField htc(qDot/(Tp - Tc + ROOTVSMALL));
|
const scalarField htc(qDot/(Tp - Tc + 1e-3));
|
||||||
|
|
||||||
const Field<scalar>& magSf(this->patch().magSf());
|
const Field<scalar>& magSf(this->patch().magSf());
|
||||||
|
|
||||||
|
|||||||
@ -111,8 +111,12 @@ Note
|
|||||||
coordinateSystem
|
coordinateSystem
|
||||||
{
|
{
|
||||||
origin (0 0 0);
|
origin (0 0 0);
|
||||||
e3 (0 0 1);
|
coordinateRotation
|
||||||
e1 (1 0 0);
|
{
|
||||||
|
type axesRotation;
|
||||||
|
e3 (0 0 1);
|
||||||
|
e1 (1 0 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
@ -346,11 +350,11 @@ protected:
|
|||||||
//- Write binned data
|
//- Write binned data
|
||||||
void writeBins();
|
void writeBins();
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- No copy construct
|
||||||
forces(const forces&);
|
forces(const forces&) = delete;
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- No copy assignment
|
||||||
void operator=(const forces&);
|
void operator=(const forces&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -128,13 +128,13 @@ void Foam::functionObjects::thermoCoupleProbes::derivatives
|
|||||||
scalarField Re(rhoc*Uc*d_/muc);
|
scalarField Re(rhoc*Uc*d_/muc);
|
||||||
scalarField Pr(Cpc*muc/kappac);
|
scalarField Pr(Cpc*muc/kappac);
|
||||||
Pr = max(ROOTVSMALL, Pr);
|
Pr = max(ROOTVSMALL, Pr);
|
||||||
scalarField Nu(2.0 + (0.4*sqrt(Re) + 0.06*pow(Re, 2/3))*pow(Pr, 0.4));
|
scalarField Nu(2.0 + (0.4*sqrt(Re) + 0.06*pow(Re, 2.0/3.0))*pow(Pr, 0.4));
|
||||||
scalarField htc(Nu*kappac/d_);
|
scalarField htc(Nu*kappac/d_);
|
||||||
|
|
||||||
const scalar sigma = physicoChemical::sigma.value();
|
const scalar sigma = physicoChemical::sigma.value();
|
||||||
|
|
||||||
scalar area = 4*constant::mathematical::pi*sqr(0.5*d_);
|
scalar area = 4*constant::mathematical::pi*sqr(0.5*d_);
|
||||||
scalar volume = (4/3)*constant::mathematical::pi*pow3(0.5*d_);
|
scalar volume = (4.0/3.0)*constant::mathematical::pi*pow3(0.5*d_);
|
||||||
|
|
||||||
dydx =
|
dydx =
|
||||||
(epsilon_*(G/4 - sigma*pow4(y))*area + htc*(Tc - y)*area)
|
(epsilon_*(G/4 - sigma*pow4(y))*area + htc*(Tc - y)*area)
|
||||||
|
|||||||
@ -43,8 +43,13 @@ Description
|
|||||||
|
|
||||||
coordinateSystem
|
coordinateSystem
|
||||||
{
|
{
|
||||||
e1 (0.70710678 0.70710678 0);
|
origin (0 0 0);
|
||||||
e2 (0 0 1);
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
|
e1 (0.70710678 0.70710678 0);
|
||||||
|
e2 (0 0 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -318,7 +318,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
|
|||||||
const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));
|
const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));
|
||||||
|
|
||||||
// Update parcel velocity
|
// Update parcel velocity
|
||||||
U = -epsilon*(Un) + 5/7*(Ut);
|
U = -epsilon*(Un) + 5.0/7.0*(Ut);
|
||||||
|
|
||||||
keepParticle = true;
|
keepParticle = true;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -129,9 +129,21 @@ Foam::coordinateSystem::coordinateSystem
|
|||||||
{
|
{
|
||||||
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
|
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
|
||||||
|
|
||||||
// non-dictionary entry is a lookup into global coordinateSystems
|
if (!entryPtr)
|
||||||
if (entryPtr && !entryPtr->isDict())
|
|
||||||
{
|
{
|
||||||
|
// No 'coordinateSystem' entry
|
||||||
|
init(dict, obr);
|
||||||
|
}
|
||||||
|
else if (entryPtr->isDict())
|
||||||
|
{
|
||||||
|
// 'coordinateSystem' as dictionary entry - use it
|
||||||
|
init(entryPtr->dict(), obr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 'coordinateSystem' as non-dictionary entry
|
||||||
|
// - this is a lookup into global coordinateSystems
|
||||||
|
|
||||||
keyType key(entryPtr->stream());
|
keyType key(entryPtr->stream());
|
||||||
|
|
||||||
const coordinateSystems& lst = coordinateSystems::New(obr);
|
const coordinateSystems& lst = coordinateSystems::New(obr);
|
||||||
@ -152,15 +164,11 @@ Foam::coordinateSystem::coordinateSystem
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy coordinateSystem, but assign the name as the typeName
|
// Copy from coordinateSystem, but assign the name as the typeName
|
||||||
// to avoid strange things in writeDict()
|
// to avoid strange things in writeDict()
|
||||||
operator=(lst[index]);
|
operator=(lst[index]);
|
||||||
name_ = typeName_();
|
name_ = typeName_();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
init(dict, obr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ void Foam::vtk::writeCellSetFaces
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
outputOptions opts(outOpts);
|
outputOptions opts(outOpts);
|
||||||
opts.legacy(true); // Legacy only, no append
|
opts.legacy(true); // Legacy only, no xml, no append
|
||||||
|
|
||||||
const bool legacy_(opts.legacy());
|
const bool legacy_(opts.legacy());
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ void Foam::vtk::writeFaceSet
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
outputOptions opts(outOpts);
|
outputOptions opts(outOpts);
|
||||||
opts.legacy(true); // Legacy only, no append
|
opts.legacy(true); // Legacy only, no xml, no append
|
||||||
|
|
||||||
const bool legacy_(opts.legacy());
|
const bool legacy_(opts.legacy());
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ void Foam::vtk::writePointSet
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
outputOptions opts(outOpts);
|
outputOptions opts(outOpts);
|
||||||
opts.legacy(true); // Legacy only, no append
|
opts.legacy(true); // Legacy only, no xml, no append
|
||||||
|
|
||||||
const bool legacy_(opts.legacy());
|
const bool legacy_(opts.legacy());
|
||||||
|
|
||||||
|
|||||||
@ -7,11 +7,30 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH} # Extra safety
|
: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH} # Extra safety
|
||||||
export FOAM_EXT_LIBBIN
|
export FOAM_EXT_LIBBIN
|
||||||
|
|
||||||
|
# Check for the existence of any of the files
|
||||||
|
# On success, echoes the file found and returns 0, otherwise returns 2
|
||||||
|
findFirstFile()
|
||||||
|
{
|
||||||
|
local file
|
||||||
|
for file
|
||||||
|
do
|
||||||
|
if [ -f "$file" -a -r "$file" ]
|
||||||
|
then
|
||||||
|
echo "$file"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Test for metis.
|
# Test for metis.
|
||||||
# - return 0 and export METIS_ARCH_PATH on success
|
# - return 0 and export METIS_ARCH_PATH on success
|
||||||
hasMetis()
|
hasMetis()
|
||||||
{
|
{
|
||||||
local warning="==> skip metis"
|
local warning="==> skip metis"
|
||||||
|
local header label settings
|
||||||
|
|
||||||
unset METIS_ARCH_PATH METIS_VERSION
|
unset METIS_ARCH_PATH METIS_VERSION
|
||||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
|
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
|
||||||
@ -27,28 +46,30 @@ hasMetis()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
local header=$METIS_ARCH_PATH/include/metis.h
|
header=$(findFirstFile \
|
||||||
if [ "${METIS_ARCH_PATH##*-}" = system ]
|
$METIS_ARCH_PATH/include/metis.h \
|
||||||
then
|
/usr/include/metis.h \
|
||||||
[ -f "$header" ] || header=/usr/include/metis.h
|
) || {
|
||||||
fi
|
|
||||||
[ -f "$header" ] || {
|
|
||||||
echo "$warning (no header)"
|
echo "$warning (no header)"
|
||||||
return 2 # file not found
|
return 2 # file not found
|
||||||
}
|
}
|
||||||
|
|
||||||
# Library
|
# Library
|
||||||
[ -r $FOAM_EXT_LIBBIN/libmetis.so ] || \
|
[ "${METIS_ARCH_PATH##*-}" = system ] || \
|
||||||
[ -r $METIS_ARCH_PATH/lib/libmetis.so ] || \
|
findFirstFile \
|
||||||
[ -r $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so ] || \
|
$FOAM_EXT_LIBBIN/libmetis.so \
|
||||||
[ "${METIS_ARCH_PATH##*-}" = system ] || {
|
$METIS_ARCH_PATH/lib/libmetis.a \
|
||||||
|
$METIS_ARCH_PATH/lib/libmetis.so \
|
||||||
|
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
|
||||||
|
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so \
|
||||||
|
> /dev/null || {
|
||||||
echo "$warning (missing library)"
|
echo "$warning (missing library)"
|
||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ensure consistent sizes between OpenFOAM and metis header
|
# Ensure consistent sizes between OpenFOAM and metis header
|
||||||
# Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
|
# Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
|
||||||
local label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header)
|
label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header)
|
||||||
: ${label:=unknown}
|
: ${label:=unknown}
|
||||||
|
|
||||||
if [ "$WM_LABEL_SIZE" = "$label" ]
|
if [ "$WM_LABEL_SIZE" = "$label" ]
|
||||||
@ -67,6 +88,7 @@ hasMetis()
|
|||||||
hasScotch()
|
hasScotch()
|
||||||
{
|
{
|
||||||
local warning="==> skip scotch"
|
local warning="==> skip scotch"
|
||||||
|
local header label settings
|
||||||
|
|
||||||
unset SCOTCH_ARCH_PATH SCOTCH_VERSION
|
unset SCOTCH_ARCH_PATH SCOTCH_VERSION
|
||||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
|
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
|
||||||
@ -82,33 +104,54 @@ hasScotch()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
local header=$SCOTCH_ARCH_PATH/include/scotch.h
|
header=$(findFirstFile \
|
||||||
if [ "${SCOTCH_ARCH_PATH##*-}" = system ]
|
$SCOTCH_ARCH_PATH/include/scotch.h \
|
||||||
then
|
/usr/include/scotch/scotch.h \
|
||||||
[ -f "$header" ] || header=/usr/include/scotch.h
|
/usr/include/scotch.h
|
||||||
fi
|
) || {
|
||||||
[ -f "$header" ] || {
|
|
||||||
echo "$warning (no header)"
|
echo "$warning (no header)"
|
||||||
return 2 # file not found
|
return 2 # file not found
|
||||||
}
|
}
|
||||||
|
|
||||||
# Library
|
# Library
|
||||||
[ -r $FOAM_EXT_LIBBIN/libscotch.so ] || \
|
[ "${SCOTCH_ARCH_PATH##*-}" = system ] || \
|
||||||
[ -r $SCOTCH_ARCH_PATH/lib/libscotch.so ] || \
|
findFirstFile \
|
||||||
[ -r $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so ] || \
|
$FOAM_EXT_LIBBIN/libscotch.so \
|
||||||
[ "${SCOTCH_ARCH_PATH##*-}" = system ] || {
|
$SCOTCH_ARCH_PATH/lib/libscotch.a \
|
||||||
|
$SCOTCH_ARCH_PATH/lib/libscotch.so \
|
||||||
|
$SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.a \
|
||||||
|
$SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so \
|
||||||
|
> /dev/null || {
|
||||||
echo "$warning (missing library)"
|
echo "$warning (missing library)"
|
||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ensure consistent sizes between OpenFOAM and scotch header
|
# Ensure consistent sizes between OpenFOAM and scotch header
|
||||||
# extract 'typedef int64_t SCOTCH_Num' or equivalent
|
# extract 'typedef int64_t SCOTCH_Num' or equivalent
|
||||||
local label=$(sed -ne \
|
label=$(sed -ne \
|
||||||
's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/ip' \
|
's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/ip' \
|
||||||
"$header")
|
"$header")
|
||||||
|
|
||||||
: ${label:=unknown}
|
: ${label:=unknown}
|
||||||
|
|
||||||
|
# No SCOTCH_VERSION set? Try to obtain from header
|
||||||
|
# extract #define SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL
|
||||||
|
[ -n "$SCOTCH_VERSION" ] || \
|
||||||
|
SCOTCH_VERSION=$(
|
||||||
|
eval $(
|
||||||
|
sed -ne \
|
||||||
|
's/^ *#define *SCOTCH_\(VERSION\|RELEASE\|PATCHLEVEL\) *\([0-9][0-9]*\).*$/\1=\2/p' \
|
||||||
|
"$header"
|
||||||
|
)
|
||||||
|
|
||||||
|
set -- $VERSION $RELEASE $PATCHLEVEL
|
||||||
|
IFS="."
|
||||||
|
[ "$#" -gt 0 ] && echo "scotch-$*"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Failsafe value
|
||||||
|
: ${SCOTCH_VERSION:=scotch}
|
||||||
|
|
||||||
case "$WM_LABEL_SIZE:$label" in
|
case "$WM_LABEL_SIZE:$label" in
|
||||||
(32:int32_t | 32:int | 64:int64_t | 64:long)
|
(32:int32_t | 32:int | 64:int64_t | 64:long)
|
||||||
echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
|
echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
|
||||||
@ -168,4 +211,5 @@ fi
|
|||||||
wmake $targetType decompositionMethods
|
wmake $targetType decompositionMethods
|
||||||
wmake $targetType decompose
|
wmake $targetType decompose
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -99,7 +99,7 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells
|
|||||||
forAll(cCells, i)
|
forAll(cCells, i)
|
||||||
{
|
{
|
||||||
// Get locally-compact cell index of neighbouring cell
|
// Get locally-compact cell index of neighbouring cell
|
||||||
label nbrCelli = oldToNew[cCells[i]];
|
const label nbrCelli = oldToNew[cCells[i]];
|
||||||
if (nbrCelli == -1)
|
if (nbrCelli == -1)
|
||||||
{
|
{
|
||||||
cutConnections[allDist[cCells[i]]]++;
|
cutConnections[allDist[cCells[i]]]++;
|
||||||
@ -109,10 +109,10 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells
|
|||||||
// Reconvert local cell index into global one
|
// Reconvert local cell index into global one
|
||||||
|
|
||||||
// Get original neighbour
|
// Get original neighbour
|
||||||
label celli = set[subCelli];
|
const label celli = set[subCelli];
|
||||||
label oldNbrCelli = cellCells[celli][i];
|
const label oldNbrCelli = cellCells[celli][i];
|
||||||
// Get processor from original neighbour
|
// Get processor from original neighbour
|
||||||
label proci = globalCells.whichProcID(oldNbrCelli);
|
const label proci = globalCells.whichProcID(oldNbrCelli);
|
||||||
// Convert into global compact numbering
|
// Convert into global compact numbering
|
||||||
cCells[newI++] = globalSubCells.toGlobal(proci, nbrCelli);
|
cCells[newI++] = globalSubCells.toGlobal(proci, nbrCelli);
|
||||||
}
|
}
|
||||||
@ -127,15 +127,16 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
const labelListList& pointPoints,
|
const labelListList& pointPoints,
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
const scalarField& pointWeights,
|
const scalarField& pointWeights,
|
||||||
const labelList& pointMap, // map back to original points
|
const labelUList& pointMap, // map back to original points
|
||||||
const label levelI,
|
const label currLevel,
|
||||||
|
const label leafOffset,
|
||||||
|
|
||||||
labelField& finalDecomp
|
labelList& finalDecomp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelList dist
|
labelList dist
|
||||||
(
|
(
|
||||||
methods_[levelI].decompose
|
methods_[currLevel].decompose
|
||||||
(
|
(
|
||||||
pointPoints,
|
pointPoints,
|
||||||
points,
|
points,
|
||||||
@ -143,30 +144,62 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(pointMap, i)
|
// The next recursion level
|
||||||
|
const label nextLevel = currLevel+1;
|
||||||
|
|
||||||
|
// Number of domains at this current level
|
||||||
|
const label nCurrDomains = methods_[currLevel].nDomains();
|
||||||
|
|
||||||
|
// Calculate the domain remapping.
|
||||||
|
// The decompose() method delivers a distribution of [0..nDomains-1]
|
||||||
|
// which we map to the final location according to the decomposition
|
||||||
|
// leaf we are on.
|
||||||
|
|
||||||
|
labelList domainLookup(nCurrDomains);
|
||||||
{
|
{
|
||||||
label orig = pointMap[i];
|
label sizes = 1; // Cumulative number of domains
|
||||||
finalDecomp[orig] += dist[i];
|
for (label i = 0; i <= currLevel; ++i)
|
||||||
|
{
|
||||||
|
sizes *= methods_[i].nDomains();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Distribution of domains at this level
|
||||||
|
sizes = this->nDomains() / sizes;
|
||||||
|
|
||||||
|
forAll(domainLookup, i)
|
||||||
|
{
|
||||||
|
domainLookup[i] = i * sizes + leafOffset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levelI != methods_.size()-1)
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "Distribute at level " << currLevel
|
||||||
|
<< " to domains" << nl
|
||||||
|
<< flatOutput(domainLookup) << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract processor+local index from point-point addressing
|
||||||
|
forAll(pointMap, i)
|
||||||
|
{
|
||||||
|
const label orig = pointMap[i];
|
||||||
|
finalDecomp[orig] = domainLookup[dist[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextLevel < methods_.size())
|
||||||
{
|
{
|
||||||
// Recurse
|
// Recurse
|
||||||
|
|
||||||
// Determine points per domain
|
// Determine points per domain
|
||||||
label n = methods_[levelI].nDomains();
|
labelListList domainToPoints(invertOneToMany(nCurrDomains, dist));
|
||||||
labelListList domainToPoints(invertOneToMany(n, dist));
|
|
||||||
|
|
||||||
// 'Make space' for new levels of decomposition
|
|
||||||
finalDecomp *= methods_[levelI+1].nDomains();
|
|
||||||
|
|
||||||
// Extract processor+local index from point-point addressing
|
// Extract processor+local index from point-point addressing
|
||||||
if (debug && Pstream::master())
|
if (debug && Pstream::master())
|
||||||
{
|
{
|
||||||
Pout<< "Decomposition at level " << levelI << " :" << endl;
|
Pout<< "Decomposition at level " << currLevel << " :" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label domainI = 0; domainI < n; domainI++)
|
for (label domainI = 0; domainI < nCurrDomains; domainI++)
|
||||||
{
|
{
|
||||||
// Extract elements for current domain
|
// Extract elements for current domain
|
||||||
const labelList domainPoints(findIndices(dist, domainI));
|
const labelList domainPoints(findIndices(dist, domainI));
|
||||||
@ -180,7 +213,7 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
labelList nOutsideConnections;
|
labelList nOutsideConnections;
|
||||||
subsetGlobalCellCells
|
subsetGlobalCellCells
|
||||||
(
|
(
|
||||||
n,
|
nCurrDomains,
|
||||||
domainI,
|
domainI,
|
||||||
dist,
|
dist,
|
||||||
|
|
||||||
@ -196,12 +229,12 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
Pstream::listCombineScatter(nOutsideConnections);
|
Pstream::listCombineScatter(nOutsideConnections);
|
||||||
label nPatches = 0;
|
label nPatches = 0;
|
||||||
label nFaces = 0;
|
label nFaces = 0;
|
||||||
forAll(nOutsideConnections, i)
|
for (const label nConnect : nOutsideConnections)
|
||||||
{
|
{
|
||||||
if (nOutsideConnections[i] > 0)
|
if (nConnect > 0)
|
||||||
{
|
{
|
||||||
nPatches++;
|
++nPatches;
|
||||||
nFaces += nOutsideConnections[i];
|
nFaces += nConnect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +257,8 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
subPoints,
|
subPoints,
|
||||||
subWeights,
|
subWeights,
|
||||||
subPointMap,
|
subPointMap,
|
||||||
levelI+1,
|
nextLevel,
|
||||||
|
domainLookup[domainI], // The offset for this level and leaf
|
||||||
|
|
||||||
finalDecomp
|
finalDecomp
|
||||||
);
|
);
|
||||||
@ -238,24 +272,30 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// Do straight decompose of two levels
|
// Do straight decompose of two levels
|
||||||
label nNext = methods_[levelI+1].nDomains();
|
const label nNext = methods_[nextLevel].nDomains();
|
||||||
label nTotal = n*nNext;
|
const label nTotal = nCurrDomains * nNext;
|
||||||
|
|
||||||
// Retrieve original level0 dictionary and modify number of domains
|
// Get original level0 dictionary and modify numberOfSubdomains
|
||||||
dictionary::const_iterator iter =
|
dictionary level0Dict;
|
||||||
decompositionDict_.optionalSubDict(typeName + "Coeffs").begin();
|
forAllConstIter(dictionary, methodsDict_, iter)
|
||||||
dictionary myDict = iter().dict();
|
{
|
||||||
myDict.set("numberOfSubdomains", nTotal);
|
if (iter().isDict())
|
||||||
|
{
|
||||||
|
level0Dict = iter().dict();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
level0Dict.set("numberOfSubdomains", nTotal);
|
||||||
|
|
||||||
if (debug && Pstream::master())
|
if (debug && Pstream::master())
|
||||||
{
|
{
|
||||||
Pout<< "Reference decomposition with " << myDict << " :"
|
Pout<< "Reference decomposition with " << level0Dict << " :"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
autoPtr<decompositionMethod> method0 = decompositionMethod::New
|
autoPtr<decompositionMethod> method0 = decompositionMethod::New
|
||||||
(
|
(
|
||||||
myDict
|
level0Dict
|
||||||
);
|
);
|
||||||
labelList dist
|
labelList dist
|
||||||
(
|
(
|
||||||
@ -267,12 +307,12 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (label blockI = 0; blockI < n; blockI++)
|
for (label blockI = 0; blockI < nCurrDomains; blockI++)
|
||||||
{
|
{
|
||||||
// Count the number inbetween blocks of nNext size
|
// Count the number inbetween blocks of nNext size
|
||||||
|
|
||||||
label nPoints = 0;
|
label nPoints = 0;
|
||||||
labelList nOutsideConnections(n, 0);
|
labelList nOutsideConnections(nCurrDomains, 0);
|
||||||
forAll(pointPoints, pointi)
|
forAll(pointPoints, pointi)
|
||||||
{
|
{
|
||||||
if ((dist[pointi] / nNext) == blockI)
|
if ((dist[pointi] / nNext) == blockI)
|
||||||
@ -283,7 +323,7 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
|
|
||||||
forAll(pPoints, i)
|
forAll(pPoints, i)
|
||||||
{
|
{
|
||||||
label distBlockI = dist[pPoints[i]] / nNext;
|
const label distBlockI = dist[pPoints[i]] / nNext;
|
||||||
if (distBlockI != blockI)
|
if (distBlockI != blockI)
|
||||||
{
|
{
|
||||||
nOutsideConnections[distBlockI]++;
|
nOutsideConnections[distBlockI]++;
|
||||||
@ -301,12 +341,12 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
Pstream::listCombineScatter(nOutsideConnections);
|
Pstream::listCombineScatter(nOutsideConnections);
|
||||||
label nPatches = 0;
|
label nPatches = 0;
|
||||||
label nFaces = 0;
|
label nFaces = 0;
|
||||||
forAll(nOutsideConnections, i)
|
for (const label nConnect : nOutsideConnections)
|
||||||
{
|
{
|
||||||
if (nOutsideConnections[i] > 0)
|
if (nConnect > 0)
|
||||||
{
|
{
|
||||||
nPatches++;
|
++nPatches;
|
||||||
nFaces += nOutsideConnections[i];
|
nFaces += nConnect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,31 +370,37 @@ void Foam::multiLevelDecomp::decompose
|
|||||||
Foam::multiLevelDecomp::multiLevelDecomp(const dictionary& decompositionDict)
|
Foam::multiLevelDecomp::multiLevelDecomp(const dictionary& decompositionDict)
|
||||||
:
|
:
|
||||||
decompositionMethod(decompositionDict),
|
decompositionMethod(decompositionDict),
|
||||||
methodsDict_(decompositionDict_.optionalSubDict(typeName + "Coeffs"))
|
methodsDict_(decompositionDict_.subDict(typeName + "Coeffs"))
|
||||||
{
|
{
|
||||||
methods_.setSize(methodsDict_.size());
|
methods_.setSize(methodsDict_.size());
|
||||||
label i = 0;
|
label nLevels = 0;
|
||||||
forAllConstIter(dictionary, methodsDict_, iter)
|
forAllConstIter(dictionary, methodsDict_, iter)
|
||||||
{
|
{
|
||||||
methods_.set(i++, decompositionMethod::New(iter().dict()));
|
// Ignore primitive entries which may be there for additional control
|
||||||
|
if (iter().isDict())
|
||||||
|
{
|
||||||
|
methods_.set(nLevels++, decompositionMethod::New(iter().dict()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
label n = 1;
|
methods_.setSize(nLevels);
|
||||||
|
|
||||||
|
label nTot = 1;
|
||||||
Info<< "decompositionMethod " << type() << " :" << endl;
|
Info<< "decompositionMethod " << type() << " :" << endl;
|
||||||
forAll(methods_, i)
|
forAll(methods_, i)
|
||||||
{
|
{
|
||||||
Info<< " level " << i << " decomposing with " << methods_[i].type()
|
Info<< " level " << i << " decomposing with " << methods_[i].type()
|
||||||
<< " into " << methods_[i].nDomains() << " subdomains." << endl;
|
<< " into " << methods_[i].nDomains() << " subdomains." << endl;
|
||||||
|
|
||||||
n *= methods_[i].nDomains();
|
nTot *= methods_[i].nDomains();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n != nDomains())
|
if (nTot != nDomains())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Top level decomposition specifies " << nDomains()
|
<< "Top level decomposition specifies " << nDomains()
|
||||||
<< " domains which is not equal to the product of"
|
<< " domains which is not equal to the product of"
|
||||||
<< " all sub domains " << n
|
<< " all sub domains " << nTot
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -385,7 +431,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
|||||||
CompactListList<label> cellCells;
|
CompactListList<label> cellCells;
|
||||||
calcCellCells(mesh, identity(cc.size()), cc.size(), true, cellCells);
|
calcCellCells(mesh, identity(cc.size()), cc.size(), true, cellCells);
|
||||||
|
|
||||||
labelField finalDecomp(cc.size(), 0);
|
labelList finalDecomp(cc.size(), 0);
|
||||||
labelList cellMap(identity(cc.size()));
|
labelList cellMap(identity(cc.size()));
|
||||||
|
|
||||||
decompose
|
decompose
|
||||||
@ -395,6 +441,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
|||||||
cWeights,
|
cWeights,
|
||||||
cellMap, // map back to original cells
|
cellMap, // map back to original cells
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
|
|
||||||
finalDecomp
|
finalDecomp
|
||||||
);
|
);
|
||||||
@ -410,7 +457,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
|||||||
const scalarField& pointWeights
|
const scalarField& pointWeights
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelField finalDecomp(points.size(), 0);
|
labelList finalDecomp(points.size(), 0);
|
||||||
labelList pointMap(identity(points.size()));
|
labelList pointMap(identity(points.size()));
|
||||||
|
|
||||||
decompose
|
decompose
|
||||||
@ -420,6 +467,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
|||||||
pointWeights,
|
pointWeights,
|
||||||
pointMap, // map back to original points
|
pointMap, // map back to original points
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
|
|
||||||
finalDecomp
|
finalDecomp
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -71,21 +71,22 @@ class multiLevelDecomp
|
|||||||
labelList& cutConnections
|
labelList& cutConnections
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Decompose level methodI without addressing
|
//- Decompose at 'currLevel' without addressing
|
||||||
void decompose
|
void decompose
|
||||||
(
|
(
|
||||||
const labelListList& pointPoints,
|
const labelListList& pointPoints,
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
const scalarField& pointWeights,
|
const scalarField& pointWeights,
|
||||||
const labelList& pointMap, // map back to original points
|
const labelUList& pointMap, // map back to original points
|
||||||
const label levelI,
|
const label currLevel,
|
||||||
|
const label leafOffset,
|
||||||
|
|
||||||
labelField& finalDecomp
|
labelList& finalDecomp
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct and assignment
|
//- Disallow default bitwise copy construct and assignment
|
||||||
void operator=(const multiLevelDecomp&);
|
void operator=(const multiLevelDecomp&) = delete;
|
||||||
multiLevelDecomp(const multiLevelDecomp&);
|
multiLevelDecomp(const multiLevelDecomp&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -164,7 +164,6 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
// Set points and cell/face labels to empty lists
|
// Set points and cell/face labels to empty lists
|
||||||
//Info<< "calcSamples : Both start_ and end_ outside domain"
|
//Info<< "calcSamples : Both start_ and end_ outside domain"
|
||||||
// << endl;
|
// << endl;
|
||||||
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
|
||||||
|
|
||||||
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,7 +75,7 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
|
|||||||
|
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
label nMask = 0;
|
label nMask = 0;
|
||||||
for (size_t chari = 0; chari < fieldFileName.size(); chari++)
|
for (size_t chari = 0; chari < fieldFileName.size(); ++chari)
|
||||||
{
|
{
|
||||||
if (fieldFileName[chari] == '*')
|
if (fieldFileName[chari] == '*')
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
|
|||||||
label n = surfPtr_->size();
|
label n = surfPtr_->size();
|
||||||
forAll(values, cmptI)
|
forAll(values, cmptI)
|
||||||
{
|
{
|
||||||
values.setSize(n);
|
values[cmptI].setCapacity(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read data file using schema generated while reading the surface
|
// Read data file using schema generated while reading the surface
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -647,7 +647,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh
|
|||||||
surfaceName,
|
surfaceName,
|
||||||
mesh.time().constant(), // instance
|
mesh.time().constant(), // instance
|
||||||
"triSurface", // local
|
"triSurface", // local
|
||||||
mesh, // registry
|
mesh.time(), // registry
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
@ -679,7 +679,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh
|
|||||||
dict.lookup("surface"),
|
dict.lookup("surface"),
|
||||||
mesh.time().constant(), // instance
|
mesh.time().constant(), // instance
|
||||||
"triSurface", // local
|
"triSurface", // local
|
||||||
mesh, // registry
|
mesh.time(), // registry
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
@ -712,7 +712,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh
|
|||||||
name,
|
name,
|
||||||
mesh.time().constant(), // instance
|
mesh.time().constant(), // instance
|
||||||
"triSurface", // local
|
"triSurface", // local
|
||||||
mesh, // registry
|
mesh.time(), // registry
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -642,7 +642,7 @@ Foam::discreteSurface::discreteSurface
|
|||||||
surfaceName,
|
surfaceName,
|
||||||
mesh.time().constant(), // instance
|
mesh.time().constant(), // instance
|
||||||
"triSurface", // local
|
"triSurface", // local
|
||||||
mesh, // registry
|
mesh.time(), // registry
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
@ -680,7 +680,7 @@ Foam::discreteSurface::discreteSurface
|
|||||||
dict.lookup("surface"),
|
dict.lookup("surface"),
|
||||||
mesh.time().constant(), // instance
|
mesh.time().constant(), // instance
|
||||||
"triSurface", // local
|
"triSurface", // local
|
||||||
mesh, // registry
|
mesh.time(), // registry
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
@ -716,7 +716,7 @@ Foam::discreteSurface::discreteSurface
|
|||||||
name,
|
name,
|
||||||
mesh.time().constant(), // instance
|
mesh.time().constant(), // instance
|
||||||
"triSurface", // local
|
"triSurface", // local
|
||||||
mesh, // registry
|
mesh.time(), // registry
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "triSurface.H"
|
#include "triSurface.H"
|
||||||
|
#include "NASCore.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "IStringStream.H"
|
#include "IStringStream.H"
|
||||||
|
|
||||||
@ -47,25 +48,9 @@ namespace Foam
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Do weird things to extract number
|
// Do weird things to extract number
|
||||||
static scalar parseNASCoord(const string& s)
|
static inline scalar parseNASCoord(const string& s)
|
||||||
{
|
{
|
||||||
size_t expSign = s.find_last_of("+-");
|
return fileFormats::NASCore::parseNASCoord(s);
|
||||||
|
|
||||||
if (expSign != string::npos && expSign > 0 && !isspace(s[expSign-1]))
|
|
||||||
{
|
|
||||||
scalar mantissa = readScalar(IStringStream(s.substr(0, expSign))());
|
|
||||||
scalar exponent = readScalar(IStringStream(s.substr(expSign+1))());
|
|
||||||
|
|
||||||
if (s[expSign] == '-')
|
|
||||||
{
|
|
||||||
exponent = -exponent;
|
|
||||||
}
|
|
||||||
return mantissa*pow(10, exponent);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return readScalar(IStringStream(s)());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -311,8 +296,8 @@ bool triSurface::readNAS(const fileName& fName)
|
|||||||
// GRID* 126 0 -5.55999875E+02 -5.68730474E+02
|
// GRID* 126 0 -5.55999875E+02 -5.68730474E+02
|
||||||
// * 2.14897901E+02
|
// * 2.14897901E+02
|
||||||
label index =
|
label index =
|
||||||
readLabel(IStringStream(readNASToken(line, 8, linei))());
|
readLabel(IStringStream(readNASToken(line, 16, linei))());
|
||||||
readNASToken(line, 8, linei);
|
readNASToken(line, 16, linei);
|
||||||
scalar x = parseNASCoord(readNASToken(line, 16, linei));
|
scalar x = parseNASCoord(readNASToken(line, 16, linei));
|
||||||
scalar y = parseNASCoord(readNASToken(line, 16, linei));
|
scalar y = parseNASCoord(readNASToken(line, 16, linei));
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,6 @@ FoamFile
|
|||||||
|
|
||||||
transportModel Newtonian;
|
transportModel Newtonian;
|
||||||
|
|
||||||
nu .5e-05;
|
nu 1.5e-05;
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user