Compare commits
20 Commits
OpenFOAM-v
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| e5c6ccc3d3 | |||
| af3c9ebb5e | |||
| de413eaf9c | |||
| 07945a519f | |||
| 0bb0c1db74 | |||
| 535a4fccb4 | |||
| e1b04cb6a7 | |||
| b7ce6bf69d | |||
| 0a53013499 | |||
| 47f2ff618d | |||
| 47575aabf2 | |||
| 97c8e62fe4 | |||
| 297fee00f1 | |||
| c987ac228c | |||
| 4fe3f55e4d | |||
| cb1aa273fd | |||
| 5aa40389c2 | |||
| 7904a2734f | |||
| 45e7c4a005 | |||
| 71d3f2344a |
@ -1,13 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
set -- -no-recursion "$@" # Parse arguments only
|
||||
|
||||
# Run from OPENFOAM top-level directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
|
||||
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments -no-recursion "$@" || \
|
||||
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
|
||||
echo "Argument parse error"
|
||||
else
|
||||
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
set -- -no-recursion "$@" # Parse arguments only
|
||||
|
||||
# Run from OPENFOAM top-level directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
|
||||
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments -no-recursion "$@" || \
|
||||
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
|
||||
echo "Argument parse error"
|
||||
else
|
||||
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2412
|
||||
patch=0
|
||||
patch=250814
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
+ (
|
||||
he2.name() == thermo2.phasePropertyName("e")
|
||||
? fvc::div(fvc::absolute(alphaPhi2, alpha2, U2), p)
|
||||
+ p*fvc::ddt(alpha1)
|
||||
+ p*fvc::ddt(alpha2)
|
||||
: -alpha2*dpdt
|
||||
)
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments -no-recursion "$@"
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
set -- -no-recursion "$@" # Parse arguments only
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,11 +37,30 @@ License
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
void checkCanonicalSize(label size)
|
||||
{
|
||||
const auto n = HashTableCore::canonicalSize(size);
|
||||
|
||||
std::ostringstream buf;
|
||||
buf.setf(std::ios_base::hex, std::ios_base::basefield);
|
||||
buf << n;
|
||||
|
||||
Info<< "hash-table size of " << size
|
||||
<< " = " << n << " (0x" << buf.str().c_str() << ')' << nl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main()
|
||||
{
|
||||
for (label size : { -1, 0, 1, 7, 500, 1024, 1025, 10000, (labelMax-1)} )
|
||||
{
|
||||
checkCanonicalSize(size);
|
||||
}
|
||||
Info<< nl;
|
||||
|
||||
HashTable<scalar> table1
|
||||
{
|
||||
{"aaa", 1.0},
|
||||
|
||||
@ -62,6 +62,9 @@ Description
|
||||
|
||||
// Flex may use register, which is deprecated and incompatible with C++17
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
// A 'nothing' define to effectively remove from code as well (issue #3337)
|
||||
#undef register
|
||||
#define register
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
@ -56,6 +56,9 @@ Description
|
||||
|
||||
// Flex may use register, which is deprecated and incompatible with C++17
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
// A 'nothing' define to effectively remove from code as well (issue #3337)
|
||||
#undef register
|
||||
#define register
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -63,6 +63,9 @@ Description
|
||||
|
||||
// Flex may use register, which is deprecated and incompatible with C++17
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
// A 'nothing' define to effectively remove from code as well (issue #3337)
|
||||
#undef register
|
||||
#define register
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -51,6 +51,9 @@ Description
|
||||
|
||||
// Flex may use register, which is deprecated and incompatible with C++17
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
// A 'nothing' define to effectively remove from code as well (issue #3337)
|
||||
#undef register
|
||||
#define register
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ include $(GENERAL_RULES)/cgal
|
||||
|
||||
EXE_INC = \
|
||||
-DUNIX \
|
||||
-Wno-old-style-cast \
|
||||
/* -IMarchingCubes */ \
|
||||
-I$(FASTDUALOCTREE_SRC_PATH) \
|
||||
-I../conformalVoronoiMesh/lnInclude \
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
include $(GENERAL_RULES)/cgal-header-only
|
||||
|
||||
EXE_INC = \
|
||||
-Wno-old-style-cast \
|
||||
$(COMP_FLAGS) \
|
||||
${CGAL_INC} \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
@ -9,7 +8,6 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/distributed/lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lsurfMesh \
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
EXE_NDEBUG = -DNDEBUG
|
||||
/* EXE_NDEBUG = -g -O0 -DFULLDEBUG */
|
||||
|
||||
c++CGALWARN = -Wno-old-style-cast
|
||||
|
||||
/*-- Define CGAL_INEXACT to use inexact CGAL constructions */
|
||||
|
||||
include $(GENERAL_RULES)/cgal
|
||||
@ -11,7 +9,6 @@ EXE_INC = \
|
||||
${ROUNDING_MATH} \
|
||||
${EXE_NDEBUG} \
|
||||
${CGAL_INC} \
|
||||
${c++LESSWARN} \
|
||||
-I.. \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
Submodule modules/OpenQBMM updated: dfbb204b70...9826f810ea
Submodule modules/external-solver updated: 60323b8a06...090b5a7452
Submodule modules/visualization updated: 0f21605bec...42281cdd8c
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -64,12 +64,11 @@ std::string pipeOpen(const std::string& cmd, const int lineNum = 0)
|
||||
if (cnt == lineNum)
|
||||
{
|
||||
// Retain the last line, trimming trailing newline
|
||||
str.assign(buf);
|
||||
|
||||
if (str.size())
|
||||
if (nread > 0)
|
||||
{
|
||||
str.resize(str.size()-1);
|
||||
buf[nread-1] = '\0';
|
||||
}
|
||||
str.assign(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -27,7 +27,6 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "HashTableCore.H"
|
||||
#include "uLabel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -36,51 +35,66 @@ namespace Foam
|
||||
defineTypeNameAndDebug(HashTableCore, 0);
|
||||
}
|
||||
|
||||
// Approximately labelMax/4
|
||||
const Foam::label Foam::HashTableCore::maxTableSize(1L << (sizeof(label)*8-3));
|
||||
|
||||
// file-scope:
|
||||
// Minimum internal table size (must be a power of two!)
|
||||
constexpr int32_t minTableSize = 8;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::HashTableCore::canonicalSize(const label requested_size)
|
||||
Foam::label Foam::HashTableCore::canonicalSize(const label size) noexcept
|
||||
{
|
||||
if (requested_size < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (requested_size >= maxTableSize)
|
||||
{
|
||||
return maxTableSize;
|
||||
}
|
||||
|
||||
// Enforce power of two for fast modulus in hash index calculations.
|
||||
// Use unsigned for these calculations.
|
||||
//
|
||||
// - The lower limit (8) is somewhat arbitrary, but if the hash table
|
||||
// is too small, there will be many direct table collisions.
|
||||
// - The upper limit (approx. labelMax/4) must be a power of two,
|
||||
// - The upper limit (approx. INT32_MAX/4) must be a power of two,
|
||||
// need not be extremely large for hashing.
|
||||
|
||||
uLabel powerOfTwo = 8u; // lower-limit
|
||||
|
||||
const uLabel size = requested_size;
|
||||
if (size <= powerOfTwo)
|
||||
if (size <= minTableSize)
|
||||
{
|
||||
return powerOfTwo;
|
||||
return (size < 1 ? 0 : minTableSize);
|
||||
}
|
||||
else if (size > maxTableSize/2)
|
||||
{
|
||||
return maxTableSize;
|
||||
}
|
||||
|
||||
if (size & (size-1)) // <- Modulus of i^2
|
||||
{
|
||||
// Determine power-of-two. Brute-force is fast enough.
|
||||
while (powerOfTwo < size)
|
||||
{
|
||||
powerOfTwo <<= 1;
|
||||
}
|
||||
// Determine power-of-two with glibc (may or may not be faster):
|
||||
//
|
||||
// return (1 << (32-__builtin_clz(int32_t(size-1))));
|
||||
|
||||
return powerOfTwo;
|
||||
if (!(size & (size-1)))
|
||||
{
|
||||
// Already a power-of-two...
|
||||
return size;
|
||||
}
|
||||
|
||||
return size;
|
||||
// Non-branching for 32-bit
|
||||
// [https://graphics.stanford.edu/~seander/bithacks.html]
|
||||
{
|
||||
uint32_t n(size);
|
||||
--n;
|
||||
n |= n >> 1;
|
||||
n |= n >> 2;
|
||||
n |= n >> 4;
|
||||
n |= n >> 8;
|
||||
n |= n >> 16;
|
||||
++n;
|
||||
return n;
|
||||
}
|
||||
|
||||
// OLD:
|
||||
// Brute-force method
|
||||
//
|
||||
// uint32_t n(minTableSize);
|
||||
// while (n < uint32_t(size))
|
||||
// {
|
||||
// n <<= 1;
|
||||
// }
|
||||
// return n;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -40,7 +40,6 @@ SourceFiles
|
||||
#define Foam_HashTableCore_H
|
||||
|
||||
#include "label.H"
|
||||
#include "uLabel.H"
|
||||
#include "className.H"
|
||||
#include "nullObject.H"
|
||||
|
||||
@ -56,11 +55,13 @@ namespace Foam
|
||||
//- Bits that are independent of HashTable template parameters.
|
||||
struct HashTableCore
|
||||
{
|
||||
//- Maximum allowable internal table size. Approximately labelMax/4
|
||||
static const label maxTableSize;
|
||||
//- Maximum allowable internal table size (must be a power of two!).
|
||||
// - approximately (INT32_MAX/4) => 0x20000000
|
||||
// - don't need an int64 version
|
||||
static constexpr int32_t maxTableSize = (1 << (32-3));
|
||||
|
||||
//- Return a canonical (power-of-two) of the requested size.
|
||||
static label canonicalSize(const label requested_size);
|
||||
static label canonicalSize(const label size) noexcept;
|
||||
|
||||
//- Declare type-name (with debug switch)
|
||||
ClassName("HashTable");
|
||||
|
||||
@ -26,12 +26,19 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointConstraint.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
const char* const pTraits<pointConstraint>::typeName = "pointConstraint";
|
||||
defineCompoundTypeName(List<pointConstraint>, pointConstraintList);
|
||||
addCompoundToRunTimeSelectionTable
|
||||
(
|
||||
List<pointConstraint>,
|
||||
pointConstraintList
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -64,7 +64,7 @@ MAXMINPOW(float, float, int)
|
||||
MAXMINPOW(float, int, float)
|
||||
MAXMINPOW(float, float, long)
|
||||
MAXMINPOW(float, long, float)
|
||||
#if defined(__APPLE__) && WM_LABEL_SIZE == 64
|
||||
#if (WM_LABEL_SIZE == 64) && (defined(__APPLE__) || defined(_WIN32))
|
||||
MAXMINPOW(double, double, int64_t)
|
||||
MAXMINPOW(double, int64_t, double)
|
||||
MAXMINPOW(float, float, int64_t)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -433,7 +433,7 @@ inline complex pow(const complex& x, const complex& y)
|
||||
|
||||
powFuncs(int)
|
||||
powFuncs(long)
|
||||
#if defined(__APPLE__) && WM_LABEL_SIZE == 64
|
||||
#if (WM_LABEL_SIZE == 64) && (defined(__APPLE__) || defined(_WIN32))
|
||||
powFuncs(int64_t)
|
||||
#endif
|
||||
powFuncs(float)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments -no-recursion "$@"
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
set -- -no-recursion "$@" # Parse arguments only
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -521,7 +521,7 @@ void Foam::displacementSmartPointSmoothingMotionSolver::solve()
|
||||
markAffectedFaces(facesToMove_, affectedFaces);
|
||||
|
||||
|
||||
for(label i = 0; i < nPointSmootherIter_; i ++)
|
||||
for (label nIter = 0; nIter < nPointSmootherIter_; ++nIter)
|
||||
{
|
||||
const pointField wantedPoints
|
||||
(
|
||||
@ -665,7 +665,7 @@ void Foam::displacementSmartPointSmoothingMotionSolver::solve()
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
OBJstream os(debugDir/"untangle_" + Foam::name(i) + ".obj");
|
||||
OBJstream os(debugDir/"untangle_" + Foam::name(nIter) + ".obj");
|
||||
|
||||
const pointField wantedPoints
|
||||
(
|
||||
|
||||
@ -44,6 +44,9 @@ Description
|
||||
|
||||
// Flex may use register, which is deprecated and incompatible with C++17
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
// A 'nothing' define to effectively remove from code as well (issue #3337)
|
||||
#undef register
|
||||
#define register
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zoneDistribute.H"
|
||||
#include "processorPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -44,10 +45,48 @@ Foam::zoneDistribute::zoneDistribute(const fvMesh& mesh)
|
||||
stencil_(zoneCPCStencil::New(mesh)),
|
||||
globalNumbering_(stencil_.globalNumbering()),
|
||||
send_(UPstream::nProcs()),
|
||||
pBufs_(UPstream::commsTypes::nonBlocking)
|
||||
pBufs_(UPstream::commsTypes::nonBlocking),
|
||||
cyclicBoundaryCells_(mesh.nCells(), false)
|
||||
{
|
||||
// Don't clear storage on persistent buffer
|
||||
pBufs_.allowClearRecv(false);
|
||||
|
||||
// Loop over boundary patches and store cells with a face on a cyclic patch
|
||||
bool hasCyclicPatches = false;
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
{
|
||||
const cyclicPolyPatch* cpp =
|
||||
isA<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]);
|
||||
|
||||
if (cpp)
|
||||
{
|
||||
cyclicBoundaryCells_.set(cpp->faceCells());
|
||||
hasCyclicPatches = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Populate cyclicCentres_
|
||||
if(hasCyclicPatches)
|
||||
{
|
||||
// Make a boolList from the bitSet
|
||||
boolList isCyclicCell(mesh.nCells(), false);
|
||||
|
||||
forAll(cyclicBoundaryCells_, celli)
|
||||
{
|
||||
if (cyclicBoundaryCells_.test(celli))
|
||||
{
|
||||
isCyclicCell[celli] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Use getFields to get map of cell centres across processor boundaries
|
||||
setUpCommforZone(isCyclicCell, true);
|
||||
|
||||
cyclicCentres_.reset
|
||||
(
|
||||
new Map<vectorField>(getFields(isCyclicCell, mesh_.C()))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -141,5 +180,223 @@ void Foam::zoneDistribute::setUpCommforZone
|
||||
}
|
||||
}
|
||||
|
||||
Foam::List<Foam::label> Foam::zoneDistribute::getCyclicPatches
|
||||
(
|
||||
const label celli,
|
||||
const label globalIdx,
|
||||
const vector globalIdxCellCentre
|
||||
) const
|
||||
{
|
||||
// Initialise cyclic patch label list
|
||||
List<label> patches(0);
|
||||
|
||||
// If celli is not on a cyclic boundary, return the empty list
|
||||
if (!cyclicBoundaryCells_.test(celli))
|
||||
{
|
||||
return patches;
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& bMesh = mesh_.boundaryMesh();
|
||||
|
||||
// Making list of cyclic patches to which celli belongs
|
||||
List<label> celliCyclicPatches;
|
||||
forAll(bMesh, patchi)
|
||||
{
|
||||
if (isA<cyclicPolyPatch>(bMesh[patchi]))
|
||||
{
|
||||
// Note: Probably not efficient due to use of found(celli) but
|
||||
// typically only used for very few cells (interface cells and their
|
||||
// point neighbours on cyclic boundaries).
|
||||
if (bMesh[patchi].faceCells().found(celli))
|
||||
{
|
||||
celliCyclicPatches.append(patchi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// So celli belongs to at least one cyclic patch.
|
||||
// Let us figure out which.
|
||||
if (globalNumbering_.isLocal(globalIdx)) // celli and globalIdx on same proc
|
||||
{
|
||||
// Get all local point neighbor cells of celli, i.e. all point
|
||||
// neighbours that are not on the other side of a cyclic patch.
|
||||
List<label> localPointNeiCells(0);
|
||||
const labelList& cellPoints = mesh_.cellPoints()[celli];
|
||||
|
||||
for (const label cellPoint : cellPoints)
|
||||
{
|
||||
const labelList& pointKCells = mesh_.pointCells()[cellPoint];
|
||||
|
||||
for (const label pointKCell : pointKCells)
|
||||
{
|
||||
if (!localPointNeiCells.found(pointKCell))
|
||||
{
|
||||
localPointNeiCells.append(pointKCell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Since globalIdx is a global cell index obtained from the point
|
||||
// neighbour list, stencil[celli], all cells in this that are not in
|
||||
// localPointNeiCells must be cyclic neighbour cells.
|
||||
const label localIdx = globalNumbering_.toLocal(globalIdx);
|
||||
if (!localPointNeiCells.found(localIdx))
|
||||
{
|
||||
for (const label patchi : celliCyclicPatches)
|
||||
{
|
||||
// Find the corresponding cyclic neighbor patch ID
|
||||
const cyclicPolyPatch& cpp =
|
||||
static_cast<const cyclicPolyPatch&>(bMesh[patchi]);
|
||||
|
||||
const label neiPatch = cpp.neighbPatchID();
|
||||
|
||||
// Check if the cell globalIdx is on neiPatch.
|
||||
// If it is, append neiPatch to list of patches to return
|
||||
if (bMesh[neiPatch].faceCells().found(localIdx))
|
||||
{
|
||||
patches.append(neiPatch);
|
||||
// Here it may be possible to append patchi and do:
|
||||
//
|
||||
// cpp.transformPosition()
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// cpp.neighbPatch().transformPosition() in getPosition()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else // celli and globalIdx on differet processors
|
||||
{
|
||||
List<label> cyclicID(3, -1);
|
||||
List<vector> separationVectors(3, vector(0,0,0));
|
||||
scalar distance = GREAT;
|
||||
|
||||
forAll(celliCyclicPatches, cID)
|
||||
{
|
||||
cyclicID[cID] = celliCyclicPatches[cID];
|
||||
|
||||
const label& patchI = celliCyclicPatches[cID];
|
||||
const cyclicPolyPatch& cpp =
|
||||
static_cast<const cyclicPolyPatch&>(bMesh[patchI]);
|
||||
|
||||
if(cpp.transform() == coupledPolyPatch::transformType::ROTATIONAL)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Rotational cyclic patches are not supported in parallel.\n"
|
||||
<< "Try to decompose the domain so that the rotational cyclic patch "
|
||||
<< "is not split in between processors."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
cpp.neighbPatch().transformPosition(separationVectors[cID], 0);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
for(int j = 0; j < 2; j++)
|
||||
{
|
||||
for(int k = 0; k < 2; k++)
|
||||
{
|
||||
vector separation = i*separationVectors[0]
|
||||
+ j*separationVectors[1]
|
||||
+ k*separationVectors[2];
|
||||
|
||||
scalar testDistance = mag
|
||||
(
|
||||
(globalIdxCellCentre - separation)
|
||||
-
|
||||
mesh_.C()[celli]
|
||||
);
|
||||
if(debug) Info << "testDistance " << testDistance << endl;
|
||||
|
||||
if( testDistance < distance )
|
||||
{
|
||||
distance = testDistance;
|
||||
patches = List<label>(0);
|
||||
List<label> applyCyclic({i,j,k});
|
||||
|
||||
if(debug) Info << "distance " << distance << endl;
|
||||
if(debug) Info << "separation " << separation << endl;
|
||||
if(debug) Info << "applyCyclic " << applyCyclic << endl;
|
||||
|
||||
for(int n = 0; n < 3; n++)
|
||||
{
|
||||
if(cyclicID[n] != -1 && applyCyclic[n] == 1)
|
||||
{
|
||||
const cyclicPolyPatch& cpp =
|
||||
static_cast<const cyclicPolyPatch&>
|
||||
(
|
||||
bMesh[cyclicID[n]]
|
||||
);
|
||||
if(debug)
|
||||
{
|
||||
Info << "cpp.name() " << cpp.name() << endl;
|
||||
}
|
||||
patches.append(cpp.neighbPatchID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return patches;
|
||||
}
|
||||
|
||||
|
||||
Foam::vector Foam::zoneDistribute::getPosition
|
||||
(
|
||||
const VolumeField<vector>& positions,
|
||||
const Map<vector>& valuesFromOtherProc,
|
||||
const label gblIdx,
|
||||
const List<label> cyclicPatchID
|
||||
) const
|
||||
{
|
||||
// Position vector, possibly from other processor, to be returned
|
||||
vector position(getValue(positions, valuesFromOtherProc, gblIdx));
|
||||
|
||||
// Dealing with position transformation across cyclic patches.
|
||||
// If no transformation is required (most cases), cyclicPatchID is empty
|
||||
forAll(cyclicPatchID, i)
|
||||
{
|
||||
const label patchi = cyclicPatchID[i];
|
||||
|
||||
const cyclicPolyPatch& cpp =
|
||||
static_cast<const cyclicPolyPatch&>
|
||||
(
|
||||
positions.mesh().boundaryMesh()[patchi]
|
||||
);
|
||||
|
||||
if (cpp.transform() != coupledPolyPatch::transformType::ROTATIONAL)
|
||||
{
|
||||
cpp.neighbPatch().transformPosition(position, 0);
|
||||
}
|
||||
else if (globalNumbering_.isLocal(gblIdx))
|
||||
{
|
||||
const label localIdx = globalNumbering_.toLocal(gblIdx);
|
||||
|
||||
for (const label facei : mesh_.cells()[localIdx])
|
||||
{
|
||||
if (mesh_.boundaryMesh().whichPatch(facei) == cyclicPatchID[i])
|
||||
{
|
||||
cpp.neighbPatch().transformPosition(position, facei);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Rotational cyclic patches are not supported in parallel.\n"
|
||||
<< "Try to decompose the domain so that the rotational cyclic"
|
||||
<< "patch is not split in between processors."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -115,6 +115,15 @@ class zoneDistribute
|
||||
//- Persistent set of exchange buffers
|
||||
PstreamBuffers pBufs_;
|
||||
|
||||
//- Cell labels for all cells with a face on a cyclic boundary
|
||||
bitSet cyclicBoundaryCells_;
|
||||
|
||||
//- Holds for each cell on cyclic patch the centres of the cells in its
|
||||
// point neighbour stencil.
|
||||
// Used in getCyclicPatches to identify neigbhour patch ID of point
|
||||
// neighbours on other side of a processorPolyPatch.
|
||||
autoPtr<Map<vectorField>> cyclicCentres_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -175,6 +184,20 @@ public:
|
||||
return globalNumbering_;
|
||||
}
|
||||
|
||||
//- Finds and returns list of all cyclic patch labels to which celli's
|
||||
// point neighbour cell, globalIdx, belongs. celli and globalIdx touch
|
||||
// in at least one point on these patches. globalIdx typically belongs
|
||||
// to stencil_[celli]. The returned label list is used to transform
|
||||
// positions across cyclic boundaries e.g. to be able to calculate
|
||||
// distances between cell centres and interface centres in plicRDF
|
||||
// across such boundaries.
|
||||
List<label> getCyclicPatches
|
||||
(
|
||||
const label celli,
|
||||
const label globalIdx,
|
||||
const vector globalIdxCellCentre
|
||||
) const;
|
||||
|
||||
//- Gives patchNumber and patchFaceNumber for a given
|
||||
//- Geometric volume field
|
||||
template<typename Type>
|
||||
@ -185,6 +208,14 @@ public:
|
||||
const label gblIdx
|
||||
) const;
|
||||
|
||||
vector getPosition
|
||||
(
|
||||
const VolumeField<vector>& positions,
|
||||
const Map<vector>& valuesFromOtherProc,
|
||||
const label gblIdx,
|
||||
const List<label> cyclicPatchID = List<label>()
|
||||
) const;
|
||||
|
||||
//- Returns stencil and provides a Map with globalNumbering
|
||||
template<typename Type>
|
||||
Map<Field<Type>> getFields
|
||||
@ -193,6 +224,17 @@ public:
|
||||
const VolumeField<Type>& phi
|
||||
);
|
||||
|
||||
//- Returns stencil and provides a Map with globalNumbering
|
||||
// Note: Not used currently (v2412) but needed for future surface
|
||||
// tension modelling.
|
||||
template<typename Type>
|
||||
Map<Field<Type>> getPositionFields
|
||||
(
|
||||
const boolList& zone,
|
||||
const VolumeField<Type>& phi,
|
||||
const bool& checkTransformation = false
|
||||
);
|
||||
|
||||
//- Returns stencil and provides a Map with globalNumbering
|
||||
template<typename Type>
|
||||
Map<Type> getDatafromOtherProc
|
||||
|
||||
@ -128,7 +128,64 @@ Foam::Map<Foam::Field<Type>> Foam::zoneDistribute::getFields
|
||||
|
||||
for (const label gblIdx : stencil_[celli])
|
||||
{
|
||||
tmpField.append(getValue(phi,neiValues,gblIdx));
|
||||
tmpField.append(getValue(phi, neiValues, gblIdx));
|
||||
}
|
||||
|
||||
stencilWithValues.emplace(celli, tmpField);
|
||||
}
|
||||
}
|
||||
|
||||
return stencilWithValues;
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
Foam::Map<Foam::Field<Type>> Foam::zoneDistribute::getPositionFields
|
||||
(
|
||||
const boolList& zone,
|
||||
const VolumeField<Type>& phi,
|
||||
const bool& checkTransformation
|
||||
)
|
||||
{
|
||||
if (zone.size() != phi.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "size of zone: " << zone.size()
|
||||
<< "size of phi:" << phi.size()
|
||||
<< "do not match. Did the mesh change?"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
// Get values from other proc
|
||||
Map<Type> neiValues = getDatafromOtherProc(zone, phi);
|
||||
|
||||
Map<Field<Type>> stencilWithValues;
|
||||
|
||||
DynamicField<Type> tmpField(128);
|
||||
|
||||
forAll(zone, celli)
|
||||
{
|
||||
if (zone[celli])
|
||||
{
|
||||
tmpField.clear();
|
||||
|
||||
for (const label gblIdx : stencil_[celli])
|
||||
{
|
||||
List<label> cyclicPatches(0);
|
||||
if(checkTransformation)
|
||||
{
|
||||
cyclicPatches = getCyclicPatches
|
||||
(
|
||||
celli,
|
||||
gblIdx,
|
||||
getValue(phi, neiValues, gblIdx)
|
||||
);
|
||||
}
|
||||
|
||||
tmpField.append
|
||||
(
|
||||
getPosition(phi, neiValues, gblIdx, cyclicPatches)
|
||||
);
|
||||
}
|
||||
|
||||
stencilWithValues.emplace(celli, tmpField);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2024 OpenCFD Ltd.
|
||||
Copyright (C) 2024-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -32,6 +32,7 @@ License
|
||||
#include "cloud.H"
|
||||
#include "foamVersion.H"
|
||||
#include "fvMesh.H"
|
||||
#include "globalMeshData.H"
|
||||
#include "IFstream.H"
|
||||
#include "stringOps.H"
|
||||
#include "substitutionModel.H"
|
||||
@ -56,7 +57,7 @@ void Foam::functionObjects::foamReport::setStaticBuiltins()
|
||||
substitutionModel::addBuiltinStr
|
||||
(
|
||||
"OF_PROC_ZERO_DIR",
|
||||
Pstream::parRun() ? "processor0" : ""
|
||||
UPstream::parRun() ? "processor0" : ""
|
||||
);
|
||||
|
||||
substitutionModel::addBuiltin("OF_API", foamVersion::api);
|
||||
@ -72,26 +73,45 @@ void Foam::functionObjects::foamReport::setStaticBuiltins()
|
||||
substitutionModel::addBuiltinStr("OF_CASE_PATH", argList::envGlobalPath());
|
||||
substitutionModel::addBuiltinStr("OF_CASE_NAME", time().globalCaseName());
|
||||
|
||||
substitutionModel::addBuiltin("OF_NPROCS", Pstream::nProcs());
|
||||
substitutionModel::addBuiltin("OF_NPROCS", UPstream::nProcs());
|
||||
|
||||
// Set mesh builtins when there is only 1 mesh
|
||||
const auto meshes = time_.lookupClass<fvMesh>();
|
||||
const auto meshes = time_.csorted<fvMesh>();
|
||||
|
||||
if (meshes.size() == 1)
|
||||
{
|
||||
const auto& mesh = *(meshes.begin().val());
|
||||
substitutionModel::addBuiltin("OF_MESH_NCELLS", mesh.nCells());
|
||||
substitutionModel::addBuiltin("OF_MESH_NFACES", mesh.nFaces());
|
||||
substitutionModel::addBuiltin("OF_MESH_NEDGES", mesh.nEdges());
|
||||
substitutionModel::addBuiltin("OF_MESH_NPOINTS", mesh.nPoints());
|
||||
const auto& mesh = meshes[0];
|
||||
|
||||
substitutionModel::addBuiltin
|
||||
(
|
||||
"OF_MESH_NCELLS",
|
||||
mesh.globalData().nTotalCells()
|
||||
);
|
||||
substitutionModel::addBuiltin
|
||||
(
|
||||
"OF_MESH_NFACES",
|
||||
mesh.globalData().nTotalFaces()
|
||||
);
|
||||
substitutionModel::addBuiltin
|
||||
(
|
||||
"OF_MESH_NEDGES",
|
||||
returnReduce(mesh.nEdges(), sumOp<label>())
|
||||
);
|
||||
substitutionModel::addBuiltin
|
||||
(
|
||||
"OF_MESH_NPOINTS",
|
||||
mesh.globalData().nTotalPoints()
|
||||
);
|
||||
substitutionModel::addBuiltin
|
||||
(
|
||||
"OF_MESH_NINTERNALFACES",
|
||||
mesh.nInternalFaces()
|
||||
returnReduce(mesh.nInternalFaces(), sumOp<label>())
|
||||
);
|
||||
substitutionModel::addBuiltin
|
||||
(
|
||||
"OF_MESH_NBOUNDARYFACES",
|
||||
mesh.nBoundaryFaces()
|
||||
// TBD: use mesh.boundaryMesh().nNonProcessorFaces() ?
|
||||
returnReduce(mesh.nBoundaryFaces(), sumOp<label>())
|
||||
);
|
||||
substitutionModel::addBuiltin
|
||||
(
|
||||
@ -123,8 +143,8 @@ void Foam::functionObjects::foamReport::setDynamicBuiltins()
|
||||
substitutionModel::setBuiltinStr("OF_DATE_NOW", clock::date());
|
||||
substitutionModel::setBuiltinStr("OF_CLOCK_NOW", clock::clockTime());
|
||||
|
||||
substitutionModel::setBuiltin("OF_NREGIONS", time().names<fvMesh>().size());
|
||||
substitutionModel::setBuiltin("OF_NCLOUDS", time().names<cloud>().size());
|
||||
substitutionModel::setBuiltin("OF_NREGIONS", time().count<fvMesh>());
|
||||
substitutionModel::setBuiltin("OF_NCLOUDS", time().count<cloud>());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3262,6 +3262,10 @@ void Foam::snappySnapDriver::doSnap
|
||||
|
||||
// Update mesh mover
|
||||
ppPtr = meshRefinement::makePatch(mesh, adaptPatchIDs);
|
||||
|
||||
// Update distance to attract to nearest feature on surface
|
||||
snapDist = calcSnapDistance(mesh, snapParams, ppPtr());
|
||||
|
||||
meshMoverPtr.reset
|
||||
(
|
||||
new motionSmoother
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2007-2023 PCOpt/NTUA
|
||||
Copyright (C) 2013-2023 FOSS GP
|
||||
Copyright (C) 2007-2025 PCOpt/NTUA
|
||||
Copyright (C) 2013-2025 FOSS GP
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -118,11 +118,11 @@ scalar objectiveUniformityCellZone::J()
|
||||
const volVectorField& U = vars_.UInst();
|
||||
const scalarField& V = mesh_.V().field();
|
||||
|
||||
for (const label zI : zones_)
|
||||
forAll(zones_, zI)
|
||||
{
|
||||
const cellZone& zoneI = mesh_.cellZones()[zI];
|
||||
scalarField VZone(V, zoneI);
|
||||
vectorField UZone(U.primitiveField(), zoneI);
|
||||
const cellZone& cz = mesh_.cellZones()[zones_[zI]];
|
||||
scalarField VZone(V, cz);
|
||||
vectorField UZone(U.primitiveField(), cz);
|
||||
volZone_[zI] = gSum(VZone);
|
||||
UMean_[zI] = gSum(UZone*VZone)/volZone_[zI];
|
||||
UVar_[zI] = gSum(magSqr(UZone - UMean_[zI])*VZone)/volZone_[zI];
|
||||
@ -138,10 +138,10 @@ void objectiveUniformityCellZone::update_dJdv()
|
||||
{
|
||||
const volVectorField& U = vars_.U();
|
||||
|
||||
for (const label zI : zones_)
|
||||
forAll(zones_, zI)
|
||||
{
|
||||
const cellZone& zoneI = mesh_.cellZones()[zI];
|
||||
for (const label cellI : zoneI)
|
||||
const cellZone& cz = mesh_.cellZones()[zones_[zI]];
|
||||
for (const label cellI : cz)
|
||||
{
|
||||
dJdvPtr_()[cellI] = (U[cellI] - UMean_[zI])/volZone_[zI];
|
||||
}
|
||||
@ -154,10 +154,10 @@ void objectiveUniformityCellZone::update_divDxDbMultiplier()
|
||||
volScalarField& divDxDbMult = divDxDbMultPtr_();
|
||||
const volVectorField& U = vars_.U();
|
||||
|
||||
for (const label zI : zones_)
|
||||
forAll(zones_, zI)
|
||||
{
|
||||
const cellZone& zoneI = mesh_.cellZones()[zI];
|
||||
for (const label cellI : zoneI)
|
||||
const cellZone& cz = mesh_.cellZones()[zones_[zI]];
|
||||
for (const label cellI : cz)
|
||||
{
|
||||
divDxDbMult[cellI] =
|
||||
0.5*(magSqr(U[cellI] - UMean_[zI]) - UVar_[zI])/volZone_[zI];
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments -no-recursion "$@"
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
set -- -no-recursion "$@" # Parse arguments only
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/have_scotch
|
||||
|
||||
|
||||
@ -306,8 +306,8 @@ void Foam::processorMeshes::removeFiles(const polyMesh& mesh)
|
||||
// pointMesh/boundary
|
||||
fileHandler().rm(fileHandler().filePath(pointIO.objectPath()));
|
||||
|
||||
// boundaryProcAddressing
|
||||
io.rename("boundaryProcAddressing");
|
||||
// pointMesh/boundaryProcAddressing
|
||||
pointIO.rename("boundaryProcAddressing");
|
||||
fileHandler().rm(fileHandler().filePath(pointIO.objectPath()));
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "hyperbolic.H"
|
||||
#include "hyperbolicBlendingMethod.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -29,12 +29,12 @@ Class
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
hyperbolic.C
|
||||
hyperbolicBlendingMethod.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef hyperbolic_H
|
||||
#define hyperbolic_H
|
||||
#ifndef Foam_blendingMethod_hyperbolic_H
|
||||
#define Foam_blendingMethod_hyperbolic_H
|
||||
|
||||
#include "blendingMethod.H"
|
||||
|
||||
@ -39,9 +39,9 @@ $(binaryBreakup)/powerLawUniformBinary/powerLawUniformBinary.C
|
||||
|
||||
breakup = populationBalanceModel/breakupModels
|
||||
$(breakup)/breakupModel/breakupModel.C
|
||||
$(breakup)/exponential/exponential.C
|
||||
$(breakup)/exponential/exponentialBreakup.C
|
||||
$(breakup)/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.C
|
||||
$(breakup)/powerLaw/powerLaw.C
|
||||
$(breakup)/powerLaw/powerLawBreakup.C
|
||||
|
||||
daughterSize = populationBalanceModel/daughterSizeDistributionModels
|
||||
$(daughterSize)/daughterSizeDistributionModel/daughterSizeDistributionModel.C
|
||||
@ -63,7 +63,7 @@ blending = BlendedInterfacialModel/blendingMethods
|
||||
$(blending)/blendingMethod/blendingMethod.C
|
||||
$(blending)/noBlending/noBlending.C
|
||||
$(blending)/linear/linearBlendingMethod.C
|
||||
$(blending)/hyperbolic/hyperbolic.C
|
||||
$(blending)/hyperbolic/hyperbolicBlendingMethod.C
|
||||
|
||||
|
||||
interfacialModels/wallDependentModel/wallDependentModel.C
|
||||
@ -224,7 +224,7 @@ $(TDNBModels)/Shirai/Shirai.C
|
||||
nucleateFluxModels = $(wallBoilingSubModels)/nucleateFluxModels
|
||||
$(nucleateFluxModels)/nucleateFluxModel/nucleateFluxModel.C
|
||||
$(nucleateFluxModels)/Kutadeladze/Kutadeladze.C
|
||||
$(nucleateFluxModels)/exponential/exponential.C
|
||||
$(nucleateFluxModels)/exponential/exponentialNucleateFlux.C
|
||||
|
||||
/* Turbulence */
|
||||
turbulence/multiphaseCompressibleTurbulenceModels.C
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "exponential.H"
|
||||
#include "exponentialNucleateFlux.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
#include "phasePairKey.H"
|
||||
@ -67,12 +67,12 @@ Usage
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
exponential.C
|
||||
exponentialNucleateFlux.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef exponential_H
|
||||
#define exponential_H
|
||||
#ifndef Foam_wallBoiling_nucleateFlux_exponential_H
|
||||
#define Foam_wallBoiling_nucleateFlux_exponential_H
|
||||
|
||||
#include "nucleateFluxModel.H"
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "exponential.H"
|
||||
#include "exponentialBreakup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -31,12 +31,12 @@ Description
|
||||
formulation implemented in the populationBalanceModel class.
|
||||
|
||||
SourceFiles
|
||||
exponential.C
|
||||
exponentialBreakup.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef exponential_H
|
||||
#define exponential_H
|
||||
#ifndef Foam_diameterModels_breakup_exponential_H
|
||||
#define Foam_diameterModels_breakup_exponential_H
|
||||
|
||||
#include "breakupModel.H"
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "powerLaw.H"
|
||||
#include "powerLawBreakup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -31,12 +31,12 @@ Description
|
||||
formulation implemented in the populationBalanceModel class.
|
||||
|
||||
SourceFiles
|
||||
powerLaw.C
|
||||
powerLawBreakup.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef powerLaw_H
|
||||
#define powerLaw_H
|
||||
#ifndef Foam_diameterModels_breakup_powerLaw_H
|
||||
#define Foam_diameterModels_breakup_powerLaw_H
|
||||
|
||||
#include "breakupModel.H"
|
||||
|
||||
@ -3,7 +3,7 @@ pyrolysisModel/pyrolysisModel.C
|
||||
pyrolysisModel/pyrolysisModelNew.C
|
||||
reactingOneDim/reactingOneDim.C
|
||||
noPyrolysis/noPyrolysis.C
|
||||
thermo/thermo.C
|
||||
thermo/thermoPyrolysis.C
|
||||
pyrolysisModel/pyrolysisModelCollection.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libpyrolysisModels
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "thermo.H"
|
||||
#include "thermoPyrolysis.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
#include "absorptionEmissionModel.H"
|
||||
@ -30,12 +30,12 @@ Description
|
||||
Pyrolysis model which solves only the energy equation in the region.
|
||||
|
||||
SourceFiles
|
||||
thermo.C
|
||||
thermoPyrolysis.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionModels_pyrolysisModels_thermo_H
|
||||
#define regionModels_pyrolysisModels_thermo_H
|
||||
#ifndef Foam_regionModels_pyrolysisModels_thermo_H
|
||||
#define Foam_regionModels_pyrolysisModels_thermo_H
|
||||
|
||||
#include "pyrolysisModel.H"
|
||||
#include "volFieldsFwd.H"
|
||||
@ -39,6 +39,9 @@ License
|
||||
|
||||
// Flex may use register, which is deprecated and incompatible with C++17
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
// A 'nothing' define to effectively remove from code as well (issue #3337)
|
||||
#undef register
|
||||
#define register
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -260,7 +260,7 @@ const Foam::volScalarField& Foam::reconstructedDistanceFunction::constructRDF
|
||||
const labelListList& stencil = distribute.getStencil();
|
||||
|
||||
|
||||
forAll(nextToInterface,celli)
|
||||
forAll(nextToInterface, celli)
|
||||
{
|
||||
if (nextToInterface[celli])
|
||||
{
|
||||
@ -282,9 +282,28 @@ const Foam::volScalarField& Foam::reconstructedDistanceFunction::constructRDF
|
||||
if (mag(n) != 0)
|
||||
{
|
||||
n /= mag(n);
|
||||
vector c = distribute.getValue(centre,mapCentres,gblIdx);
|
||||
vector distanceToIntSeg = (c - p);
|
||||
scalar distToSurf = distanceToIntSeg & (n);
|
||||
vector c
|
||||
(
|
||||
distribute.getPosition
|
||||
(
|
||||
centre,
|
||||
mapCentres,
|
||||
gblIdx,
|
||||
distribute.getCyclicPatches
|
||||
(
|
||||
celli,
|
||||
gblIdx,
|
||||
distribute.getValue
|
||||
(
|
||||
centre,
|
||||
mapCentres,
|
||||
gblIdx
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
vector distanceToIntSeg(c - p);
|
||||
scalar distToSurf = distanceToIntSeg & n;
|
||||
scalar weight = 0;
|
||||
|
||||
if (mag(distanceToIntSeg) != 0)
|
||||
@ -332,14 +351,37 @@ const Foam::volScalarField& Foam::reconstructedDistanceFunction::constructRDF
|
||||
forAll(stencil[pCellI], j)
|
||||
{
|
||||
const label gblIdx = stencil[pCellI][j];
|
||||
vector n = -distribute.getValue(normal, mapNormal, gblIdx);
|
||||
vector n = -distribute.getValue
|
||||
(
|
||||
normal,
|
||||
mapNormal,
|
||||
gblIdx
|
||||
);
|
||||
if (mag(n) != 0)
|
||||
{
|
||||
n /= mag(n);
|
||||
vector c =
|
||||
distribute.getValue(centre, mapCentres, gblIdx);
|
||||
vector distanceToIntSeg = (c - p);
|
||||
scalar distToSurf = distanceToIntSeg & (n);
|
||||
vector c
|
||||
(
|
||||
distribute.getPosition
|
||||
(
|
||||
centre,
|
||||
mapCentres,
|
||||
gblIdx,
|
||||
distribute.getCyclicPatches
|
||||
(
|
||||
pCellI,
|
||||
gblIdx,
|
||||
distribute.getValue
|
||||
(
|
||||
centre,
|
||||
mapCentres,
|
||||
gblIdx
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
vector distanceToIntSeg(c - p);
|
||||
scalar distToSurf = distanceToIntSeg & n;
|
||||
scalar weight = 0;
|
||||
|
||||
if (mag(distanceToIntSeg) != 0)
|
||||
|
||||
@ -96,8 +96,21 @@ void Foam::reconstruction::plicRDF::interpolateNormal()
|
||||
if (mag(n) != 0)
|
||||
{
|
||||
n /= mag(n);
|
||||
vector centre =
|
||||
exchangeFields.getValue(centre_, mapCentre, gblIdx);
|
||||
vector centre
|
||||
(
|
||||
exchangeFields.getPosition
|
||||
(
|
||||
centre_,
|
||||
mapCentre,
|
||||
gblIdx,
|
||||
exchangeFields.getCyclicPatches
|
||||
(
|
||||
celli,
|
||||
gblIdx,
|
||||
exchangeFields.getValue(mesh_.C(), mapCC, gblIdx)
|
||||
)
|
||||
)
|
||||
);
|
||||
vector distanceToIntSeg = (tensor::I- n*n) & (p - centre);
|
||||
estimatedNormal += n /max(mag(distanceToIntSeg), SMALL);
|
||||
weight += 1/max(mag(distanceToIntSeg), SMALL);
|
||||
@ -146,7 +159,16 @@ void Foam::reconstruction::plicRDF::interpolateNormal()
|
||||
const label gblIdx = stencil[celli][i];
|
||||
cellCentre.append
|
||||
(
|
||||
exchangeFields.getValue(mesh_.C(), mapCC, gblIdx)
|
||||
exchangeFields.getPosition
|
||||
(
|
||||
mesh_.C(), mapCC, gblIdx,
|
||||
exchangeFields.getCyclicPatches
|
||||
(
|
||||
celli,
|
||||
gblIdx,
|
||||
exchangeFields.getValue(mesh_.C(), mapCC, gblIdx)
|
||||
)
|
||||
)
|
||||
);
|
||||
alphaValues.append
|
||||
(
|
||||
@ -193,7 +215,16 @@ void Foam::reconstruction::plicRDF::gradSurf(const volScalarField& phi)
|
||||
{
|
||||
cellCentre.append
|
||||
(
|
||||
exchangeFields.getValue(mesh_.C(), mapCC, gblIdx)
|
||||
exchangeFields.getPosition
|
||||
(
|
||||
mesh_.C(), mapCC, gblIdx,
|
||||
exchangeFields.getCyclicPatches
|
||||
(
|
||||
celli,
|
||||
gblIdx,
|
||||
exchangeFields.getValue(mesh_.C(), mapCC, gblIdx)
|
||||
)
|
||||
)
|
||||
);
|
||||
phiValues.append
|
||||
(
|
||||
|
||||
@ -5,4 +5,6 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
cleanCase0
|
||||
|
||||
rm -f Phase1
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -5,10 +5,20 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
restore0Dir
|
||||
|
||||
touch case.foam
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication setAlphaField
|
||||
|
||||
runApplication $(getApplication)
|
||||
runApplication decomposePar
|
||||
|
||||
runParallel $(getApplication)
|
||||
|
||||
grep "Phase-1" log.$(getApplication) | cut -d' ' -f5 > Phase1
|
||||
|
||||
echo "Volume conservation:"
|
||||
echo "Initial Phase-1: " $(head -1 Phase1)
|
||||
echo "Final Phase-1 : " $(tail -1 Phase1)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -35,7 +35,7 @@ purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 6;
|
||||
writePrecision 12;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
|
||||
@ -24,5 +24,13 @@ coeffs
|
||||
n ( 2 1 2 );
|
||||
}
|
||||
|
||||
constraints
|
||||
{
|
||||
preservePatches
|
||||
{
|
||||
type preservePatches;
|
||||
patches (left right top bottom);
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -22,10 +22,10 @@ solvers
|
||||
{
|
||||
isoFaceTol 1e-6;
|
||||
surfCellTol 1e-6;
|
||||
snapTol 1e-10;
|
||||
snapTol 0;
|
||||
nAlphaBounds 3;
|
||||
clip true;
|
||||
reconstructionScheme isoAlpha; // isoAlpha
|
||||
clip false;
|
||||
reconstructionScheme plicRDF;
|
||||
|
||||
nAlphaSubCycles 1;
|
||||
cAlpha 1; // Read but not used by interIsoFoam
|
||||
|
||||
@ -1 +0,0 @@
|
||||
include $(GENERAL_RULES)/cgal
|
||||
@ -12,7 +12,7 @@ ptFLAGS := -DNoRepository
|
||||
|
||||
c++WARN = \
|
||||
-Wall -Wextra \
|
||||
--diag_suppress=111,128,177,185,612,998,1098 \
|
||||
--diag_suppress=111,128,177,185,612,998,1098,1428 \
|
||||
--display_error_number
|
||||
|
||||
# Less restrictive warnings (eg, for flex++, CGAL, etc.)
|
||||
@ -34,5 +34,6 @@ sinclude $(GENERAL_RULES)/common/c++$(WM_COMPILE_OPTION)
|
||||
#612-D: overloaded virtual function ... is only partially overridden
|
||||
#998-D: function XX is hidden by YY -- virtual function override intended?
|
||||
#1098-D: unknown attribute "fallthrough"
|
||||
#1428-D: [offset_in_non_POD_nonstandard]
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
c++DBUG =
|
||||
c++OPT = -ffp-contract=fast -ffast-math -O3 -funsafe-math-optimizations -fsimdmath -armpl
|
||||
c++OPT = -ffp-contract=fast -ffast-math -O3 -funsafe-math-optimizations -armpl
|
||||
|
||||
Reference in New Issue
Block a user