Compare commits
38 Commits
OpenFOAM-v
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| 5aadc3a03d | |||
| 956fb4ca3a | |||
| 905d63357c | |||
| 0177b762c0 | |||
| 308615e63a | |||
| 2999c15f77 | |||
| 3d8a1c7f63 | |||
| bf14272826 | |||
| 095c9bc45b | |||
| 20c7f0970d | |||
| fd1661ae15 | |||
| 70874860b9 | |||
| 113fe48d0e | |||
| d94744e9f7 | |||
| dcf005508b | |||
| 868d6dd778 | |||
| f8e05934f1 | |||
| ed89d97627 | |||
| 5614a571f2 | |||
| 4136b686ba | |||
| c9081d5daf | |||
| a597c044c7 | |||
| d8c6b6b811 | |||
| cc6ba5c1a0 | |||
| 26420a88d7 | |||
| ff13cdd39d | |||
| 988ec18ecc | |||
| 0339e5ee0d | |||
| 07c69fdf0d | |||
| 03ab6c1a9d | |||
| e62b031f26 | |||
| 33f0ff8145 | |||
| 166164da93 | |||
| 1f68e7f9b3 | |||
| e346620a62 | |||
| df808ad3f2 | |||
| 51ed7a6034 | |||
| 0031cb1efa |
@ -1,2 +1,2 @@
|
||||
api=2212
|
||||
patch=0
|
||||
patch=240625
|
||||
|
||||
@ -9,7 +9,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -10,7 +10,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -19,7 +19,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -8,7 +8,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -30,8 +30,8 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CGALTriangulation3DKernel_H
|
||||
#define CGALTriangulation3DKernel_H
|
||||
#ifndef Foam_CGALTriangulation3DKernel_H
|
||||
#define Foam_CGALTriangulation3DKernel_H
|
||||
|
||||
// Silence boost bind deprecation warnings (before CGAL-5.2.1)
|
||||
#include "CGAL/version.h"
|
||||
@ -54,9 +54,19 @@ Description
|
||||
// #include "CGAL/Robust_circumcenter_traits_3.h"
|
||||
// typedef CGAL::Robust_circumcenter_traits_3<baseK> K;
|
||||
|
||||
#if defined(CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1050500000)
|
||||
// Prior to CGAL-5.5
|
||||
|
||||
#include "CGAL/Robust_circumcenter_filtered_traits_3.h"
|
||||
typedef CGAL::Robust_circumcenter_filtered_traits_3<baseK> K;
|
||||
|
||||
#else
|
||||
|
||||
#include "CGAL/Robust_weighted_circumcenter_filtered_traits_3.h"
|
||||
typedef CGAL::Robust_weighted_circumcenter_filtered_traits_3<baseK> K;
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
// Very robust but expensive kernel
|
||||
|
||||
@ -4,7 +4,6 @@ EXE_INC = \
|
||||
-Wno-old-style-cast \
|
||||
$(COMP_FLAGS) \
|
||||
${CGAL_INC} \
|
||||
-DCGAL_HEADER_ONLY \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
@ -12,7 +11,6 @@ EXE_INC = \
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
/* ${CGAL_LIBS} */ \
|
||||
-lfiniteVolume \
|
||||
-lsurfMesh \
|
||||
-lmeshTools \
|
||||
|
||||
12
doc/Build.md
12
doc/Build.md
@ -1,23 +1,23 @@
|
||||
## Getting the code
|
||||
|
||||
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2206:
|
||||
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2212:
|
||||
|
||||
- https://dl.openfoam.com/source/latest/
|
||||
- Source: https://dl.openfoam.com/source/v2206/OpenFOAM-v2206.tgz
|
||||
- ThirdParty: https://dl.openfoam.com/source/v2206/ThirdParty-v2206.tgz
|
||||
- Source: https://dl.openfoam.com/source/v2212/OpenFOAM-v2212.tgz
|
||||
- ThirdParty: https://dl.openfoam.com/source/v2212/ThirdParty-v2212.tgz
|
||||
|
||||
## OpenFOAM® Quick Build Guide
|
||||
|
||||
Prior to building, ensure that the [system requirements][link openfoam-require]
|
||||
are satisfied (including any special [cross-compiling][wiki-cross-compile]
|
||||
considerations), and source the correct OpenFOAM environment.
|
||||
For example, for the OpenFOAM-v2206 version:
|
||||
For example, for the OpenFOAM-v2212 version:
|
||||
```
|
||||
source <installation path>/OpenFOAM-v2206/etc/bashrc
|
||||
source <installation path>/OpenFOAM-v2212/etc/bashrc
|
||||
```
|
||||
e.g. if installed under the `~/openfoam` directory
|
||||
```
|
||||
source ~/openfoam/OpenFOAM-v2206/etc/bashrc
|
||||
source ~/openfoam/OpenFOAM-v2212/etc/bashrc
|
||||
```
|
||||
|
||||
|
||||
|
||||
@ -18,6 +18,8 @@ Description
|
||||
type scalarTransport;
|
||||
libs ("libsolverFunctionObjects.so");
|
||||
|
||||
writeControl writeTime;
|
||||
|
||||
field s;
|
||||
schemesField s;
|
||||
D 1e-09;
|
||||
|
||||
@ -174,7 +174,7 @@ Foam::tokenList Foam::functionEntries::evalEntry::evaluate
|
||||
result.writeField(toks);
|
||||
}
|
||||
|
||||
return std::move(toks);
|
||||
return tokenList(std::move(toks.tokens()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,9 +41,11 @@ void Foam::expressions::exprDriver::fill_random
|
||||
{
|
||||
if (seed <= 0)
|
||||
{
|
||||
if (timeStatePtr_)
|
||||
const TimeState* ts = this->timeState();
|
||||
|
||||
if (ts)
|
||||
{
|
||||
seed = (timeStatePtr_->timeIndex() - seed);
|
||||
seed = (ts->timeIndex() - seed);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -152,10 +152,11 @@ slicedBoundaryField
|
||||
new SlicedPatchField<Type>
|
||||
(
|
||||
mesh.boundary()[patchi],
|
||||
DimensionedField<Type, GeoMesh>::null(),
|
||||
bField[patchi]
|
||||
DimensionedField<Type, GeoMesh>::null()
|
||||
)
|
||||
);
|
||||
|
||||
bf[patchi].UList<Type>::shallowCopy(bField[patchi]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -201,7 +201,8 @@ inline Foam::Matrix<Form, Type>::Matrix
|
||||
)
|
||||
:
|
||||
mRows_(Mb.m()),
|
||||
nCols_(Mb.n())
|
||||
nCols_(Mb.n()),
|
||||
v_(nullptr)
|
||||
{
|
||||
doAlloc();
|
||||
|
||||
@ -223,7 +224,8 @@ inline Foam::Matrix<Form, Type>::Matrix
|
||||
)
|
||||
:
|
||||
mRows_(Mb.m()),
|
||||
nCols_(Mb.n())
|
||||
nCols_(Mb.n()),
|
||||
v_(nullptr)
|
||||
{
|
||||
doAlloc();
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -489,12 +489,12 @@ public:
|
||||
|
||||
//- Collect indirect data in processor order on master
|
||||
// Handles contiguous/non-contiguous data, skips empty fields.
|
||||
template<class Type, class Addr>
|
||||
template<class ProcIDsContainer, class Type, class Addr>
|
||||
static void gather
|
||||
(
|
||||
const labelUList& offsets, //!< offsets (master only)
|
||||
const label comm, //!< communicator
|
||||
const UList<int>& procIDs,
|
||||
const ProcIDsContainer& procIDs,
|
||||
const IndirectListBase<Type, Addr>& fld,
|
||||
List<Type>& allFld, //! output field (master only)
|
||||
const int tag = UPstream::msgType(),
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -248,12 +248,12 @@ void Foam::globalIndex::gather
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class Addr>
|
||||
template<class ProcIDsContainer, class Type, class Addr>
|
||||
void Foam::globalIndex::gather
|
||||
(
|
||||
const labelUList& off, // needed on master only
|
||||
const label comm,
|
||||
const UList<int>& procIDs,
|
||||
const ProcIDsContainer& procIDs,
|
||||
const IndirectListBase<Type, Addr>& fld,
|
||||
List<Type>& allFld,
|
||||
const int tag,
|
||||
@ -368,7 +368,7 @@ void Foam::globalIndex::gather
|
||||
(
|
||||
offsets_, // needed on master only
|
||||
comm,
|
||||
UPstream::procID(comm),
|
||||
UPstream::allProcs(comm), // All communicator ranks
|
||||
sendData,
|
||||
allData,
|
||||
tag,
|
||||
@ -404,7 +404,7 @@ void Foam::globalIndex::gather
|
||||
(
|
||||
offsets_, // needed on master only
|
||||
comm,
|
||||
UPstream::procID(comm),
|
||||
UPstream::allProcs(comm), // All communicator ranks
|
||||
sendData,
|
||||
allData,
|
||||
tag,
|
||||
@ -622,7 +622,7 @@ void Foam::globalIndex::mpiGather
|
||||
(
|
||||
offsets_, // needed on master only
|
||||
comm,
|
||||
UPstream::procID(comm),
|
||||
UPstream::allProcs(comm), // All communicator ranks
|
||||
sendData,
|
||||
allData,
|
||||
tag,
|
||||
@ -967,7 +967,7 @@ void Foam::globalIndex::scatter
|
||||
(
|
||||
offsets_, // needed on master only
|
||||
comm,
|
||||
UPstream::procID(comm),
|
||||
UPstream::allProcs(comm), // All communicator ranks
|
||||
allData,
|
||||
localData,
|
||||
tag,
|
||||
|
||||
@ -409,6 +409,10 @@ inline Foam::Tensor<Cmpt> Foam::Tensor<Cmpt>::T() const
|
||||
|
||||
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline Foam::Tensor<Cmpt>
|
||||
Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const
|
||||
{
|
||||
@ -432,6 +436,10 @@ Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const
|
||||
|
||||
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline Foam::Tensor<Cmpt>
|
||||
Foam::Tensor<Cmpt>::schur(const Tensor<Cmpt>& t2) const
|
||||
{
|
||||
@ -867,6 +875,10 @@ operator&(const Tensor<Cmpt>& t1, const Tensor<Cmpt>& t2)
|
||||
|
||||
//- Inner-product of a SphericalTensor and a Tensor
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline Tensor<Cmpt>
|
||||
operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
||||
{
|
||||
@ -881,6 +893,10 @@ operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
||||
|
||||
//- Inner-product of a Tensor and a SphericalTensor
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline Tensor<Cmpt>
|
||||
operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
|
||||
{
|
||||
@ -895,6 +911,10 @@ operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
|
||||
|
||||
//- Inner-product of a SymmTensor and a Tensor
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline Tensor<Cmpt>
|
||||
operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
||||
{
|
||||
@ -917,6 +937,10 @@ operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
|
||||
|
||||
//- Inner-product of a Tensor and a SymmTensor
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline Tensor<Cmpt>
|
||||
operator&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
|
||||
{
|
||||
@ -957,6 +981,10 @@ operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v)
|
||||
|
||||
//- Inner-product of a Vector and a Tensor
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline Vector<Cmpt>
|
||||
operator&(const Vector<Cmpt>& v, const Tensor<Cmpt>& t)
|
||||
{
|
||||
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "word.H"
|
||||
#include "debug.H"
|
||||
#include <cctype>
|
||||
#include <cstdint>
|
||||
#include <sstream>
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -641,7 +641,16 @@ void Foam::UPstream::freePstreamCommunicator(const label communicator)
|
||||
}
|
||||
|
||||
// Not touching the first two communicators (SELF, WORLD)
|
||||
if (communicator > 1)
|
||||
// or anything out-of bounds.
|
||||
//
|
||||
// No UPstream communicator indices when MPI is initialized outside
|
||||
// of OpenFOAM - thus needs a bounds check too!
|
||||
|
||||
if
|
||||
(
|
||||
communicator > 1
|
||||
&& (communicator < PstreamGlobals::MPICommunicators_.size())
|
||||
)
|
||||
{
|
||||
if (MPI_COMM_NULL != PstreamGlobals::MPICommunicators_[communicator])
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
Copyright (C) 2022-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -131,6 +131,9 @@ makeLESModel(dynamicKEqn);
|
||||
#include "dynamicLagrangian.H"
|
||||
makeLESModel(dynamicLagrangian);
|
||||
|
||||
#include "sigma.H"
|
||||
makeLESModel(sigma);
|
||||
|
||||
#include "SpalartAllmarasDES.H"
|
||||
makeLESModel(SpalartAllmarasDES);
|
||||
|
||||
|
||||
@ -79,8 +79,8 @@ bool Foam::laminarModels::generalizedNewtonianViscosityModels::Casson::read
|
||||
|
||||
coeffs.readEntry("m", m_);
|
||||
coeffs.readEntry("tau0", tau0_);
|
||||
coeffs.readEntry("nuMin_", nuMin_);
|
||||
coeffs.readEntry("nuMax_", nuMax_);
|
||||
coeffs.readEntry("nuMin", nuMin_);
|
||||
coeffs.readEntry("nuMax", nuMax_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -122,7 +122,8 @@ std::string Foam::fileFormats::NASCore::nextNasField
|
||||
(
|
||||
const std::string& str,
|
||||
std::string::size_type& pos,
|
||||
std::string::size_type len
|
||||
const std::string::size_type width,
|
||||
const bool free_format
|
||||
)
|
||||
{
|
||||
const auto beg = pos;
|
||||
@ -130,15 +131,23 @@ std::string Foam::fileFormats::NASCore::nextNasField
|
||||
|
||||
if (end == std::string::npos)
|
||||
{
|
||||
pos = beg + len; // Continue after field width
|
||||
if (free_format)
|
||||
{
|
||||
// Nothing left
|
||||
pos = str.size();
|
||||
return str.substr(beg);
|
||||
}
|
||||
|
||||
// Fixed format - continue after field width
|
||||
pos = beg + width;
|
||||
return str.substr(beg, width);
|
||||
}
|
||||
else
|
||||
{
|
||||
len = (end - beg); // Efffective width
|
||||
pos = end + 1; // Continue after comma
|
||||
// Free format - continue after comma
|
||||
pos = end + 1;
|
||||
return str.substr(beg, (end - beg));
|
||||
}
|
||||
|
||||
return str.substr(beg, len);
|
||||
}
|
||||
|
||||
|
||||
@ -235,8 +244,8 @@ void Foam::fileFormats::NASCore::writeCoord
|
||||
// 2 ID : point ID - requires starting index of 1
|
||||
// 3 CP : coordinate system ID (blank)
|
||||
// 4 X1 : point x coordinate
|
||||
// 5 X2 : point x coordinate
|
||||
// 6 X3 : point x coordinate
|
||||
// 5 X2 : point y coordinate
|
||||
// 6 X3 : point z coordinate
|
||||
// 7 CD : coordinate system for displacements (blank)
|
||||
// 8 PS : single point constraints (blank)
|
||||
// 9 SEID : super-element ID
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,7 +48,6 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
namespace fileFormats
|
||||
{
|
||||
|
||||
@ -74,18 +73,18 @@ public:
|
||||
//- Output load format
|
||||
enum loadFormat
|
||||
{
|
||||
PLOAD2,
|
||||
PLOAD4
|
||||
PLOAD2, //!< Face load (eg, pressure)
|
||||
PLOAD4 //!< Vertex load
|
||||
};
|
||||
|
||||
//- Selection names for the NASTRAN file field formats
|
||||
//- Selection names for the NASTRAN load formats
|
||||
static const Enum<loadFormat> loadFormatNames;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Default construct
|
||||
NASCore() = default;
|
||||
NASCore() noexcept = default;
|
||||
|
||||
|
||||
// Public Static Member Functions
|
||||
@ -93,18 +92,20 @@ public:
|
||||
//- Extract numbers from things like "-2.358-8" (same as "-2.358e-8")
|
||||
static scalar readNasScalar(const std::string& str);
|
||||
|
||||
//- A string::substr() to handle fixed-format and free-format NASTRAN.
|
||||
// Returns the substr to the next comma (if found) or the given length
|
||||
//
|
||||
// \param str The string to extract from
|
||||
// \param pos On input, the position of the first character of the
|
||||
// substring. On output, advances to the next position to use.
|
||||
// \param len The fixed-format length to use if a comma is not found.
|
||||
//- A std::string::substr() variant to handle fixed-format and
|
||||
//- free-format NASTRAN.
|
||||
// Returns the substr until the next comma (if found)
|
||||
// or the given fixed width
|
||||
static std::string nextNasField
|
||||
(
|
||||
//! The string to extract from
|
||||
const std::string& str,
|
||||
//! [in,out] The parse position within \p str
|
||||
std::string::size_type& pos,
|
||||
std::string::size_type len
|
||||
//! The fixed-format width to use (if comma is not found)
|
||||
const std::string::size_type width,
|
||||
//! The input is known to be free-format
|
||||
const bool free_format = false
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -135,8 +135,9 @@ int Foam::fileFormats::STLCore::detectBinaryHeader
|
||||
|
||||
bad =
|
||||
(
|
||||
nTris < int(dataFileSize - STLHeaderSize)/50
|
||||
|| nTris > int(dataFileSize - STLHeaderSize)/25
|
||||
dataFileSize < STLHeaderSize
|
||||
|| nTris < (dataFileSize - STLHeaderSize)/50
|
||||
|| nTris > (dataFileSize - STLHeaderSize)/25
|
||||
);
|
||||
}
|
||||
|
||||
@ -208,8 +209,9 @@ Foam::fileFormats::STLCore::readBinaryHeader
|
||||
|
||||
bad =
|
||||
(
|
||||
nTris < int(dataFileSize - STLHeaderSize)/50
|
||||
|| nTris > int(dataFileSize - STLHeaderSize)/25
|
||||
dataFileSize < STLHeaderSize
|
||||
|| nTris < (dataFileSize - STLHeaderSize)/50
|
||||
|| nTris > (dataFileSize - STLHeaderSize)/25
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,6 @@ $(basicFaPatchFields)/transform/transformFaPatchScalarField.C
|
||||
constraintFaPatchFields = $(faPatchFields)/constraint
|
||||
$(constraintFaPatchFields)/empty/emptyFaPatchFields.C
|
||||
$(constraintFaPatchFields)/processor/processorFaPatchFields.C
|
||||
$(constraintFaPatchFields)/processor/processorFaPatchScalarField.C
|
||||
$(constraintFaPatchFields)/wedge/wedgeFaPatchFields.C
|
||||
$(constraintFaPatchFields)/wedge/wedgeFaPatchScalarField.C
|
||||
$(constraintFaPatchFields)/cyclic/cyclicFaPatchFields.C
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -180,12 +180,26 @@ Foam::faBoundaryMesh::faBoundaryMesh
|
||||
|
||||
void Foam::faBoundaryMesh::calcGeometry()
|
||||
{
|
||||
// processorFaPatch geometry triggers calculation of pointNormals.
|
||||
// processor initGeometry send/recv the following:
|
||||
// - edgeCentres() : faMesh::edgeCentres()
|
||||
// - edgeLengths() : faMesh::Le()
|
||||
// - edgeFaceCentres() : faMesh::areaCentres()
|
||||
//
|
||||
// faMesh::Le() has its own point-to-point communication (OK) but
|
||||
// triggers either/or edgeAreaNormals(), pointAreaNormals()
|
||||
// with their own communication that can block.
|
||||
|
||||
// This uses parallel comms and hence will not be trigggered
|
||||
// on processors that do not have a processorFaPatch so instead
|
||||
// force construction.
|
||||
|
||||
(void)mesh_.edgeAreaNormals();
|
||||
(void)mesh_.pointAreaNormals();
|
||||
|
||||
(void)mesh_.areaCentres();
|
||||
(void)mesh_.faceAreaNormals();
|
||||
|
||||
|
||||
PstreamBuffers pBufs(Pstream::defaultCommsType);
|
||||
|
||||
if
|
||||
@ -773,12 +787,15 @@ bool Foam::faBoundaryMesh::checkDefinition(const bool report) const
|
||||
|
||||
void Foam::faBoundaryMesh::movePoints(const pointField& p)
|
||||
{
|
||||
// processorFaPatch geometry triggers calculation of pointNormals.
|
||||
// This uses parallel comms and hence will not be trigggered
|
||||
// on processors that do not have a processorFaPatch so instead
|
||||
// force construction.
|
||||
// See comments in calcGeometry()
|
||||
|
||||
(void)mesh_.edgeAreaNormals();
|
||||
(void)mesh_.pointAreaNormals();
|
||||
|
||||
(void)mesh_.areaCentres();
|
||||
(void)mesh_.faceAreaNormals();
|
||||
|
||||
|
||||
PstreamBuffers pBufs(Pstream::defaultCommsType);
|
||||
|
||||
if
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -277,6 +277,27 @@ void Foam::faMesh::clearOut() const
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::faMesh::syncGeom()
|
||||
{
|
||||
if (UPstream::parRun())
|
||||
{
|
||||
// areaCentres()
|
||||
if (faceCentresPtr_)
|
||||
{
|
||||
faceCentresPtr_->boundaryFieldRef()
|
||||
.evaluateCoupled<processorFaPatch>();
|
||||
}
|
||||
|
||||
// faceAreaNormals()
|
||||
if (faceAreaNormalsPtr_)
|
||||
{
|
||||
faceAreaNormalsPtr_->boundaryFieldRef()
|
||||
.evaluateCoupled<processorFaPatch>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::faMesh::init(const bool doInit)
|
||||
{
|
||||
if (doInit)
|
||||
@ -296,18 +317,7 @@ bool Foam::faMesh::init(const bool doInit)
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
|
||||
// Ensure processor/processor information is properly synchronised
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
const_cast<areaVectorField&>(areaCentres()).boundaryFieldRef()
|
||||
.evaluateCoupled<processorFaPatch>();
|
||||
|
||||
// This roughly corresponds to what OpenFOAM-v2112 (and earlier) had,
|
||||
// but should nominally be unnecessary.
|
||||
//
|
||||
/// const_cast<areaVectorField&>(faceAreaNormals()).boundaryFieldRef()
|
||||
/// .evaluateCoupled<processorFaPatch>();
|
||||
}
|
||||
syncGeom();
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -989,7 +999,6 @@ bool Foam::faMesh::movePoints()
|
||||
|
||||
clearGeomNotAreas();
|
||||
|
||||
// To satisfy the motion interface for MeshObject, const cast is needed
|
||||
if (patchPtr_)
|
||||
{
|
||||
patchPtr_->movePoints(newPoints);
|
||||
@ -1003,6 +1012,8 @@ bool Foam::faMesh::movePoints()
|
||||
|
||||
// Note: Fluxes were dummy?
|
||||
|
||||
syncGeom();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -617,6 +617,10 @@ public:
|
||||
//- Initialise non-demand-driven data etc
|
||||
bool init(const bool doInit);
|
||||
|
||||
//- Processor/processor synchronisation for geometry fields.
|
||||
// Largely internal use only (slightly hacky).
|
||||
void syncGeom();
|
||||
|
||||
|
||||
// Database
|
||||
|
||||
|
||||
@ -898,6 +898,12 @@ void Foam::faMesh::calcFaceCentres() const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Parallel consistency, exchange on processor patches
|
||||
if (UPstream::parRun())
|
||||
{
|
||||
centres.boundaryFieldRef().evaluateCoupled<processorFaPatch>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1110,6 +1116,12 @@ void Foam::faMesh::calcFaceAreaNormals() const
|
||||
= edgeNormalsBoundary[patchi];
|
||||
}
|
||||
}
|
||||
|
||||
// Parallel consistency, exchange on processor patches
|
||||
if (UPstream::parRun())
|
||||
{
|
||||
faceNormals.boundaryFieldRef().evaluateCoupled<processorFaPatch>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -61,6 +61,8 @@ void Foam::faMeshTools::forceDemandDriven(faMesh& mesh)
|
||||
(void)mesh.pointAreaNormals();
|
||||
(void)mesh.faceCurvatures();
|
||||
(void)mesh.edgeTransformTensors();
|
||||
|
||||
mesh.syncGeom();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -181,13 +181,6 @@ public:
|
||||
|
||||
// Coupled interface functionality
|
||||
|
||||
//- Transform given patch component field
|
||||
virtual void transformCoupleField
|
||||
(
|
||||
solveScalarField& f,
|
||||
const direction cmpt
|
||||
) const = 0;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef transformFaPatchFieldsFwd_H
|
||||
#define transformFaPatchFieldsFwd_H
|
||||
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type> class transformFaPatchField;
|
||||
|
||||
// typedef transformFaPatchField<scalar> transformFaPatchScalarField;
|
||||
// typedef transformFaPatchField<vector> transformFaPatchVectorField;
|
||||
// typedef transformFaPatchField<tensor> transformFaPatchTensorField;
|
||||
|
||||
// template<class Type> class transformFaPatchField;
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(transform)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -187,20 +187,7 @@ void Foam::cyclicFaPatchField<Type>::updateInterfaceMatrix
|
||||
transformCoupleField(pnf, cmpt);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
if (add)
|
||||
{
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] += coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
@ -227,21 +214,11 @@ void Foam::cyclicFaPatchField<Type>::updateInterfaceMatrix
|
||||
pnf[facei + sizeby2] = psiInternal[faceCells[facei]];
|
||||
}
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
transformCoupleField(pnf);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
if (add)
|
||||
{
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] += coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -164,16 +164,6 @@ public:
|
||||
|
||||
// Coupled interface functionality
|
||||
|
||||
//- Transform neighbour field
|
||||
virtual void transformCoupleField
|
||||
(
|
||||
solveScalarField& f,
|
||||
const direction cmpt
|
||||
) const
|
||||
{
|
||||
cyclicLduInterfaceField::transformCoupleField(f, cmpt);
|
||||
}
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
|
||||
@ -130,13 +130,6 @@ Foam::processorFaPatchField<Type>::processorFaPatchField
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::processorFaPatchField<Type>::~processorFaPatchField()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -203,6 +196,8 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
|
||||
commsType,
|
||||
this->patch().patchInternalField(psiInternal)()
|
||||
);
|
||||
|
||||
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = false;
|
||||
}
|
||||
|
||||
|
||||
@ -219,32 +214,28 @@ void Foam::processorFaPatchField<Type>::updateInterfaceMatrix
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
if (this->updatedMatrix())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const labelUList& faceCells = this->patch().edgeFaces();
|
||||
|
||||
solveScalarField pnf
|
||||
(
|
||||
procPatch_.receive<solveScalar>(commsType, this->size())()
|
||||
procPatch_.receive<solveScalar>(commsType, this->size())
|
||||
);
|
||||
|
||||
// Transform according to the transformation tensor
|
||||
transformCoupleField(pnf, cmpt);
|
||||
if (!std::is_arithmetic<Type>::value)
|
||||
{
|
||||
// Transform non-scalar data according to the transformation tensor
|
||||
transformCoupleField(pnf, cmpt);
|
||||
}
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
|
||||
const labelUList& edgeFaces = this->patch().edgeFaces();
|
||||
|
||||
if (add)
|
||||
{
|
||||
forAll(edgeFaces, elemI)
|
||||
{
|
||||
result[edgeFaces[elemI]] += coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(edgeFaces, elemI)
|
||||
{
|
||||
result[edgeFaces[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = true;
|
||||
}
|
||||
|
||||
|
||||
@ -265,6 +256,8 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
|
||||
commsType,
|
||||
this->patch().patchInternalField(psiInternal)()
|
||||
);
|
||||
|
||||
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = false;
|
||||
}
|
||||
|
||||
|
||||
@ -280,29 +273,25 @@ void Foam::processorFaPatchField<Type>::updateInterfaceMatrix
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
if (this->updatedMatrix())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const labelUList& faceCells = this->patch().edgeFaces();
|
||||
|
||||
Field<Type> pnf
|
||||
(
|
||||
procPatch_.receive<Type>(commsType, this->size())()
|
||||
procPatch_.receive<Type>(commsType, this->size())
|
||||
);
|
||||
|
||||
// Transform according to the transformation tensor
|
||||
transformCoupleField(pnf);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
|
||||
const labelUList& edgeFaces = this->patch().edgeFaces();
|
||||
|
||||
if (add)
|
||||
{
|
||||
forAll(edgeFaces, elemI)
|
||||
{
|
||||
result[edgeFaces[elemI]] += coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(edgeFaces, elemI)
|
||||
{
|
||||
result[edgeFaces[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,8 +38,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorFaPatchField_H
|
||||
#define processorFaPatchField_H
|
||||
#ifndef Foam_processorFaPatchField_H
|
||||
#define Foam_processorFaPatchField_H
|
||||
|
||||
#include "coupledFaPatchField.H"
|
||||
#include "processorLduInterfaceField.H"
|
||||
@ -139,9 +139,8 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~processorFaPatchField();
|
||||
//- Destructor
|
||||
~processorFaPatchField() = default;
|
||||
|
||||
|
||||
// Member functions
|
||||
@ -169,17 +168,8 @@ public:
|
||||
//- Return patch-normal gradient
|
||||
virtual tmp<Field<Type>> snGrad() const;
|
||||
|
||||
// Coupled interface functionality
|
||||
|
||||
//- Transform neighbour field
|
||||
virtual void transformCoupleField
|
||||
(
|
||||
solveScalarField& f,
|
||||
const direction cmpt
|
||||
) const
|
||||
{
|
||||
processorLduInterfaceField::transformCoupleField(f, cmpt);
|
||||
}
|
||||
// Coupled interface functionality
|
||||
|
||||
//- Initialise neighbour matrix update
|
||||
virtual void initInterfaceMatrixUpdate
|
||||
|
||||
@ -25,10 +25,10 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorFaPatchFields_H
|
||||
#define processorFaPatchFields_H
|
||||
#ifndef Foam_processorFaPatchFields_H
|
||||
#define Foam_processorFaPatchFields_H
|
||||
|
||||
#include "processorFaPatchScalarField.H"
|
||||
#include "processorFaPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorFaPatchFieldsFwd_H
|
||||
#define processorFaPatchFieldsFwd_H
|
||||
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type> class processorFaPatchField;
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(processor)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,100 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorFaPatchScalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
void Foam::processorFaPatchField<Foam::scalar>::transformCoupleField
|
||||
(
|
||||
solveScalarField& f,
|
||||
const direction cmpt
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::processorFaPatchField<Foam::scalar>::initInterfaceMatrixUpdate
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
procPatch_.send
|
||||
(
|
||||
commsType,
|
||||
patch().patchInternalField(psiInternal)()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::processorFaPatchField<Foam::scalar>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
solveScalarField pnf
|
||||
(
|
||||
procPatch_.receive<solveScalar>(commsType, this->size())()
|
||||
);
|
||||
|
||||
const labelUList& edgeFaces = patch().edgeFaces();
|
||||
|
||||
if (add)
|
||||
{
|
||||
forAll(edgeFaces, facei)
|
||||
{
|
||||
result[edgeFaces[facei]] += coeffs[facei]*pnf[facei];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(edgeFaces, facei)
|
||||
{
|
||||
result[edgeFaces[facei]] -= coeffs[facei]*pnf[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,86 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorFaPatchScalarField_H
|
||||
#define processorFaPatchScalarField_H
|
||||
|
||||
#include "processorFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
void processorFaPatchField<scalar>::transformCoupleField
|
||||
(
|
||||
solveScalarField& f,
|
||||
const direction cmpt
|
||||
) const;
|
||||
|
||||
|
||||
template<>
|
||||
void processorFaPatchField<scalar>::initInterfaceMatrixUpdate
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
|
||||
template<>
|
||||
void processorFaPatchField<scalar>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -389,7 +389,7 @@ bool Foam::functionObjects::fvExpressionField::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
autowrite_ = dict.getOrDefault("autowrite", false);
|
||||
store_ = dict.getOrDefault("autowrite", true);
|
||||
store_ = dict.getOrDefault("store", true);
|
||||
|
||||
// "dimensions" is optional
|
||||
dimensions_.clear();
|
||||
|
||||
@ -103,7 +103,7 @@ bool Foam::functionObjects::ensightWrite::readSelection(const dictionary& dict)
|
||||
selectFields_.uniq();
|
||||
|
||||
blockFields_.clear();
|
||||
dict.readIfPresent("blockFields", blockFields_);
|
||||
dict.readIfPresent("excludeFields", blockFields_);
|
||||
blockFields_.uniq();
|
||||
|
||||
// Actions to define selection
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -71,7 +71,7 @@ Foam::fv::limitVelocity::limitVelocity
|
||||
:
|
||||
fv::cellSetOption(name, modelType, dict, mesh),
|
||||
writeFile(mesh, name, typeName, dict, false),
|
||||
UName_(word::null),
|
||||
UName_("U"),
|
||||
max_(0)
|
||||
{
|
||||
read(dict);
|
||||
|
||||
@ -179,7 +179,7 @@ void Foam::InjectedParticleDistributionInjection<CloudType>::initialise()
|
||||
sumPow3 += pow3(diameters[particlei]);
|
||||
}
|
||||
|
||||
const scalar volume = sumPow3*mathematical::pi/16.0;
|
||||
const scalar volume = sumPow3*mathematical::pi/6.0;
|
||||
sumVolume += volume;
|
||||
volumeFlowRate_[injectori] = volume/dTime;
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ void Foam::InjectedParticleInjection<CloudType>::initialise()
|
||||
scalar sumVolume = 0;
|
||||
forAll(volume, i)
|
||||
{
|
||||
scalar vol = pow3(diameter_[i])*mathematical::pi/16.0;
|
||||
scalar vol = pow3(diameter_[i])*mathematical::pi/6.0;
|
||||
volume[i] = vol;
|
||||
sumVolume += vol;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,6 +62,53 @@ Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
template<class filmType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::absorbInteraction
|
||||
(
|
||||
filmType& film,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
const scalar mass,
|
||||
bool& keepParticle
|
||||
)
|
||||
{
|
||||
DebugInfo<< "Parcel " << p.origId() << " absorbInteraction" << endl;
|
||||
|
||||
// Patch face normal
|
||||
const vector& nf = pp.faceNormals()[facei];
|
||||
|
||||
// Patch velocity
|
||||
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
|
||||
|
||||
// Relative parcel velocity
|
||||
const vector Urel(p.U() - Up);
|
||||
|
||||
// Parcel normal velocity
|
||||
const vector Un(nf*(Urel & nf));
|
||||
|
||||
// Parcel tangential velocity
|
||||
const vector Ut(Urel - Un);
|
||||
|
||||
film.addSources
|
||||
(
|
||||
pp.index(),
|
||||
facei,
|
||||
mass, // mass
|
||||
mass*Ut, // tangential momentum
|
||||
mass*mag(Un), // impingement pressure
|
||||
mass*p.hs() // energy
|
||||
);
|
||||
|
||||
this->nParcelsTransferred()++;
|
||||
|
||||
this->totalMassTransferred() += mass;
|
||||
|
||||
keepParticle = false;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
||||
(
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -143,6 +143,21 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Interaction models
|
||||
|
||||
//- Absorb parcel into film
|
||||
template<class filmType>
|
||||
void absorbInteraction
|
||||
(
|
||||
filmType&,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
const scalar mass,
|
||||
bool& keepParticle
|
||||
);
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Transfer parcel from cloud to surface film
|
||||
|
||||
@ -1368,6 +1368,7 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
|
||||
(
|
||||
face2i != facei
|
||||
&& surfaceIndex[face2i] != -1
|
||||
&& cutter.faceLevel(face2i) > cLevel
|
||||
)
|
||||
{
|
||||
// Get outwards pointing normal
|
||||
|
||||
@ -269,7 +269,8 @@ bool Foam::faceAreaWeightAMI::setNextFaces
|
||||
return false;
|
||||
}
|
||||
|
||||
const labelList& srcNbrFaces = this->srcPatch().faceFaces()[srcFacei];
|
||||
const auto& srcPatch = this->srcPatch();
|
||||
const labelList& srcNbrFaces = srcPatch.faceFaces()[srcFacei];
|
||||
|
||||
// Initialise tgtFacei
|
||||
tgtFacei = -1;
|
||||
@ -360,6 +361,7 @@ bool Foam::faceAreaWeightAMI::setNextFaces
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to set target face for source face " << srcFacei
|
||||
<< " with centre: " << srcPatch.faceCentres()[srcFacei]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -80,6 +80,19 @@ void Foam::vtk::coordSetWriter::beginPiece()
|
||||
}
|
||||
}
|
||||
|
||||
// Update sizes, similar to
|
||||
// vtk::polyWriter::beginPiece(const pointField&, const edgeList&)
|
||||
|
||||
numberOfPoints_ = nLocalPoints_;
|
||||
numberOfCells_ = nLocalLines_;
|
||||
|
||||
// if (parallel_)
|
||||
// {
|
||||
// reduce(numberOfPoints_, sumOp<label>());
|
||||
// reduce(numberOfCells_, sumOp<label>());
|
||||
// }
|
||||
|
||||
|
||||
// Nothing else to do for legacy
|
||||
if (legacy()) return;
|
||||
|
||||
@ -88,7 +101,7 @@ void Foam::vtk::coordSetWriter::beginPiece()
|
||||
format().openTag
|
||||
(
|
||||
vtk::fileTag::PIECE,
|
||||
vtk::fileAttr::NUMBER_OF_POINTS, nLocalPoints_
|
||||
vtk::fileAttr::NUMBER_OF_POINTS, numberOfPoints_
|
||||
);
|
||||
if (nLocalVerts_)
|
||||
{
|
||||
@ -105,7 +118,7 @@ void Foam::vtk::coordSetWriter::beginPiece()
|
||||
|
||||
void Foam::vtk::coordSetWriter::writePoints()
|
||||
{
|
||||
this->beginPoints(nLocalPoints_);
|
||||
this->beginPoints(numberOfPoints_); //<- same as nLocalPoints_
|
||||
|
||||
{
|
||||
for (const pointField& pts : points_)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,13 +62,17 @@ bool Foam::fileFormats::NASedgeFormat::read
|
||||
|
||||
while (is.good())
|
||||
{
|
||||
string::size_type linei = 0; // parsing position within current line
|
||||
string line;
|
||||
is.getLine(line);
|
||||
|
||||
if (line.empty() || line[0] == '$')
|
||||
if (line.empty())
|
||||
{
|
||||
continue; // Skip empty or comment
|
||||
continue; // Ignore empty
|
||||
}
|
||||
else if (line[0] == '$')
|
||||
{
|
||||
// Ignore comment
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if character 72 is continuation
|
||||
@ -94,38 +98,66 @@ bool Foam::fileFormats::NASedgeFormat::read
|
||||
}
|
||||
|
||||
|
||||
// Parsing position within current line
|
||||
std::string::size_type linei = 0;
|
||||
|
||||
// Is free format if line contains a comma
|
||||
const bool freeFormat = line.contains(',');
|
||||
|
||||
// First word (column 0-8)
|
||||
const word cmd(word::validate(nextNasField(line, linei, 8)));
|
||||
|
||||
if (cmd == "CBEAM" || cmd == "CROD")
|
||||
{
|
||||
// discard elementId (8-16)
|
||||
(void) nextNasField(line, linei, 8); // 8-16
|
||||
// discard groupId (16-24)
|
||||
(void) nextNasField(line, linei, 8); // 16-24
|
||||
// Fixed format:
|
||||
// 8-16 : element id
|
||||
// 16-24 : group id
|
||||
// 24-32 : vertex
|
||||
// 32-40 : vertex
|
||||
|
||||
label a = readLabel(nextNasField(line, linei, 8)); // 24-32
|
||||
label b = readLabel(nextNasField(line, linei, 8)); // 32-40
|
||||
// discard elementId
|
||||
(void) nextNasField(line, linei, 8, freeFormat);
|
||||
// discard groupId
|
||||
(void) nextNasField(line, linei, 8, freeFormat);
|
||||
|
||||
label a = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
label b = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
dynEdges.append(edge(a,b));
|
||||
}
|
||||
else if (cmd == "PLOTEL")
|
||||
{
|
||||
// discard elementId (8-16)
|
||||
(void) nextNasField(line, linei, 8); // 8-16
|
||||
// Fixed format:
|
||||
// 8-16 : element id
|
||||
// 16-24 : vertex
|
||||
// 24-32 : vertex
|
||||
// 32-40 : vertex
|
||||
|
||||
label a = readLabel(nextNasField(line, linei, 8)); // 16-24
|
||||
label b = readLabel(nextNasField(line, linei, 8)); // 24-32
|
||||
// discard elementId (8-16)
|
||||
(void) nextNasField(line, linei, 8, freeFormat);
|
||||
|
||||
label a = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
label b = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
dynEdges.append(edge(a,b));
|
||||
}
|
||||
else if (cmd == "GRID")
|
||||
{
|
||||
label index = readLabel(nextNasField(line, linei, 8)); // 8-16
|
||||
(void) nextNasField(line, linei, 8); // 16-24
|
||||
scalar x = readNasScalar(nextNasField(line, linei, 8)); // 24-32
|
||||
scalar y = readNasScalar(nextNasField(line, linei, 8)); // 32-40
|
||||
scalar z = readNasScalar(nextNasField(line, linei, 8)); // 40-48
|
||||
// Fixed (short) format:
|
||||
// 8-16 : point id
|
||||
// 16-24 : coordinate system (unsupported)
|
||||
// 24-32 : point x coordinate
|
||||
// 32-40 : point y coordinate
|
||||
// 40-48 : point z coordinate
|
||||
// 48-56 : displacement coordinate system (optional, unsupported)
|
||||
// 56-64 : single point constraints (optional, unsupported)
|
||||
// 64-70 : super-element id (optional, unsupported)
|
||||
|
||||
label index = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
(void) nextNasField(line, linei, 8, freeFormat);
|
||||
scalar x = readNasScalar(nextNasField(line, linei, 8, freeFormat));
|
||||
scalar y = readNasScalar(nextNasField(line, linei, 8, freeFormat));
|
||||
scalar z = readNasScalar(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
pointId.append(index);
|
||||
dynPoints.append(point(x, y, z));
|
||||
@ -138,6 +170,8 @@ bool Foam::fileFormats::NASedgeFormat::read
|
||||
// GRID* 126 0 -5.55999875E+02 -5.68730474E+02
|
||||
// * 2.14897901E+02
|
||||
|
||||
// Cannot be long format and free format at the same time!
|
||||
|
||||
label index = readLabel(nextNasField(line, linei, 16)); // 8-24
|
||||
(void) nextNasField(line, linei, 16); // 24-40
|
||||
scalar x = readNasScalar(nextNasField(line, linei, 16)); // 40-56
|
||||
|
||||
@ -155,7 +155,7 @@ bool Foam::vtk::writePointSet
|
||||
|
||||
if (parallel)
|
||||
{
|
||||
vtk::writeListParallel(format(), mesh.points(), pointLabels);
|
||||
vtk::writeListParallel(format.ref(), mesh.points(), pointLabels);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2007-2021 PCOpt/NTUA
|
||||
Copyright (C) 2013-2021 FOSS GP
|
||||
Copyright (C) 2007-2023 PCOpt/NTUA
|
||||
Copyright (C) 2013-2023 FOSS GP
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -86,10 +86,9 @@ void ATCUaGradU::addATC(fvVectorMatrix& UaEqn)
|
||||
if (extraConvection_ > 0)
|
||||
{
|
||||
// Implicit part added to increase diagonal dominance
|
||||
// Note: Maybe this needs to be multiplied with the ATClimiter ??
|
||||
UaEqn += extraConvection_*fvm::div(-phi, Ua);
|
||||
UaEqn += ATClimiter_*extraConvection_*fvm::div(-phi, Ua);
|
||||
|
||||
// correct rhs due to implicitly augmenting the adjoint convection
|
||||
// Correct rhs due to implicitly augmenting the adjoint convection
|
||||
ATC_ += extraConvection_*(fvc::grad(UaForATC(), "gradUaATC")().T() & U);
|
||||
}
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2007-2021 PCOpt/NTUA
|
||||
Copyright (C) 2013-2021 FOSS GP
|
||||
Copyright (C) 2007-2023 PCOpt/NTUA
|
||||
Copyright (C) 2013-2023 FOSS GP
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -90,10 +90,9 @@ void ATCstandard::addATC(fvVectorMatrix& UaEqn)
|
||||
if (extraConvection_ > 0)
|
||||
{
|
||||
// Implicit part added to increase diagonal dominance
|
||||
// Note: Maybe this needs to be multiplied with the ATClimiter ??
|
||||
UaEqn += extraConvection_*fvm::div(-phi, Ua);
|
||||
UaEqn += ATClimiter_*extraConvection_*fvm::div(-phi, Ua);
|
||||
|
||||
// correct rhs due to implicitly augmenting the adjoint convection
|
||||
// Correct rhs due to implicitly augmenting the adjoint convection
|
||||
ATC_ += extraConvection_*(fvc::grad(Ua, "gradUaATC")().T() & U);
|
||||
}
|
||||
|
||||
|
||||
@ -411,7 +411,7 @@ void Foam::cellCellStencil::setUpFrontOnOversetPatch
|
||||
void Foam::cellCellStencil::walkFront
|
||||
(
|
||||
const globalIndex& globalCells,
|
||||
const label layerRelax,
|
||||
const scalar layerRelax,
|
||||
const labelListList& allStencil,
|
||||
labelList& allCellTypes,
|
||||
scalarField& allWeight,
|
||||
@ -611,9 +611,11 @@ void Foam::cellCellStencil::walkFront
|
||||
allWeightWork[nei] = fraction[facei];
|
||||
allCellTypesWork[nei] = INTERPOLATED;
|
||||
|
||||
const label donorId = compactStencil[nei][0];
|
||||
const label donorId =
|
||||
compactStencil[nei][0];
|
||||
|
||||
volRatio[nei] = V[nei]/compactCellVol[donorId];
|
||||
volRatio[nei] =
|
||||
V[nei]/compactCellVol[donorId];
|
||||
|
||||
seedCell
|
||||
(
|
||||
|
||||
@ -276,7 +276,7 @@ public:
|
||||
void walkFront
|
||||
(
|
||||
const globalIndex& globalCells,
|
||||
const label layerRelax,
|
||||
const scalar layerRelax,
|
||||
const labelListList& allStencil,
|
||||
labelList& allCellTypes,
|
||||
scalarField& allWeight,
|
||||
|
||||
@ -1798,7 +1798,7 @@ Foam::cellCellStencils::inverseDistance::~inverseDistance()
|
||||
|
||||
bool Foam::cellCellStencils::inverseDistance::update()
|
||||
{
|
||||
label layerRelax(dict_.getOrDefault("layerRelax", 1));
|
||||
scalar layerRelax(dict_.getOrDefault("layerRelax", 1.0));
|
||||
|
||||
scalar tol = dict_.getOrDefault("tolerance", 1e-10);
|
||||
smallVec_ = mesh_.bounds().span()*tol;
|
||||
|
||||
@ -1949,7 +1949,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
||||
// //globalBorderTris.gather
|
||||
// //(
|
||||
// // UPstream::worldComm,
|
||||
// // UPstream::procID(Pstream::worldComm),
|
||||
// // UPstream::allProcs(UPstream::worldComm),
|
||||
// // globalBorderCentres
|
||||
// //);
|
||||
// pointField globalBorderCentres(allCentres);
|
||||
@ -1996,7 +1996,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
||||
// //globalBorderTris.scatter
|
||||
// //(
|
||||
// // UPstream::worldComm,
|
||||
// // UPstream::procID(Pstream::worldComm),
|
||||
// // UPstream::allProcs(UPstream::worldComm),
|
||||
// // isMasterPoint
|
||||
// //);
|
||||
// //boolList isMasterBorder(s.size(), false);
|
||||
@ -2094,7 +2094,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
||||
globalTris().gather
|
||||
(
|
||||
UPstream::worldComm,
|
||||
UPstream::procID(Pstream::worldComm),
|
||||
UPstream::allProcs(UPstream::worldComm),
|
||||
allCentres
|
||||
);
|
||||
}
|
||||
@ -2144,7 +2144,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
||||
globalTris().scatter
|
||||
(
|
||||
UPstream::worldComm,
|
||||
UPstream::procID(Pstream::worldComm),
|
||||
UPstream::allProcs(UPstream::worldComm),
|
||||
allDistribution,
|
||||
distribution
|
||||
);
|
||||
|
||||
@ -75,7 +75,7 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
|
||||
|
||||
if (dict.found("mDotL"))
|
||||
{
|
||||
dmdt_ = scalarField("mDotL", dict, p.size());
|
||||
mDotL_ = scalarField("mDotL", dict, p.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -834,15 +834,15 @@ Foam::meshToMesh::mapTgtToSrc
|
||||
label srcPatchi = srcPatchID_[i];
|
||||
label tgtPatchi = tgtPatchID_[i];
|
||||
|
||||
if (!srcPatchFields.set(tgtPatchi))
|
||||
if (!srcPatchFields.set(srcPatchi))
|
||||
{
|
||||
srcPatchFields.set
|
||||
(
|
||||
srcPatchi,
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
tgtBfld[srcPatchi],
|
||||
srcMesh.boundary()[tgtPatchi],
|
||||
tgtBfld[tgtPatchi],
|
||||
srcMesh.boundary()[srcPatchi],
|
||||
DimensionedField<Type, volMesh>::null(),
|
||||
directFvPatchFieldMapper
|
||||
(
|
||||
|
||||
@ -88,7 +88,7 @@ Foam::boundaryDataSurfaceReader::readField
|
||||
{
|
||||
refPtr<Time> timePtr(Time::New(argList::envGlobalPath()));
|
||||
|
||||
return readField<Type>(baseDir, timeDir, fieldName, avg);
|
||||
return readField<Type>(*timePtr, baseDir, timeDir, fieldName, avg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
|
||||
}
|
||||
|
||||
// Check that data type is as expected
|
||||
// (assumes OpenFOAM generated the data set)
|
||||
// (assuming OpenFOAM generated the data set)
|
||||
string primitiveType;
|
||||
is.read(primitiveType);
|
||||
|
||||
@ -90,7 +90,8 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
|
||||
|
||||
if
|
||||
(
|
||||
primitiveType != ensightPTraits<Type>::typeName
|
||||
debug
|
||||
&& primitiveType != ensightPTraits<Type>::typeName
|
||||
&& primitiveType != pTraits<Type>::typeName
|
||||
)
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -149,7 +149,6 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
|
||||
string line;
|
||||
while (is.good())
|
||||
{
|
||||
string::size_type linei = 0; // Parsing position within current line
|
||||
is.getLine(line);
|
||||
|
||||
// ANSA extension
|
||||
@ -223,16 +222,30 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Parsing position within current line
|
||||
std::string::size_type linei = 0;
|
||||
|
||||
// Is free format if line contains a comma
|
||||
const bool freeFormat = line.contains(',');
|
||||
|
||||
// First word (column 0-8)
|
||||
const word cmd(word::validate(nextNasField(line, linei, 8)));
|
||||
|
||||
if (cmd == "CTRIA3")
|
||||
{
|
||||
label elemId = readLabel(nextNasField(line, linei, 8)); // 8-16
|
||||
label groupId = readLabel(nextNasField(line, linei, 8)); // 16-24
|
||||
const auto a = readLabel(nextNasField(line, linei, 8)); // 24-32
|
||||
const auto b = readLabel(nextNasField(line, linei, 8)); // 32-40
|
||||
const auto c = readLabel(nextNasField(line, linei, 8)); // 40-48
|
||||
// Fixed format:
|
||||
// 8-16 : element id
|
||||
// 16-24 : group id
|
||||
// 24-32 : vertex
|
||||
// 32-40 : vertex
|
||||
// 40-48 : vertex
|
||||
|
||||
label elemId = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
label groupId = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
const auto a = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
const auto b = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
const auto c = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
// Convert groupId into zoneId
|
||||
const auto iterZone = zoneLookup.cfind(groupId);
|
||||
@ -261,12 +274,20 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
|
||||
}
|
||||
else if (cmd == "CQUAD4")
|
||||
{
|
||||
label elemId = readLabel(nextNasField(line, linei, 8)); // 8-16
|
||||
label groupId = readLabel(nextNasField(line, linei, 8)); // 16-24
|
||||
const auto a = readLabel(nextNasField(line, linei, 8)); // 24-32
|
||||
const auto b = readLabel(nextNasField(line, linei, 8)); // 32-40
|
||||
const auto c = readLabel(nextNasField(line, linei, 8)); // 40-48
|
||||
const auto d = readLabel(nextNasField(line, linei, 8)); // 48-56
|
||||
// Fixed format:
|
||||
// 8-16 : element id
|
||||
// 16-24 : group id
|
||||
// 24-32 : vertex
|
||||
// 32-40 : vertex
|
||||
// 40-48 : vertex
|
||||
// 48-56 : vertex
|
||||
|
||||
label elemId = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
label groupId = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
const auto a = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
const auto b = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
const auto c = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
const auto d = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
// Convert groupId into zoneId
|
||||
const auto iterZone = zoneLookup.cfind(groupId);
|
||||
@ -310,11 +331,21 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
|
||||
}
|
||||
else if (cmd == "GRID")
|
||||
{
|
||||
label index = readLabel(nextNasField(line, linei, 8)); // 8-16
|
||||
(void) nextNasField(line, linei, 8); // 16-24
|
||||
scalar x = readNasScalar(nextNasField(line, linei, 8)); // 24-32
|
||||
scalar y = readNasScalar(nextNasField(line, linei, 8)); // 32-40
|
||||
scalar z = readNasScalar(nextNasField(line, linei, 8)); // 40-48
|
||||
// Fixed (short) format:
|
||||
// 8-16 : point id
|
||||
// 16-24 : coordinate system (not supported)
|
||||
// 24-32 : point x coordinate
|
||||
// 32-40 : point y coordinate
|
||||
// 40-48 : point z coordinate
|
||||
// 48-56 : displacement coordinate system (optional, unsupported)
|
||||
// 56-64 : single point constraints (optional, unsupported)
|
||||
// 64-70 : super-element id (optional, unsupported)
|
||||
|
||||
label index = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
(void) nextNasField(line, linei, 8, freeFormat);
|
||||
scalar x = readNasScalar(nextNasField(line, linei, 8, freeFormat));
|
||||
scalar y = readNasScalar(nextNasField(line, linei, 8, freeFormat));
|
||||
scalar z = readNasScalar(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
pointId.append(index);
|
||||
dynPoints.append(point(x, y, z));
|
||||
@ -327,6 +358,8 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
|
||||
// GRID* 126 0 -5.55999875E+02 -5.68730474E+02
|
||||
// * 2.14897901E+02
|
||||
|
||||
// Cannot be long format and free format at the same time!
|
||||
|
||||
label index = readLabel(nextNasField(line, linei, 16)); // 8-24
|
||||
(void) nextNasField(line, linei, 16); // 24-40
|
||||
scalar x = readNasScalar(nextNasField(line, linei, 16)); // 40-56
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -307,16 +307,10 @@ void Foam::surfaceWriters::nastranWriter::writeGeometry
|
||||
Foam::surfaceWriters::nastranWriter::nastranWriter()
|
||||
:
|
||||
surfaceWriter(),
|
||||
writeFormat_(fieldFormat::SHORT),
|
||||
fieldMap_(),
|
||||
writeFormat_(fieldFormat::FREE),
|
||||
commonGeometry_(false),
|
||||
separator_()
|
||||
{
|
||||
// if (writeFormat_ == fieldFormat::FREE)
|
||||
// {
|
||||
// separator_ = ",";
|
||||
// }
|
||||
}
|
||||
separator_(",") // FREE format
|
||||
{}
|
||||
|
||||
|
||||
Foam::surfaceWriters::nastranWriter::nastranWriter
|
||||
@ -331,12 +325,10 @@ Foam::surfaceWriters::nastranWriter::nastranWriter
|
||||
(
|
||||
"format",
|
||||
options,
|
||||
fieldFormat::LONG
|
||||
fieldFormat::FREE
|
||||
)
|
||||
),
|
||||
fieldMap_(),
|
||||
commonGeometry_(options.getOrDefault("commonGeometry", false)),
|
||||
separator_()
|
||||
commonGeometry_(options.getOrDefault("commonGeometry", false))
|
||||
{
|
||||
if (writeFormat_ == fieldFormat::FREE)
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -33,13 +33,13 @@ Description
|
||||
The formatOptions for nastran:
|
||||
\table
|
||||
Property | Description | Reqd | Default
|
||||
fields | Field pairs for PLOAD2/PLOAD4 | yes |
|
||||
format | Nastran format (short/long/free) | no | long
|
||||
format | Nastran format (short/long/free) | no | free
|
||||
scale | Output geometry scaling | no | 1
|
||||
transform | Output coordinate transform | no |
|
||||
fieldLevel | Subtract field level before scaling | no | empty dict
|
||||
fieldScale | Output field scaling | no | empty dict
|
||||
commonGeometry | use separate geometry files | no | false
|
||||
fields | Field pairs for PLOAD2/PLOAD4 | yes |
|
||||
\endtable
|
||||
|
||||
For example,
|
||||
@ -48,13 +48,6 @@ Description
|
||||
{
|
||||
nastran
|
||||
{
|
||||
// OpenFOAM field name to NASTRAN load types
|
||||
fields
|
||||
(
|
||||
(pMean PLOAD2)
|
||||
(p PLOAD4)
|
||||
);
|
||||
|
||||
format free; // format type
|
||||
|
||||
scale 1000; // [m] -> [mm]
|
||||
@ -62,6 +55,13 @@ Description
|
||||
{
|
||||
"p.*" 0.01; // [Pa] -> [mbar]
|
||||
}
|
||||
|
||||
// OpenFOAM field name to NASTRAN load types
|
||||
fields
|
||||
(
|
||||
(pMean PLOAD2)
|
||||
(p PLOAD4)
|
||||
);
|
||||
}
|
||||
}
|
||||
\endverbatim
|
||||
@ -93,7 +93,6 @@ Description
|
||||
|
||||
Note
|
||||
Output variable scaling does not apply to integer types such as Ids.
|
||||
Field pairs default to PLOAD2 for scalars and PLOAD4 for vectors etc.
|
||||
|
||||
SourceFiles
|
||||
nastranSurfaceWriter.C
|
||||
@ -221,10 +220,10 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Default construct. Default SHORT format
|
||||
//- Default construct. Default FREE format
|
||||
nastranWriter();
|
||||
|
||||
//- Construct with some output options. Default LONG format
|
||||
//- Construct with some output options. Default FREE format
|
||||
explicit nastranWriter(const dictionary& options);
|
||||
|
||||
//- Construct from components
|
||||
|
||||
@ -128,7 +128,7 @@ Foam::scalar Foam::ReversibleReaction
|
||||
const scalarField& c
|
||||
) const
|
||||
{
|
||||
return kfwd/max(this->Kc(p, T), 1e-6);
|
||||
return kfwd/max(this->Kc(p, T), VSMALL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -119,8 +119,8 @@ bool Foam::viscosityModels::Casson::read
|
||||
|
||||
CassonCoeffs_.readEntry("m", m_);
|
||||
CassonCoeffs_.readEntry("tau0", tau0_);
|
||||
CassonCoeffs_.readEntry("nuMin_", nuMin_);
|
||||
CassonCoeffs_.readEntry("nuMax_", nuMax_);
|
||||
CassonCoeffs_.readEntry("nuMin", nuMin_);
|
||||
CassonCoeffs_.readEntry("nuMax", nuMax_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ tracer0
|
||||
log off;
|
||||
|
||||
resetOnStartUp false;
|
||||
// writeControl writeTime;
|
||||
writeControl writeTime;
|
||||
// writeInterval 1;
|
||||
field tracer0;
|
||||
D 0.001;
|
||||
|
||||
@ -61,6 +61,8 @@ functions
|
||||
fvOptions
|
||||
{
|
||||
}
|
||||
|
||||
writeControl writeTime;
|
||||
}
|
||||
|
||||
fileUpdate
|
||||
|
||||
39
tutorials/incompressible/simpleFoam/rotatingCylinders/0/U
Normal file
39
tutorials/incompressible/simpleFoam/rotatingCylinders/0/U
Normal file
@ -0,0 +1,39 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
innerWall
|
||||
{
|
||||
type noSlip;
|
||||
}
|
||||
|
||||
outerWall
|
||||
{
|
||||
type noSlip;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
34
tutorials/incompressible/simpleFoam/rotatingCylinders/0/p
Normal file
34
tutorials/incompressible/simpleFoam/rotatingCylinders/0/p
Normal file
@ -0,0 +1,34 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
"innerWall|outerWall"
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
10
tutorials/incompressible/simpleFoam/rotatingCylinders/Allrun
Executable file
10
tutorials/incompressible/simpleFoam/rotatingCylinders/Allrun
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication $(getApplication)
|
||||
./plot
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -0,0 +1,30 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object MRFProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
MRF1
|
||||
{
|
||||
cellZone all;
|
||||
active yes;
|
||||
|
||||
nonRotatingPatches (outerWall);
|
||||
|
||||
origin (0 0 0);
|
||||
axis (0 0 1);
|
||||
omega 100;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,22 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object transportProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
transportModel Newtonian;
|
||||
|
||||
nu 1;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,20 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object turbulenceProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
simulationType laminar;
|
||||
|
||||
// ************************************************************************* //
|
||||
42
tutorials/incompressible/simpleFoam/rotatingCylinders/plot
Executable file
42
tutorials/incompressible/simpleFoam/rotatingCylinders/plot
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# Require gnuplot
|
||||
command -v gnuplot >/dev/null || {
|
||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal pngcairo font "helvetica,16" size 800,600
|
||||
set xlabel "Radius, r"
|
||||
set xrange [1:2]
|
||||
set grid
|
||||
|
||||
Omega1 = 100.
|
||||
Omega2 = 0.
|
||||
R1 = 1.
|
||||
R2 = 2.
|
||||
|
||||
mu = Omega2/Omega1
|
||||
|
||||
A = Omega1*(1. - R2*R2*mu/R1/R1)/(1. - R2*R2/R1/R1)
|
||||
B = R1*R1*Omega1*(1. - mu)/(1. - R1*R1/R2/R2)
|
||||
|
||||
analytical_utheta(r) = A*r + B/r
|
||||
C = 0.5*A*A*R1*R1 + 2.*A*B*log(R1) - 0.5*B*B/R1/R1
|
||||
analytical_p(r) = 0.5*A*A*r*r + 2.*A*B*log(r) - 0.5*B*B/r/r - C
|
||||
|
||||
set ylabel "Pressure, p"
|
||||
set output "p.png"
|
||||
set samples 20
|
||||
set key bottom right
|
||||
plot "postProcessing/sample1/1000/centreLine_p.xy" w lines lw 2 lc "black" t "OpenFOAM", \
|
||||
analytical_p(x) w p ps 2 pt 6 lw 2 lc rgb "red" t "analytical"
|
||||
|
||||
set ylabel "U_{/Symbol q}, rad/s"
|
||||
set output "Utheta.png"
|
||||
set samples 20
|
||||
set key top right
|
||||
plot "postProcessing/sample1/1000/centreLine_U_U:Transformed.xy" u 1:6 w lines lw 2 lc "black" t "OpenFOAM", \
|
||||
analytical_utheta(x) w p ps 2 pt 6 lw 2 lc rgb "red" t "analytical"
|
||||
EOF
|
||||
@ -0,0 +1,126 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
geom
|
||||
{
|
||||
r0 1;
|
||||
r1 2;
|
||||
|
||||
nr 40;
|
||||
ntheta 40;
|
||||
|
||||
g 10;
|
||||
|
||||
mr0 #eval{ - $r0 };
|
||||
mr1 #eval{ - $r1 };
|
||||
invG #eval{ 1./$g };
|
||||
}
|
||||
|
||||
vertices
|
||||
(
|
||||
( $:geom.r0 0 0)
|
||||
( 0 $geom.r0 0)
|
||||
($:geom.mr0 0 0)
|
||||
( 0 $geom.mr0 0)
|
||||
( $:geom.r1 0 0)
|
||||
( 0 $geom.r1 0)
|
||||
($:geom.mr1 0 0)
|
||||
( 0 $geom.mr1 0)
|
||||
|
||||
( $:geom.r0 0 1)
|
||||
( 0 $geom.r0 1)
|
||||
($:geom.mr0 0 1)
|
||||
( 0 $geom.mr0 1)
|
||||
( $:geom.r1 0 1)
|
||||
( 0 $geom.r1 1)
|
||||
($:geom.mr1 0 1)
|
||||
( 0 $geom.mr1 1)
|
||||
);
|
||||
|
||||
blockInfo
|
||||
all
|
||||
($:geom.ntheta $:geom.nr 1)
|
||||
simpleGrading (1 ((0.5 0.5 $:geom.g)(0.5 0.5 $:geom.invG)) 1);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (1 0 4 5 9 8 12 13) $blockInfo
|
||||
hex (2 1 5 6 10 9 13 14) $blockInfo
|
||||
hex (3 2 6 7 11 10 14 15) $blockInfo
|
||||
hex (0 3 7 4 8 11 15 12) $blockInfo
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
arc 0 1 origin (0 0 0)
|
||||
arc 1 2 origin (0 0 0)
|
||||
arc 2 3 origin (0 0 0)
|
||||
arc 3 0 origin (0 0 0)
|
||||
arc 8 9 origin (0 0 1)
|
||||
arc 9 10 origin (0 0 1)
|
||||
arc 10 11 origin (0 0 1)
|
||||
arc 11 8 origin (0 0 1)
|
||||
|
||||
arc 4 5 origin (0 0 0)
|
||||
arc 5 6 origin (0 0 0)
|
||||
arc 6 7 origin (0 0 0)
|
||||
arc 7 4 origin (0 0 0)
|
||||
arc 12 13 origin (0 0 1)
|
||||
arc 13 14 origin (0 0 1)
|
||||
arc 14 15 origin (0 0 1)
|
||||
arc 15 12 origin (0 0 1)
|
||||
);
|
||||
|
||||
defaultPatch
|
||||
{
|
||||
name frontAndBack;
|
||||
type empty;
|
||||
}
|
||||
|
||||
boundary
|
||||
(
|
||||
innerWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 0 8 9)
|
||||
(2 1 9 10)
|
||||
(3 2 10 11)
|
||||
(0 3 11 8)
|
||||
);
|
||||
}
|
||||
|
||||
outerWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(5 13 12 4)
|
||||
(6 14 13 5)
|
||||
(7 15 14 6)
|
||||
(4 12 15 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,93 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application simpleFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 1000;
|
||||
|
||||
deltaT 1;
|
||||
|
||||
writeControl timeStep;
|
||||
|
||||
writeInterval 10;
|
||||
|
||||
purgeWrite 3;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 6;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
functions
|
||||
{
|
||||
transform1
|
||||
{
|
||||
type fieldCoordinateSystemTransform;
|
||||
libs (fieldFunctionObjects);
|
||||
writeControl writeTime;
|
||||
|
||||
fields (U);
|
||||
coordinateSystem
|
||||
{
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e3 (0 0 1);
|
||||
e1 (1 0 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sample1
|
||||
{
|
||||
type sets;
|
||||
libs (sampling);
|
||||
writeControl writeTime;
|
||||
fields (U p U:Transformed);
|
||||
interpolationScheme cellPoint;
|
||||
setFormat raw;
|
||||
|
||||
sets
|
||||
(
|
||||
centreLine
|
||||
{
|
||||
type uniform;
|
||||
axis x;
|
||||
start (1 0 0);
|
||||
end (2 0 0);
|
||||
nPoints 20;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,51 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default steadyState;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) bounded Gauss linearUpwind grad(U);
|
||||
div((nuEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,57 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2212 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
{
|
||||
solver GAMG;
|
||||
tolerance 1e-10;
|
||||
relTol 0.1;
|
||||
smoother GaussSeidel;
|
||||
}
|
||||
|
||||
U
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
tolerance 1e-10;
|
||||
relTol 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
pRefCell 0;
|
||||
pRefValue 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
fields
|
||||
{
|
||||
p 0.3;
|
||||
}
|
||||
equations
|
||||
{
|
||||
U 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,21 +1,26 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# CGAL definitions - several possibilities
|
||||
#
|
||||
# 0. missing
|
||||
# 1. header-only
|
||||
# 2. library, no mpfr
|
||||
# 3. library, with mpfr (a likely default)
|
||||
# - missing
|
||||
# - header-only
|
||||
# - header-only, no mpfr
|
||||
# - library, no mpfr
|
||||
# - library, with mpfr (default for older CGAL)
|
||||
#
|
||||
# Dispatch according to the defined 'CGAL_FLAVOUR'
|
||||
# - names may change [see wmake/scripts/have_cgal]
|
||||
# (no-cgal | cgal-header | cgal-no-mpfr | cgal-mpfr)
|
||||
# (no-cgal | cgal-header | cgal-header-no-mpfr | cgal-no-mpfr | cgal-mpfr)
|
||||
|
||||
cgal_subrule := cgal-mpfr
|
||||
ifneq (,$(findstring header,$(CGAL_FLAVOUR)))
|
||||
cgal_subrule := cgal-header-only
|
||||
endif
|
||||
ifneq (,$(findstring no-mpfr,$(CGAL_FLAVOUR)))
|
||||
cgal_subrule := cgal-no-mpfr
|
||||
ifneq (,$(findstring header,$(CGAL_FLAVOUR)))
|
||||
cgal_subrule := cgal-header-no-mpfr
|
||||
endif
|
||||
else
|
||||
ifneq (,$(findstring header,$(CGAL_FLAVOUR)))
|
||||
cgal_subrule := cgal-header-only
|
||||
endif
|
||||
endif
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
18
wmake/rules/General/cgal-header-no-mpfr
Normal file
18
wmake/rules/General/cgal-header-no-mpfr
Normal file
@ -0,0 +1,18 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# CGAL (header-only version) without mpfr
|
||||
|
||||
CGAL_INC = -DCGAL_HEADER_ONLY
|
||||
CGAL_LIBS =
|
||||
|
||||
CGAL_INC += \
|
||||
$(foreach dir,$(BOOST_INC_DIR),-I$(dir)) \
|
||||
$(foreach dir,$(CGAL_INC_DIR),-I$(dir))
|
||||
|
||||
CGAL_LIBS += \
|
||||
$(foreach dir,$(BOOST_LIB_DIR),-L$(dir))
|
||||
|
||||
# ----
|
||||
# Extra failsafe - still needed? (2020-05-15)
|
||||
## CGAL_INC += -I/usr/local/include -I/usr/include
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
@ -1,14 +0,0 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# CGAL on Darwin
|
||||
# CGAL (library version) without mpfr
|
||||
|
||||
CGAL_INC = \
|
||||
$(foreach dir,$(BOOST_INC_DIR),-I$(dir)) \
|
||||
$(foreach dir,$(CGAL_INC_DIR),-I$(dir))
|
||||
|
||||
CGAL_LIBS = \
|
||||
$(foreach dir,$(BOOST_LIB_DIR),-L$(dir)) \
|
||||
$(foreach dir,$(CGAL_LIB_DIR),-L$(dir)) \
|
||||
-lCGAL
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
@ -35,6 +35,7 @@ LINKLIBSO = $(CC) $(c++FLAGS) -shared \
|
||||
-Wl,--strip-all
|
||||
|
||||
LINKEXE = $(CC) $(c++FLAGS) \
|
||||
-static-libgcc -static-libstdc++ \
|
||||
-Wl,--enable-auto-import \
|
||||
-Wl,--strip-all \
|
||||
-Wl,--force-exe-suffix
|
||||
|
||||
Reference in New Issue
Block a user