Compare commits
13 Commits
temp-probe
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| ecff1d2339 | |||
| 0bb5c6e0b3 | |||
| e17d8c92d7 | |||
| b147078b30 | |||
| ecd61f0e68 | |||
| c423ebecc1 | |||
| 8fe025cb8e | |||
| 313b1f71f1 | |||
| 61cd298928 | |||
| 286de9dde9 | |||
| bd5021e31c | |||
| 1fc9313c97 | |||
| aff5c3b680 |
@ -1,2 +1,2 @@
|
||||
api=2306
|
||||
patch=0
|
||||
patch=240625
|
||||
|
||||
14
doc/Build.md
14
doc/Build.md
@ -1,23 +1,23 @@
|
||||
## Getting the code
|
||||
|
||||
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2212:
|
||||
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2306:
|
||||
|
||||
- https://dl.openfoam.com/source/latest/
|
||||
- Source: https://dl.openfoam.com/source/v2212/OpenFOAM-v2212.tgz
|
||||
- ThirdParty: https://dl.openfoam.com/source/v2212/ThirdParty-v2212.tgz
|
||||
- Source: https://dl.openfoam.com/source/v2306/OpenFOAM-v2306.tgz
|
||||
- ThirdParty: https://dl.openfoam.com/source/v2306/ThirdParty-v2306.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-v2212 version:
|
||||
For example, for the OpenFOAM-v2306 version:
|
||||
```
|
||||
source <installation path>/OpenFOAM-v2212/etc/bashrc
|
||||
source <installation path>/OpenFOAM-v2306/etc/bashrc
|
||||
```
|
||||
e.g. if installed under the `~/openfoam` directory
|
||||
```
|
||||
source ~/openfoam/OpenFOAM-v2212/etc/bashrc
|
||||
source ~/openfoam/OpenFOAM-v2306/etc/bashrc
|
||||
```
|
||||
|
||||
|
||||
@ -157,4 +157,4 @@ More details in the [ThirdParty build guide][link third-build].
|
||||
[wiki-config]: https://develop.openfoam.com/Development/openfoam/-/wikis/configuring
|
||||
|
||||
---
|
||||
Copyright 2019-2022 OpenCFD Ltd
|
||||
Copyright 2019-2023 OpenCFD Ltd
|
||||
|
||||
@ -24,6 +24,7 @@ $(fileOps)/fileOperation/fileOperationRanks.C
|
||||
$(fileOps)/fileOperation/fileOperationInitialise.C
|
||||
$(fileOps)/dummyFileOperation/dummyFileOperation.C
|
||||
$(fileOps)/uncollatedFileOperation/uncollatedFileOperation.C
|
||||
$(fileOps)/uncollatedFileOperation/hostUncollatedFileOperation.C
|
||||
$(fileOps)/masterUncollatedFileOperation/masterUncollatedFileOperation.C
|
||||
$(fileOps)/collatedFileOperation/collatedFileOperation.C
|
||||
$(fileOps)/collatedFileOperation/hostCollatedFileOperation.C
|
||||
|
||||
@ -176,10 +176,11 @@ makeBoundary
|
||||
new SlicedPatchField<Type>
|
||||
(
|
||||
p,
|
||||
DimensionedField<Type, GeoMesh>::null(),
|
||||
bField[patchi]
|
||||
DimensionedField<Type, GeoMesh>::null()
|
||||
)
|
||||
);
|
||||
|
||||
bf[patchi].UList<Type>::shallowCopy(bField[patchi]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -538,6 +538,10 @@ inline Foam::Tensor<Cmpt> Foam::Tensor<Cmpt>::inv2D
|
||||
|
||||
|
||||
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
|
||||
{
|
||||
@ -561,6 +565,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
|
||||
{
|
||||
@ -1103,6 +1111,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)
|
||||
{
|
||||
@ -1117,6 +1129,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)
|
||||
{
|
||||
@ -1131,6 +1147,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)
|
||||
{
|
||||
@ -1153,6 +1173,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)
|
||||
{
|
||||
@ -1193,6 +1217,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)
|
||||
{
|
||||
|
||||
@ -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.
|
||||
@ -47,7 +47,6 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
namespace fileFormats
|
||||
{
|
||||
|
||||
@ -73,18 +72,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
|
||||
@ -92,18 +91,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
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
|
||||
this->coeffDict().subDict("sizeDistribution"), owner.rndGen()
|
||||
)
|
||||
),
|
||||
nInjected_(this->parcelsAddedTotal()),
|
||||
nInjected_(Pstream::master() ? this->parcelsAddedTotal() : 0),
|
||||
injectorOrder_(identity(positionAxis_.size())),
|
||||
tanVec1_(),
|
||||
tanVec2_()
|
||||
@ -233,7 +233,7 @@ Foam::label Foam::ConeInjection<CloudType>::parcelsToInject
|
||||
const label targetParcels =
|
||||
ceil(positionAxis_.size()*parcelsPerInjector_*volumeFraction);
|
||||
|
||||
return targetParcels - nInjected_;
|
||||
return targetParcels - returnReduce(nInjected_, sumOp<label>());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1387,6 +1387,7 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
|
||||
(
|
||||
face2i != facei
|
||||
&& surfaceIndex[face2i] != -1
|
||||
&& cutter.faceLevel(face2i) > cLevel
|
||||
)
|
||||
{
|
||||
// Get outwards pointing normal
|
||||
|
||||
@ -614,6 +614,12 @@ void Foam::advancingFrontAMI::write(Ostream& os) const
|
||||
faceAreaIntersect::triangulationModeNames_[faceAreaIntersect::tmMesh],
|
||||
faceAreaIntersect::triangulationModeNames_[triMode_]
|
||||
);
|
||||
os.writeEntryIfDifferent<word>
|
||||
(
|
||||
"areaNormalisationMode",
|
||||
areaNormalisationModeNames_[areaNormalisationMode::project],
|
||||
areaNormalisationModeNames_[areaNormalisationMode_]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -383,8 +383,8 @@ void Foam::cyclicAMIPolyPatch::resetAMI(const UList<point>& points) const
|
||||
}
|
||||
|
||||
const cyclicAMIPolyPatch& nbr = neighbPatch();
|
||||
pointField srcPoints(localPoints());
|
||||
pointField nbrPoints(nbr.localPoints());
|
||||
const pointField srcPoints(points, meshPoints());
|
||||
pointField nbrPoints(points, nbr.meshPoints());
|
||||
|
||||
Info<< "AMI: Creating AMI for source:" << name()
|
||||
<< " and target:" << nbr.name() << endl;
|
||||
|
||||
@ -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,41 +98,69 @@ 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);
|
||||
|
||||
dynEdges.append(edge(a,b));
|
||||
label a = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
label b = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
dynEdges.emplace_back(a,b);
|
||||
}
|
||||
else if (cmd == "PLOTEL")
|
||||
{
|
||||
// Fixed format:
|
||||
// 8-16 : element id
|
||||
// 16-24 : vertex
|
||||
// 24-32 : vertex
|
||||
// 32-40 : vertex
|
||||
|
||||
// discard elementId (8-16)
|
||||
(void) nextNasField(line, linei, 8); // 8-16
|
||||
(void) nextNasField(line, linei, 8, freeFormat);
|
||||
|
||||
label a = readLabel(nextNasField(line, linei, 8)); // 16-24
|
||||
label b = readLabel(nextNasField(line, linei, 8)); // 24-32
|
||||
label a = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
label b = readLabel(nextNasField(line, linei, 8, freeFormat));
|
||||
|
||||
dynEdges.append(edge(a,b));
|
||||
dynEdges.emplace_back(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)
|
||||
|
||||
pointId.append(index);
|
||||
dynPoints.append(point(x, y, z));
|
||||
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.push_back(index);
|
||||
dynPoints.emplace_back(x, y, z);
|
||||
}
|
||||
else if (cmd == "GRID*")
|
||||
{
|
||||
@ -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
|
||||
@ -157,8 +191,8 @@ bool Foam::fileFormats::NASedgeFormat::read
|
||||
(void) nextNasField(line, linei, 8); // 0-8
|
||||
scalar z = readNasScalar(nextNasField(line, linei, 16)); // 8-16
|
||||
|
||||
pointId.append(index);
|
||||
dynPoints.append(point(x, y, z));
|
||||
pointId.push_back(index);
|
||||
dynPoints.emplace_back(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-202i3 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,24 +38,22 @@ namespace Foam
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::filmModelType&
|
||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
||||
filmModel() const
|
||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::filmModel() const
|
||||
{
|
||||
HashTable<const filmModelType*> models
|
||||
= db().time().lookupClass<filmModelType>();
|
||||
const auto models = db().time().lookupClass<filmModelType>();
|
||||
|
||||
DynamicList<word> modelNames(models.size());
|
||||
forAllConstIters(models, iter)
|
||||
{
|
||||
if (iter()->regionMesh().name() == filmRegionName_)
|
||||
const auto& model = *(iter.val());
|
||||
const word& modelName = model.regionMesh().name();
|
||||
|
||||
if (modelName == filmRegionName_)
|
||||
{
|
||||
return *iter();
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
DynamicList<word> modelNames;
|
||||
forAllConstIters(models, iter)
|
||||
{
|
||||
modelNames.append(iter()->regionMesh().name());
|
||||
modelNames.push_back(modelName);
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
@ -69,24 +67,22 @@ filmModel() const
|
||||
|
||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
||||
pyrolysisModelType&
|
||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
||||
pyrModel() const
|
||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::pyrModel() const
|
||||
{
|
||||
HashTable<const pyrolysisModelType*> models =
|
||||
db().time().lookupClass<pyrolysisModelType>();
|
||||
const auto models = db().time().lookupClass<pyrolysisModelType>();
|
||||
|
||||
DynamicList<word> modelNames(models.size());
|
||||
forAllConstIters(models, iter)
|
||||
{
|
||||
if (iter()->regionMesh().name() == pyrolysisRegionName_)
|
||||
const auto& model = *(iter.val());
|
||||
const word& modelName = model.regionMesh().name();
|
||||
|
||||
if (modelName == pyrolysisRegionName_)
|
||||
{
|
||||
return *iter();
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
DynamicList<word> modelNames;
|
||||
forAllConstIters(models, iter)
|
||||
{
|
||||
modelNames.append(iter()->regionMesh().name());
|
||||
modelNames.push_back(modelName);
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
@ -233,13 +229,9 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::rmap
|
||||
{
|
||||
mixedFvPatchScalarField::rmap(ptf, addr);
|
||||
|
||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField& tiptf =
|
||||
refCast
|
||||
<
|
||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
||||
>(ptf);
|
||||
const auto& fpptf = refCast<const myType>(ptf);
|
||||
|
||||
temperatureCoupledBase::rmap(tiptf, addr);
|
||||
temperatureCoupledBase::rmap(fpptf, addr);
|
||||
}
|
||||
|
||||
|
||||
@ -251,8 +243,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
// Get the coupling information from the mappedPatchBase
|
||||
const mappedPatchBase& mpp =
|
||||
refCast<const mappedPatchBase>(patch().patch());
|
||||
const auto& mpp = refCast<const mappedPatchBase>(patch().patch());
|
||||
|
||||
const label patchi = patch().index();
|
||||
const label nbrPatchi = mpp.samplePolyPatch().index();
|
||||
@ -264,10 +255,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
scalarField intFld(patchInternalField());
|
||||
|
||||
const auto& nbrField =
|
||||
refCast
|
||||
<
|
||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
||||
>
|
||||
refCast<const myType>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField>(TnbrName_)
|
||||
);
|
||||
@ -285,7 +273,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
scalarField KDeltaNbr(nbrK*nbrPatch.deltaCoeffs());
|
||||
mpp.distribute(KDeltaNbr);
|
||||
|
||||
scalarField myKDelta(K*patch().deltaCoeffs());
|
||||
const scalarField myKDelta(K*patch().deltaCoeffs());
|
||||
|
||||
scalarList Tfilm(patch().size(), Zero);
|
||||
scalarList htcwfilm(patch().size(), Zero);
|
||||
@ -298,22 +286,78 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
scalarField qr(patch().size(), Zero);
|
||||
|
||||
label coupledPatchi = -1;
|
||||
label filmPatchi = -1;
|
||||
if (pyrolysisRegionName_ == mesh.name())
|
||||
{
|
||||
// Working on the pyrolysis mesh
|
||||
|
||||
coupledPatchi = patchi;
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = nbrPatch.lookupPatchField<volScalarField>(qrName_);
|
||||
mpp.distribute(qr);
|
||||
}
|
||||
|
||||
filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
|
||||
|
||||
const scalarField htcw(film.htcw().h()().boundaryField()[filmPatchi]);
|
||||
|
||||
// Obtain htcw
|
||||
htcwfilm =
|
||||
pyrolysis.mapRegionPatchField
|
||||
(
|
||||
film,
|
||||
coupledPatchi,
|
||||
filmPatchi,
|
||||
htcw,
|
||||
true
|
||||
);
|
||||
|
||||
// Obtain Tfilm at the boundary through Ts.
|
||||
// NOTE: Tf is not good as at the boundary it will retrieve Tp
|
||||
const scalarField Ts(film.Ts().boundaryField()[filmPatchi]);
|
||||
Tfilm =
|
||||
pyrolysis.mapRegionPatchField
|
||||
(
|
||||
film,
|
||||
coupledPatchi,
|
||||
filmPatchi,
|
||||
Ts,
|
||||
true
|
||||
);
|
||||
|
||||
// Obtain delta
|
||||
filmDelta =
|
||||
pyrolysis.mapRegionPatchField<scalar>
|
||||
(
|
||||
film,
|
||||
"deltaf",
|
||||
coupledPatchi,
|
||||
true
|
||||
);
|
||||
}
|
||||
else if (pyrolysis.primaryMesh().name() == mesh.name())
|
||||
{
|
||||
// Working on the primary mesh
|
||||
|
||||
coupledPatchi = nbrPatch.index();
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = patch().lookupPatchField<volScalarField>(qrName_);
|
||||
}
|
||||
|
||||
filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
|
||||
|
||||
htcwfilm = film.htcw().h()().boundaryField()[filmPatchi];
|
||||
film.toPrimary(filmPatchi, htcwfilm);
|
||||
|
||||
// Obtain Tfilm at the boundary through Ts.
|
||||
// NOTE: Tf is not good as at the boundary it will retrieve Tp
|
||||
Tfilm = film.Ts().boundaryField()[filmPatchi];
|
||||
film.toPrimary(filmPatchi, Tfilm);
|
||||
|
||||
filmDelta = film.delta().boundaryField()[filmPatchi];
|
||||
film.toPrimary(filmPatchi, filmDelta);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -323,39 +367,8 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const label filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
|
||||
|
||||
const scalarField htcw(film.htcw().h()().boundaryField()[filmPatchi]);
|
||||
|
||||
// Obtain htcw
|
||||
htcwfilm =
|
||||
pyrolysis.mapRegionPatchField
|
||||
(
|
||||
film,
|
||||
coupledPatchi,
|
||||
filmPatchi,
|
||||
htcw,
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
// Obtain Tfilm at the boundary through Ts.
|
||||
// NOTE: Tf is not good as at the boundary it will retrieve Tp
|
||||
Tfilm = film.Ts().boundaryField()[filmPatchi];
|
||||
film.toPrimary(filmPatchi, Tfilm);
|
||||
|
||||
// Obtain delta
|
||||
filmDelta =
|
||||
pyrolysis.mapRegionPatchField<scalar>
|
||||
(
|
||||
film,
|
||||
"deltaf",
|
||||
coupledPatchi,
|
||||
true
|
||||
);
|
||||
|
||||
// Estimate wetness of the film (1: wet , 0: dry)
|
||||
scalarField ratio
|
||||
const scalarField ratio
|
||||
(
|
||||
min
|
||||
(
|
||||
@ -368,14 +381,11 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
)
|
||||
);
|
||||
|
||||
scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
|
||||
|
||||
scalarField qRad((1.0 - ratio)*qr);
|
||||
|
||||
scalarField alpha(KDeltaNbr - (qRad + qConv)/Tp);
|
||||
const scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
|
||||
const scalarField qRad((1.0 - ratio)*qr);
|
||||
const scalarField alpha(KDeltaNbr - (qRad + qConv)/Tp);
|
||||
|
||||
valueFraction() = alpha/(alpha + (1.0 - ratio)*myKDelta);
|
||||
|
||||
refValue() = ratio*Tfilm + (1.0 - ratio)*(KDeltaNbr*nbrIntFld)/alpha;
|
||||
|
||||
mixedFvPatchScalarField::updateCoeffs();
|
||||
|
||||
@ -110,6 +110,8 @@ public:
|
||||
typedef Foam::regionModels::pyrolysisModels::pyrolysisModel
|
||||
pyrolysisModelType;
|
||||
|
||||
typedef filmPyrolysisRadiativeCoupledMixedFvPatchScalarField myType;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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
|
||||
|
||||
@ -19,7 +19,7 @@ solvers
|
||||
"pcorr.*"
|
||||
{
|
||||
solver GAMG;
|
||||
smoother GaussSeidel;
|
||||
smoother DICGaussSeidel;
|
||||
cacheAgglomeration no;
|
||||
tolerance 0.02;
|
||||
relTol 0;
|
||||
|
||||
Reference in New Issue
Block a user