Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
da07aa9a
Commit
da07aa9a
authored
Jun 13, 2019
by
sergio
Committed by
Andrew Heather
Jun 13, 2019
Browse files
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
parents
50cdddf4
f8639251
Changes
26
Hide whitespace changes
Inline
Side-by-side
META-INFO/api-info
View file @
da07aa9a
api=190
4
api=190
6
patch=0
README.md
View file @
da07aa9a
...
...
@@ -33,9 +33,9 @@ Please see the relevant guides:
[
repo openfoam
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/
[
repo third
]:
https://develop.openfoam.com/Development/ThirdParty-plus/
[
link openfoam-issues
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/BuildIssues.txt
[
link openfoam-readme
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md
[
link openfoam-config
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/etc/README.md
[
link openfoam-issues
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BuildIssues.md
[
link openfoam-config
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md
[
link openfoam-build
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md
[
link openfoam-require
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md
[
link third-readme
]:
https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md
...
...
applications/solvers/finiteArea/surfactantFoam/createVolFields.H
View file @
da07aa9a
...
...
@@ -16,7 +16,7 @@
);
vsm
.
mapToVolume
(
Cs
,
Cvf
.
boundaryFieldRef
());
Cvf
.
write
();
//
Cvf.write();
volVectorField
U
(
...
...
@@ -33,4 +33,4 @@
);
vsm
.
mapToVolume
(
Us
,
U
.
boundaryFieldRef
());
U
.
write
();
//
U.write();
applications/test/Matrix/Test-Matrix.C
View file @
da07aa9a
...
...
@@ -30,6 +30,7 @@ License
#include
"LLTMatrix.H"
#include
"Random.H"
#include
"SortList.H"
#include
"Switch.H"
#include
<algorithm>
using
namespace
Foam
;
...
...
@@ -237,22 +238,14 @@ int main(int argc, char *argv[])
Info
<<
"# SquareMatrix<scalar> example:"
<<
nl
;
printMatrix
(
Info
,
S
)
<<
nl
;
const
label
mRows
=
S
.
m
();
const
label
nCols
=
S
.
n
();
const
label
size
=
S
.
size
();
const
labelPair
sizes
=
S
.
sizes
();
const
bool
isEmpty
=
S
.
empty
();
const
long
constPointer
=
long
(
S
.
cdata
());
long
pointer
=
long
(
S
.
data
());
Info
<<
"Number of rows ="
<<
tab
<<
mRows
<<
nl
<<
"Number of columns = "
<<
tab
<<
nCols
<<
nl
<<
"Number of elements = "
<<
tab
<<
size
<<
nl
<<
"Number of rows/columns = "
<<
tab
<<
sizes
<<
nl
<<
"Matrix is empty = "
<<
tab
<<
isE
mpty
<<
nl
<<
"Constant pointer = "
<<
tab
<<
constPointer
<<
nl
<<
"Pointer = "
<<
tab
<<
po
int
er
<<
nl
<<
"Number of rows ="
<<
tab
<<
S
.
m
()
<<
nl
<<
"Number of columns = "
<<
tab
<<
S
.
n
()
<<
nl
<<
"Number of elements = "
<<
tab
<<
S
.
size
()
<<
nl
<<
"Number of rows/columns = "
<<
tab
<<
S
.
sizes
()
<<
nl
<<
"Matrix is empty = "
<<
tab
<<
Switch
(
S
.
e
mpty
())
<<
nl
<<
"Constant pointer = "
<<
tab
<<
uintptr_t
(
S
.
cdata
())
<<
nl
<<
"Pointer = "
<<
tab
<<
u
int
ptr_t
(
S
.
data
())
<<
nl
<<
nl
;
horizontalLine
();
...
...
doc/Build.md
View file @
da07aa9a
...
...
@@ -15,7 +15,8 @@ The [third-party][repo third] directory includes a
[
build guide
][
link third-build
]
.
Some known build issues related to specific compiler and VTK library versions
can be found in the
[
$WM_PROJECT_DIR/BuildIssues.txt
][
link openfoam-issues
]
file.
can be found in the
[
$WM_PROJECT_DIR/doc/BuildIssues.md
][
link openfoam-issues
]
file.
If you need to change the default versions for third-party libraries,
or use system libraries for some components, please some additional
...
...
@@ -94,10 +95,10 @@ simpleFoam
OpenFOAM ships with ParaView sources for post-processing OpenFOAM
field results. However, the paraview version distributed with
the operating system or a
[
binary package
][
download ParaView
]
will be sufficient, and avoids additional compilation complexity.
will
often
be sufficient, and avoids additional compilation complexity.
If
do
you wish to compile ParaView from source
s
, it is recommended
that you do so
*after*
completing an initial compilation of OpenFOAM.
If you
do
wish to compile ParaView from source, it is recommended
that you do so
**
*after*
*
*
completing an initial compilation of OpenFOAM.
This gets the process started much more quickly. At a later stage,
OpenFOAM can be updated to compile with paraview. Only the affected
applications will be compiled (eg, the blockMesh reader module) and the
...
...
@@ -123,8 +124,9 @@ More details in the [ThirdParty build guide][link third-build].
[
repo openfoam
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/
[
repo third
]:
https://develop.openfoam.com/Development/ThirdParty-plus/
[
link openfoam-issues
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/BuildIssues.txt
[
link openfoam-config
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/etc/README.md
[
link openfoam-readme
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md
[
link openfoam-issues
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BuildIssues.md
[
link openfoam-config
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md
[
link openfoam-build
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md
[
link openfoam-require
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md
[
link third-readme
]:
https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md
...
...
BuildIssues.
txt
→
doc/
BuildIssues.
md
View file @
da07aa9a
OpenFOAM-1712
==================
Known Build Issues
==================
## Known Build Issues (OpenFOAM-v1906)
---------------------
Intel MPI (Gcc/Clang)
---------------------
### Intel MPI with Gcc/Clang)
Either I_MPI_ROOT or MPI_ROOT can be used to specify the Intel-MPI
installation directory path.
Either
`I_MPI_ROOT`
(preferred) or
`MPI_ROOT`
can be used to specify
the Intel-MPI installation directory path.
The ThirdParty build of ptscotch uses
`mpiicc`
for Intel-MPI instead
of the usual
`mpicc`
. When gcc or clang are used, it is quite likely
that the
`I_MPI_CC`
environment variable also needs to be set
accordingly.
See
`mpiicc -help`
for more information about environment variables.
The ThirdParty build of ptscotch uses `mpiicc` for Intel-MPI
instead of the usual `mpicc`.
When gcc or clang are used, it is highly likely that the
I_MPI_CC environment variable also needs to be set accordingly.
See `mpiicc -help` for more information about environment variables.
--------------
Intel Compiler
--------------
Since OpenFOAM uses C++11, a fairly recent version is required.
The Intel compiler - icc (ICC) 17.0.1 20161005 is ok, but the
initial release - icc (ICC) 17.0.0 20160721 - has a bug that
will result in these types of error messages.
MatrixSpaceI.H(492): error: no instance of overloaded function
"Foam::MatrixSpace<Form, Cmpt, Mrows, Ncols>::Block<SubTensor,
BRowStart, BColStart>::operator=" matches the specified type
---
VTK
---
### VTK
If using the runTimePostProcessing to create on-the-fly images, you
can simply just compile ParaView and these libraries will be used.
If you elect to use a separate VTK compilation (for example for
off-screen rendering), it is advisable to reuse the VTK libraries that
are provided with ParaView by making an appropriate symlink
prior to using makeVTK. This doesn't just reduce disk-space, but works
much better than using the VTK tar file.
Using runTimePostProcessing with the 'plain' VTK libraries does
generally work, but does not exit cleanly:
Using runTimePostProcessing with the
*plain*
VTK libraries does
generally work, but may not exit cleanly:
```
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1:
undefined symbol: _ZN33vtkFilteringInformationKeyManager13ClassFinalizeEv
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1:
undefined symbol: _ZN33vtkFilteringInformationKeyManager13ClassFinalizeEv
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonDataModel-7.1.so.1:
undefined symbol: _ZN49vtkInformationQuadratureSchemeDefinitionVectorKeyD1Ev
```
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonDataModel-7.1.so.1:
undefined symbol: _ZN49vtkInformationQuadratureSchemeDefinitionVectorKeyD1Ev
This error appears to be suppressed if VTK is compiled with a
`Debug`
build-type.
This error appears to be suppressed if VTK is compiled with a Debug build-type.
-------------------------
Building on older systems
-------------------------
### Building on older systems
If the system gcc is too old for building OpenFOAM, a third-party gcc or
clang/llvm installation can be used. If building clang/llvm, note that
there are also minimum gcc/g++ requirements there:
Min gcc/g++
=========== ==========
4.4 llvm-3.4.2
4.7 llvm-3.5.2 - llvm-3.7.0
there are also minimum gcc/g++ requirements as listed in the
detailed
[
build guide
][
link third-build
]
.
If your system compiler is too old to build the minimum required gcc or
clang/llvm, it is just simply too old.
---------------------------------
ThirdParty clang without gmp/mpfr
---------------------------------
### ThirdParty clang without gmp/mpfr
If using ThirdParty clang without gmp/mpfr, the ThirdParty makeCGAL
script will need to be run manually and specify that there is no
gmp/mpfr. Eg,
cd $WM_THIRD_PARTY_DIR
./makeCGAL gmp-none mpfr-none
```
cd $WM_THIRD_PARTY_DIR
./makeCGAL gmp-none mpfr-none
```
Subequent compilation with Allwmake will now run largely without any
problems, except that the components linking against CGAL
(foamyMesh and surfaceBooleanFeatures) will also try to link against
a nonexistent mpfr library. As a workaround, the link-dependency can
be removed in wmake/rules/General/CGAL :
```
CGAL_LIBS = \
-L$(BOOST_ARCH_PATH)/lib \
-L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-L$(CGAL_ARCH_PATH)/lib \
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-lCGAL
```
CGAL_LIBS = \
-L$(BOOST_ARCH_PATH)/lib \
-L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-L$(CGAL_ARCH_PATH)/lib \
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-lCGAL
This is a temporary inconvenience until a more robust solution is found.
A robuster solution is still being sought.
-------------------------
Building with spack
-------------------------
### Building with spack
If you are building with spack, note that the depends_on for paraview
resolves poorly. The +qt dependency (for building the reader module)
If you are building with spack, note that the
`
depends_on
`
for paraview
resolves poorly. The
`
+qt
`
dependency (for building the reader module)
may need to be specified as a preference by including the following in
your
`~/.spack/packages.yaml`
file:
```
packages:
paraview:
variants: +qt
```
It appears that spack will otherwise ignore any
`paraview+qt`
version
and attempt to install a
`paraview~qt`
version instead.
packages:
paraview:
variants: +qt
--
<!-- Links -->
It appears that spack will otherwise ignore any paraview+qt version
and attempt to install a paraview~qt version inste
ad
.
[
page ParaView
]:
http://www.paraview.org/
[
download ParaView
]:
https://www.paraview.org/downlo
ad
/
--
<!-- OpenFOAM -->
[
repo openfoam
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/
[
repo third
]:
https://develop.openfoam.com/Development/ThirdParty-plus/
[
link openfoam-readme
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md
[
link openfoam-issues
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BuildIssues.md
[
link openfoam-config
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md
[
link openfoam-build
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md
[
link openfoam-require
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md
[
link third-readme
]:
https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md
[
link third-build
]:
https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/BUILD.md
[
link third-require
]:
https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/Requirements.md
---
Copyright 2019 OpenCFD Ltd
etc/README
.md
→
doc/Config
.md
View file @
da07aa9a
File moved
doc/Requirements.md
View file @
da07aa9a
...
...
@@ -10,15 +10,21 @@ OpenFOAM requires a functioning C++11 compiler and `make` build toolchain.
-
fftw: 3.3.7 (recommended - required for FFT-related functionality)
-
paraview: 5.5.2 (for visualization)
If using the Intel
®
compiler,
`17.0.1 20161005`
is the minimum
usable version.
To check the installed versions
| Program | To check the version |
|---------------|-----------------------|
| gcc | gcc --version |
| icc | icc --version |
| cmake | cmake --version |
| openmpi | orterun --version |
### Additional utilities
-
flex
...
...
@@ -81,7 +87,6 @@ sudo zypper install cmake boost-devel mpfr-devel gmp-devel openmpi-devel gnuplot
This installs
| Program | openSUSE | Program version |
|-----------|-----------|-----------------|
| gcc | 15.0 | 7.4.3 |
...
...
@@ -157,7 +162,7 @@ A partial list is given in the [ThirdParty requirements][link third-require].
<!-- OpenFOAM -->
[
link openfoam-readme
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md
[
link openfoam-config
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/
etc/README
.md
[
link openfoam-config
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/
doc/Config
.md
[
link openfoam-build
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md
[
link openfoam-require
]:
https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md
[
link third-readme
]:
https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md
...
...
etc/config.csh/vtk
View file @
da07aa9a
...
...
@@ -25,7 +25,7 @@
#
# It is recommended to use VTK sources from ParaView (5.0.1 or later)
#
# See BuildIssues.
txt
about problems that can be encountered when using
# See
doc/
BuildIssues.
md
about problems that can be encountered when using
# the 'plain' VTK sources.
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
...
...
etc/config.sh/vtk
View file @
da07aa9a
...
...
@@ -26,7 +26,7 @@
#
# It is recommended to use VTK sources from ParaView (5.0.1 or later)
#
# See BuildIssues.
txt
about problems that can be encountered when using
# See
doc/
BuildIssues.
md
about problems that can be encountered when using
# the 'plain' VTK sources.
#------------------------------------------------------------------------------
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
...
...
etc/controlDict
View file @
da07aa9a
...
...
@@ -68,7 +68,8 @@ InfoSwitches
allowSystemOperations 1;
// Allow space character in fileName (use with caution)
allowSpaceInFileName 0;
// Default: 0 for non-Windows, 1 for Windows
//// allowSpaceInFileName 0;
}
...
...
src/OpenFOAM/global/argList/argListHelp.C
View file @
da07aa9a
...
...
@@ -33,6 +33,12 @@ License
namespace
Foam
{
// Convert api number (YYMM) -> 20YY. Eg, 1906 -> 2019
static
inline
int
apiYear
()
{
return
2000
+
(
foamVersion
::
api
/
100
);
}
// manpage Footer
static
inline
void
printManFooter
()
{
...
...
@@ -40,7 +46,7 @@ static inline void printManFooter()
<<
"Online documentation "
<<
"https://www.openfoam.com/documentation/"
<<
nl
<<
".SH COPYRIGHT"
<<
nl
<<
"Copyright
\\
(co 2018 OpenCFD Ltd."
<<
nl
;
<<
"Copyright
\\
(co 2018
-"
<<
apiYear
()
<<
"
OpenCFD Ltd."
<<
nl
;
}
...
...
src/OpenFOAM/primitives/strings/fileName/fileName.C
View file @
da07aa9a
...
...
@@ -36,11 +36,18 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const
char
*
const
Foam
::
fileName
::
typeName
=
"fileName"
;
int
Foam
::
fileName
::
debug
(
Foam
::
debug
::
debugSwitch
(
fileName
::
typeName
,
0
));
int
Foam
::
fileName
::
allowSpaceInFileName
(
#ifdef _WIN32
Foam
::
debug
::
infoSwitch
(
"allowSpaceInFileName"
,
1
)
#else
Foam
::
debug
::
infoSwitch
(
"allowSpaceInFileName"
,
0
)
#endif
);
const
Foam
::
fileName
Foam
::
fileName
::
null
;
...
...
src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C
View file @
da07aa9a
...
...
@@ -109,12 +109,13 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
if
(
!
residualPtr
)
{
WarningInFunction
<<
"Could not find residual fi
l
e : "
<<
residualName_
<<
".The residual mode won't be "
<<
nl
<<
"Could not find residual fie
ld
: "
<<
residualName_
<<
".
The residual mode won't be "
<<
nl
<<
" considered for the blended field in the stability "
<<
"blending factor. "
<<
nl
<<
" Add the corresponding residual function object. "
<<
nl
<<
" If the residual function object is already set "
<<
" Please add the corresponding 'solverInfo'"
<<
" function object with 'writeResidualFields true'."
<<
nl
<<
" If the solverInfo function object is already enabled "
<<
"you might need to wait "
<<
nl
<<
" for the first iteration."
<<
nl
<<
endl
;
...
...
src/functionObjects/forces/forceCoeffs/forceCoeffs.C
View file @
da07aa9a
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-201
7
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
...
...
@@ -42,7 +42,6 @@ namespace Foam
namespace
functionObjects
{
defineTypeNameAndDebug
(
forceCoeffs
,
0
);
addToRunTimeSelectionTable
(
functionObject
,
forceCoeffs
,
dictionary
);
}
}
...
...
@@ -61,12 +60,23 @@ void Foam::functionObjects::forceCoeffs::createFiles()
if
(
nBin_
>
1
)
{
CmBinFilePtr_
=
createFile
(
"CmBin"
);
writeBinHeader
(
"Moment coefficient bins"
,
CmBinFilePtr_
());
CdBinFilePtr_
=
createFile
(
"CdBin"
);
writeBinHeader
(
"Drag coefficient bins"
,
CdBinFilePtr_
());
CsBinFilePtr_
=
createFile
(
"CsBin"
);
writeBinHeader
(
"Side coefficient bins"
,
CsBinFilePtr_
());
ClBinFilePtr_
=
createFile
(
"ClBin"
);
writeBinHeader
(
"Lift coefficient bins"
,
ClBinFilePtr_
());
CmRollBinFilePtr_
=
createFile
(
"CmRollBin"
);
writeBinHeader
(
"Roll moment coefficient bins"
,
CmRollBinFilePtr_
());
CmPitchBinFilePtr_
=
createFile
(
"CmPitchBin"
);
writeBinHeader
(
"Moment coefficient bins"
,
CmPitchBinFilePtr_
());
CmYawBinFilePtr_
=
createFile
(
"CmYawBin"
);
writeBinHeader
(
"Yaw moment coefficient bins"
,
CmYawBinFilePtr_
());
}
}
}
...
...
@@ -79,18 +89,28 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedHeader
)
const
{
writeHeader
(
os
,
"Force coefficients"
);
writeHeaderValue
(
os
,
"liftDir"
,
liftDir_
);
writeHeaderValue
(
os
,
"dragDir"
,
dragDir_
);
writeHeaderValue
(
os
,
"pitchAxis"
,
pitchAxis_
);
writeHeaderValue
(
os
,
"dragDir"
,
coordSys_
.
e1
());
writeHeaderValue
(
os
,
"sideDir"
,
coordSys_
.
e2
());
writeHeaderValue
(
os
,
"liftDir"
,
coordSys_
.
e3
());
writeHeaderValue
(
os
,
"rollAxis"
,
coordSys_
.
e1
());
writeHeaderValue
(
os
,
"pitchAxis"
,
coordSys_
.
e2
());
writeHeaderValue
(
os
,
"yawAxis"
,
coordSys_
.
e3
());
writeHeaderValue
(
os
,
"magUInf"
,
magUInf_
);
writeHeaderValue
(
os
,
"lRef"
,
lRef_
);
writeHeaderValue
(
os
,
"Aref"
,
Aref_
);
writeHeaderValue
(
os
,
"CofR"
,
coordSys_
.
origin
());
writeHeader
(
os
,
""
);
writeCommented
(
os
,
"Time"
);
writeTabbed
(
os
,
"Cm"
);
writeTabbed
(
os
,
"Cd"
);
writeTabbed
(
os
,
"Cs"
);
writeTabbed
(
os
,
"Cl"
);
writeTabbed
(
os
,
"CmRoll"
);
writeTabbed
(
os
,
"CmPitch"
);
writeTabbed
(
os
,
"CmYaw"
);
writeTabbed
(
os
,
"Cd(f)"
);
writeTabbed
(
os
,
"Cd(r)"
);
writeTabbed
(
os
,
"Cs(f)"
);
writeTabbed
(
os
,
"Cs(r)"
);
writeTabbed
(
os
,
"Cl(f)"
);
writeTabbed
(
os
,
"Cl(r)"
);
os
<<
endl
;
...
...
@@ -114,30 +134,30 @@ void Foam::functionObjects::forceCoeffs::writeBinHeader
forAll
(
binPoints
,
pointi
)
{
binPoints
[
pointi
]
=
(
binMin_
+
(
pointi
+
1
)
*
binDx_
)
*
binDir_
;
os
<<
tab
<<
binPoints
[
pointi
].
x
();
os
<<
tab
<<
binPoints
[
pointi
].
x
();
}
os
<<
nl
;
os
<<
nl
;
writeCommented
(
os
,
"y co-ords :"
);
forAll
(
binPoints
,
pointi
)
{
os
<<
tab
<<
binPoints
[
pointi
].
y
();
os
<<
tab
<<
binPoints
[
pointi
].
y
();
}
os
<<
nl
;
os
<<
nl
;
writeCommented
(
os
,
"z co-ords :"
);
forAll
(
binPoints
,
pointi
)
{
os
<<
tab
<<
binPoints
[
pointi
].
z
();
os
<<
tab
<<
binPoints
[
pointi
].
z
();
}
os
<<
nl
;
os
<<
nl
;
writeHeader
(
os
,
""
);
writeCommented
(
os
,
"Time"
);
for
(
label
j
=
0
;
j
<
nBin_
;
j
++
)
for
(
label
j
=
0
;
j
<
nBin_
;
++
j
)
{
word
jn
(
Foam
::
name
(
j
)
+
':'
);
const
word
jn
(
Foam
::
name
(
j
)
+
':'
);
writeTabbed
(
os
,
jn
+
"total"
);
writeTabbed
(
os
,
jn
+
"pressure"
);
writeTabbed
(
os
,
jn
+
"viscous"
);
...
...
@@ -163,13 +183,13 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedData
return
;
}
scalar
pressure
=
sum
(
coeff
[
0
]);
scalar
viscous
=
sum
(
coeff
[
1
]);
scalar
porous
=
sum
(
coeff
[
2
]);
scalar
total
=
pressure
+
viscous
+
porous
;
const
scalar
pressure
=
sum
(
coeff
[
0
]);
const
scalar
viscous
=
sum
(
coeff
[
1
]);
const
scalar
porous
=
sum
(
coeff
[
2
]);
const
scalar
total
=
pressure
+
viscous
+
porous
;
Info
<<
" "
<<
title
<<
" : "
<<
total
<<
token
::
TAB
<<
"("
<<
'('
<<
"pressure: "
<<
pressure
<<
token
::
TAB
<<
"viscous: "
<<
viscous
;
...
...
@@ -178,7 +198,7 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedData
Info
<<
token
::
TAB
<<
"porous: "
<<
porous
;
}
Info
<<
")"
<<
endl
;
Info
<<
')'
<<
endl
;
}
...
...
@@ -190,7 +210,7 @@ void Foam::functionObjects::forceCoeffs::writeBinData
{
writeTime
(
os
);
for
(
label
bini
=
0
;
bini
<
nBin_
;
bini
++
)
for
(
label
bini
=
0
;
bini
<
nBin_
;
++
bini
)
{
scalar
total
=
coeffs
[
0
][
bini
]
+
coeffs
[
1
][
bini
]
+
coeffs
[
2
][
bini
];
...
...
@@ -216,45 +236,35 @@ Foam::functionObjects::forceCoeffs::forceCoeffs
)
:
forces
(
name
,
runTime
,
dict
),
liftDir_
(
Zero
),
dragDir_
(
Zero
),
pitchAxis_
(
Zero
),
magUInf_
(
0
.
0
),
lRef_
(
0
.
0
),
Aref_
(
0
.
0
),
magUInf_
(
Zero
),
lRef_
(
Zero
),
Aref_
(
Zero
),
coeffFilePtr_
(),
CmBinFilePtr_
(),
CdBinFilePtr_
(),
ClBinFilePtr_
()
CsBinFilePtr_
(),
ClBinFilePtr_
(),
CmRollBinFilePtr_
(),
CmPitchBinFilePtr_
(),
CmYawBinFilePtr_
()
{
read
(
dict
);
setCoordinateSystem
(
dict
,
"liftDir"
,
"dragDir"
);
Info
<<
endl
;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
functionObjects
::
forceCoeffs
::~
forceCoeffs
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
functionObjects
::
forceCoeffs
::
read
(
const
dictionary
&
dict
)
{
forces
::
read
(
dict
);
// Directions for lift and drag forces, and pitch moment
dict
.
readEntry
(
"liftDir"
,
liftDir_
);
dict
.
readEntry
(
"dragDir"
,
dragDir_
);
dict
.
readEntry
(
"pitchAxis"
,
pitchAxis_
);