Compare commits

...

25 Commits

Author SHA1 Message Date
39362aec25 CONFIG: bump patch level (240625) 2024-06-26 11:18:36 +02:00
fb365b6622 BUG: Nastran reading of free format truncates last field (fixes #3189)
- the old logic relied on the presence/absence of a comma to decide
  whether to parse as fixed or free format. This logic is faulty when
  handling the final (trailing) entry and will generally lead to the
  last field being truncated when read in.
  Now the caller decides on fixed vs free.

FIX: inconsistent Nastran surface output format

- use FREE format by default. Previously had an odd mix of SHORT
  format when created without options and LONG format (as default)
  when created with format options.
2024-06-26 11:06:05 +02:00
530a5192ca Merge branch 'fix-adjointRotatingWall-sens' into 'master'
BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180

Closes #3180

See merge request Development/openfoam!690
2024-06-11 10:39:58 +00:00
2ef96e9e43 BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180 2024-06-10 14:52:58 +03:00
51a34f5abc BUG: ThermoSurfaceFilm - corrected FA field caching for Cp. Fixes #3017 2024-06-07 20:47:35 +01:00
b2532e7769 BUG: extractEulerianParticles - corrected patch index. Fixes #2707 2024-06-07 12:26:03 +01:00
790de0f98e BUG: gltf corrections. Fixes #3179
- corrected scalar bounds (label->scalar), field limit initialisation
- corrected alpha field lookup
- updated header documentation
2024-06-07 12:25:32 +01:00
4510067e63 CONFIG: bump patch level 2024-05-22 16:26:39 +02:00
8cf757daf0 BUG: GAMG: processorAgglomeration not merging proc coeffs. Fixes #3172 2024-05-22 16:26:39 +02:00
6581c5792a BUG: STL: cannot handle files > 2Gb. Fixes #3171 2024-05-22 16:25:37 +02:00
0ef7589979 BUG: sampledMeshSurface sampling on "empty" patch fails
- requires a field size check when copying into the flat boundary
2024-05-02 10:24:28 +02:00
e651d63566 ENH: cyclicAMI - clear finished send/recv requests 2024-03-18 17:00:34 +01:00
119dd84327 CONFIG: bump patch level 2024-02-20 14:58:28 +01:00
08df023808 BUG: fvSchemes/fvSolution not properly updated on copy from fallback 2024-02-20 14:58:03 +01:00
a9b451b3e4 SUBMODULE: re-enable turbulence-community build
- compilation issues caused by hidden python dependency now alleviated
2024-02-13 09:31:38 +01:00
852f66fc11 CONFIG: add user/group libraries into path separately (#2948)
- on Darwin _foamAddLib() also checks the library path existence
  so passing in "path1:path2" together fails.
2024-02-06 22:16:22 +01:00
08c23685c3 BUG: incorrect cumulative area in triangulatedPatch (fixes #3097)
BUG: bad processor selection. Failed to select anything on non-master
2024-02-06 11:02:26 +01:00
d9c5a5d1a9 BUG: mapped: register to current, not other mesh. See #2723 2024-02-01 13:14:09 +00:00
ebe49d4cbd BUG: SlicedGeometricField, slices into field instead of shallow copy (#3080)
- regression introduced by e98acdc4fc

  Affected versions: (v2206, v2212, v2306, v2312)
2024-01-19 18:06:38 +01:00
62524b140c BUG: protected division - fixes #3084 2024-01-15 15:10:24 +00:00
a46b310fa4 COMP: g++11: suppress optimisation. See #3024 2024-01-08 14:30:06 +01:00
1dc216eb1f TUT: Corrected references to mut - related to #3057 2024-01-03 09:55:44 +00:00
c4328296b0 TUT: Corrected legacy muTilda -> nuTilda. Fixes 3057 2024-01-03 09:43:23 +00:00
52ab1fc06f TUT: changes in optimisation tutorials
- shape optimisation: SQP failed due to wrong divScheme for the adjoint
  equations
- shape optimisation: tutorials designed to show the impact of different flow
  conditions were actually using the same U
- topology optimisation: tutorials designed to show the impact of the
  flow rate distribution were actually using the same target
  fractions
- topology optimisation: updated old fvSolution syntax
2024-01-02 12:03:21 +00:00
58787bb166 COMP: avoid ambiguous max() call on MacOS (fixes #3066)
- had max(std::streamsize, label) but this does not resolve properly
  on OSX, so write out in long form instead.

  The similar logic in DynamicList is okay since there it compares
  max(label, label) instead
2023-12-22 15:10:49 +01:00
50 changed files with 729 additions and 475 deletions

View File

@ -1,2 +1,2 @@
api=2312
patch=0
patch=240625

View File

@ -197,8 +197,8 @@ if ( "$FOAM_MPI" != dummy ) then
_foamAddLib "${FOAM_LIBBIN}/${FOAM_MPI}"
endif
# OpenFOAM user, group libraries
_foamAddLib "${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}"
_foamAddLib "$FOAM_SITE_LIBBIN" # OpenFOAM group libraries
_foamAddLib "$FOAM_USER_LIBBIN" # OpenFOAM user libraries
if ( -d "$WM_PROJECT_DIR/doc/man1" ) then
_foamAddMan "$WM_PROJECT_DIR/doc"

View File

@ -229,8 +229,8 @@ then
_foamAddLib "$FOAM_LIBBIN/$FOAM_MPI"
fi
# OpenFOAM user, group libraries
_foamAddLib "$FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN"
_foamAddLib "$FOAM_SITE_LIBBIN" # OpenFOAM group libraries
_foamAddLib "$FOAM_USER_LIBBIN" # OpenFOAM user libraries
if [ -d "$WM_PROJECT_DIR/doc/man1" ]
then

View File

@ -519,7 +519,8 @@ public:
if (newCapacity < len)
{
// Increase capacity (doubling)
newCapacity = max(len, label(2*storage_.size()));
newCapacity =
Foam::max(label(len), label(2*storage_.size()));
}
// Info<<"request:" << len

View File

@ -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]);
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
Copyright (C) 2023-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -310,13 +310,7 @@ void Foam::GAMGSolver::gatherMatrices
const auto& boundaryMap = agglomeration_.boundaryMap(destLevel);
// Use PstreamBuffers
PstreamBuffers pBufs
(
UPstream::commsTypes::nonBlocking,
UPstream::msgType(),
comm
);
PstreamBuffers pBufs(comm);
// Send to master
if (!UPstream::master(comm))
@ -332,35 +326,49 @@ void Foam::GAMGSolver::gatherMatrices
const label proci = UPstream::myProcNo(comm);
labelList validInterface(interfaces.size(), -1);
// All interfaceBouCoeffs need to be sent across
bitSet validCoeffs(interfaces.size());
forAll(interfaceBouCoeffs, intI)
{
if (interfaceBouCoeffs.set(intI))
{
validCoeffs.set(intI);
}
}
// Only preserved interfaces need to be sent across
bitSet validInterface(interfaces.size());
forAll(interfaces, intI)
{
const label allIntI = boundaryMap[proci][intI];
if (interfaces.set(intI) && allIntI != -1)
{
validInterface[intI] = intI;
validInterface.set(intI);
}
}
UOPstream toMaster(UPstream::masterNo(), pBufs);
toMaster<< mat << token::SPACE << validInterface;
toMaster
<< mat
<< token::SPACE << validCoeffs
<< token::SPACE << validInterface;
forAll(validInterface, intI)
for (const label intI : validCoeffs)
{
if (validInterface[intI] != -1)
{
const auto& interface = refCast<const GAMGInterfaceField>
(
interfaces[intI]
);
toMaster
<< interfaceBouCoeffs[intI]
<< interfaceIntCoeffs[intI];
}
for (const label intI : validInterface)
{
const auto& interface = refCast<const GAMGInterfaceField>
(
interfaces[intI]
);
toMaster
<< interfaceBouCoeffs[intI]
<< interfaceIntCoeffs[intI]
<< interface.type();
interface.write(toMaster);
}
toMaster << interface.type();
interface.write(toMaster);
}
}
@ -376,10 +384,10 @@ void Foam::GAMGSolver::gatherMatrices
lduInterfacePtrsList destInterfaces = destMesh.interfaces();
// Master.
otherMats.setSize(nProcs-1);
otherBouCoeffs.setSize(nProcs-1);
otherIntCoeffs.setSize(nProcs-1);
otherInterfaces.setSize(nProcs-1);
otherMats.resize(nProcs-1);
otherBouCoeffs.resize(nProcs-1);
otherIntCoeffs.resize(nProcs-1);
otherInterfaces.resize(nProcs-1);
for (const int proci : UPstream::subProcs(comm))
{
@ -389,60 +397,41 @@ void Foam::GAMGSolver::gatherMatrices
otherMats.set(otherI, new lduMatrix(destMesh, fromProc));
// Receive number of/valid interfaces
// >= 0 : remote interface index
// -1 : invalid interface
const labelList validInterface(fromProc);
// Receive bit-sets of valid interfaceCoeffs/interfaces
const bitSet validCoeffs(fromProc);
const bitSet validInterface(fromProc);
otherBouCoeffs.set
(
otherI,
new FieldField<Field, scalar>(validInterface.size())
);
otherIntCoeffs.set
(
otherI,
new FieldField<Field, scalar>(validInterface.size())
);
otherInterfaces.set
(
otherI,
new PtrList<lduInterfaceField>(validInterface.size())
);
otherBouCoeffs.emplace_set(otherI, validCoeffs.size());
otherIntCoeffs.emplace_set(otherI, validCoeffs.size());
otherInterfaces.emplace_set(otherI, validInterface.size());
forAll(validInterface, intI)
// Receive individual interface contributions
for (const label intI : validCoeffs)
{
if (validInterface[intI] != -1)
{
otherBouCoeffs[otherI].set
(
intI,
new scalarField(fromProc)
);
otherIntCoeffs[otherI].set
(
intI,
new scalarField(fromProc)
);
otherBouCoeffs[otherI].emplace_set(intI, fromProc);
otherIntCoeffs[otherI].emplace_set(intI, fromProc);
}
const word coupleType(fromProc);
// Receive individual interface contributions
for (const label intI : validInterface)
{
const word coupleType(fromProc);
const label allIntI = boundaryMap[proci][intI];
const label allIntI = boundaryMap[proci][intI];
otherInterfaces[otherI].set
otherInterfaces[otherI].set
(
intI,
GAMGInterfaceField::New
(
intI,
GAMGInterfaceField::New
coupleType,
refCast<const GAMGInterface>
(
coupleType,
refCast<const GAMGInterface>
(
destInterfaces[allIntI]
),
fromProc
).release()
);
}
destInterfaces[allIntI]
),
fromProc
).release()
);
}
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -133,7 +133,7 @@ Foam::schemesLookup::schemesLookup
obr.time().system(),
obr,
rOpt,
IOobject::NO_WRITE
IOobjectOption::NO_WRITE
),
fallback
),
@ -153,18 +153,23 @@ Foam::schemesLookup::schemesLookup
fluxRequiredDefault_(false),
steady_(false)
{
// Treat as MUST_READ_IF_MODIFIED whenever possible
// Treat as READ_MODIFIED whenever possible
if
(
readOpt() == IOobject::MUST_READ
readOpt() == IOobjectOption::MUST_READ
|| (isReadOptional() && headerOk())
)
{
readOpt(IOobject::MUST_READ_IF_MODIFIED);
readOpt(IOobjectOption::READ_MODIFIED);
addWatch();
}
if (readOpt() == IOobject::MUST_READ_IF_MODIFIED)
// Update: from values read or copied in
if
(
readOpt() == IOobjectOption::READ_MODIFIED
|| !dictionary::empty()
)
{
read(selectedDict());
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -174,7 +174,7 @@ Foam::solution::solution
obr.time().system(),
obr,
rOpt,
IOobject::NO_WRITE
IOobjectOption::NO_WRITE
),
fallback
),
@ -184,18 +184,23 @@ Foam::solution::solution
eqnRelaxDict_(),
solvers_()
{
// Treat as MUST_READ_IF_MODIFIED whenever possible
// Treat as READ_MODIFIED whenever possible
if
(
readOpt() == IOobject::MUST_READ
readOpt() == IOobjectOption::MUST_READ
|| (isReadOptional() && headerOk())
)
{
readOpt(IOobject::MUST_READ_IF_MODIFIED);
readOpt(IOobjectOption::READ_MODIFIED);
addWatch();
}
if (readOpt() == IOobject::MUST_READ_IF_MODIFIED)
// Update: from values read or copied in
if
(
readOpt() == IOobjectOption::READ_MODIFIED
|| !dictionary::empty()
)
{
read(selectedDict());
}

View File

@ -123,13 +123,13 @@ bool Foam::polyMesh::checkFaceOrthogonality
reduce(severeNonOrth, sumOp<label>());
reduce(errorNonOrth, sumOp<label>());
const scalar maxNonOrth = radToDeg(::acos(clamp(minDDotS, -1, 1)));
const scalar aveNonOrth = radToDeg(::acos(clamp(sumDDotS/nSummed, -1, 1)));
dictionary& meshDict = const_cast<dictionary&>(data().meshDict());
if (nSummed > 0)
{
scalar maxNonOrth = radToDeg(::acos(clamp(minDDotS, -1, 1)));
scalar aveNonOrth = radToDeg(::acos(clamp(sumDDotS/nSummed, -1, 1)));
meshDict.set("maxNonOrth", maxNonOrth);
meshDict.set("aveNonOrth", aveNonOrth);

View File

@ -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)
{

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2023 OpenCFD Ltd.
Copyright (C) 2017-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -136,7 +136,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;
@ -144,15 +145,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);
}
@ -249,8 +258,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

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2023 OpenCFD Ltd.
Copyright (C) 2017-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -47,7 +47,6 @@ SourceFiles
namespace Foam
{
namespace fileFormats
{
@ -79,18 +78,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
@ -98,18 +97,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
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2023 OpenCFD Ltd.
Copyright (C) 2016-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -61,6 +61,36 @@ static bool startsWithSolid(const char header[STLHeaderSize])
}
// Check if file size appears to be reasonable for an STL binary file.
// Compare file size with that expected from number of tris
// If this is not sensible, it may be an ASCII file
//
// sizeof(STLtriangle) = 50 bytes [int16 + 4 * (3 float)]
inline static bool checkBinaryFileSize
(
const int64_t nTris,
const Foam::fileName& file
)
{
// When checking the content size, account for the header size (80),
// but ignore the nTris information (int32_t) to give some rounding
const int64_t contentSize =
(
int64_t(Foam::fileSize(file))
- int64_t(STLHeaderSize)
);
return
(
(contentSize >= 0)
&& (nTris >= contentSize/50)
&& (nTris <= contentSize/25)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fileFormats::STLCore::isBinaryName
@ -117,31 +147,31 @@ int Foam::fileFormats::STLCore::detectBinaryHeader
// Read the number of triangles in the STL file
// (note: read as signed so we can check whether >2^31)
// (note: read as signed int so we can check whether >2^31).
//
// With nTris == 2^31, file size is 107.37 GB !
//
// However, the limit is more likely caused by the number of points
// that can be stored (label-size=32) when flattened for merging.
// So more like 715.8M triangles (~35.8 GB)
int32_t nTris;
is.read(reinterpret_cast<char*>(&nTris), sizeof(int32_t));
// Check that stream is OK and number of triangles is positive,
// if not this may be an ASCII file
bool ok = (is && nTris >= 0);
bool bad = (!is || nTris < 0);
if (!bad && unCompressed)
if (ok && unCompressed)
{
// Compare file size with that expected from number of tris
// If this is not sensible, it may be an ASCII file
const off_t dataFileSize = Foam::fileSize(filename);
bad =
(
nTris < int(dataFileSize - STLHeaderSize)/50
|| nTris > int(dataFileSize - STLHeaderSize)/25
);
ok = checkBinaryFileSize(nTris, filename);
}
//if (ok)
//{
// InfoErr<< "stlb : " << nTris << " triangles" << nl;
//}
// Return number of triangles if it appears to be BINARY and good.
return (bad ? 0 : nTris);
return (ok ? nTris : 0);
}
@ -189,31 +219,27 @@ Foam::fileFormats::STLCore::readBinaryHeader
<< exit(FatalError);
}
// Read the number of triangles in the STl file
// (note: read as int so we can check whether >2^31)
// Read the number of triangles in the STL file
// (note: read as signed int so we can check whether >2^31).
//
// With nTris == 2^31, file size is 107.37 GB !
//
// However, the limit is more likely caused by the number of points
// that can be stored (label-size=32) when flattened for merging.
// So more like 715.8M triangles (~35.8 GB)
int32_t nTris;
is.read(reinterpret_cast<char*>(&nTris), sizeof(int32_t));
// Check that stream is OK and number of triangles is positive,
// if not this maybe an ASCII file
bool ok = (is && nTris >= 0);
bool bad = (!is || nTris < 0);
if (!bad && unCompressed)
if (ok && unCompressed)
{
// Compare file size with that expected from number of tris
// If this is not sensible, it may be an ASCII file
const off_t dataFileSize = Foam::fileSize(filename);
bad =
(
nTris < int(dataFileSize - STLHeaderSize)/50
|| nTris > int(dataFileSize - STLHeaderSize)/25
);
ok = checkBinaryFileSize(nTris, filename);
}
if (bad)
if (!ok)
{
FatalErrorInFunction
<< "problem reading number of triangles, perhaps file is not binary"

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -444,7 +444,14 @@ void Foam::cyclicACMIFvPatchField<Type>::initEvaluate
<< " starting send&receive"
<< endl;
if (!this->ready())
// Bypass polyPatch to get nbrId.
// - use cyclicACMIFvPatch::neighbPatch() virtual instead
const cyclicACMIFvPatch& neighbPatch = cyclicACMIPatch_.neighbPatch();
const labelUList& nbrFaceCells = neighbPatch.faceCells();
const Field<Type> pnf(this->primitiveField(), nbrFaceCells);
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
@ -453,11 +460,8 @@ void Foam::cyclicACMIFvPatchField<Type>::initEvaluate
<< abort(FatalError);
}
// By-pass polyPatch to get nbrId. Instead use cyclicACMIFvPatch virtual
// neighbPatch()
const cyclicACMIFvPatch& neighbPatch = cyclicACMIPatch_.neighbPatch();
const labelUList& nbrFaceCells = neighbPatch.faceCells();
const Field<Type> pnf(this->primitiveField(), nbrFaceCells);
// Assume that sends are also OK
sendRequests_.clear();
cyclicACMIPatch_.initInterpolate
(
@ -515,6 +519,10 @@ void Foam::cyclicACMIFvPatchField<Type>::evaluate
).ptr()
);
// Receive requests all handled by last function call
recvRequests_.clear();
auto& patchNeighbourField = patchNeighbourFieldPtr_.ref();
if (doTransform())
@ -559,7 +567,16 @@ void Foam::cyclicACMIFvPatchField<Type>::initInterfaceMatrixUpdate
<< " starting send&receive"
<< endl;
if (!this->ready())
const labelUList& nbrFaceCells =
lduAddr.patchAddr(cyclicACMIPatch_.neighbPatchID());
solveScalarField pnf(psiInternal, nbrFaceCells);
// Transform according to the transformation tensors
transformCoupleField(pnf, cmpt);
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
@ -568,13 +585,8 @@ void Foam::cyclicACMIFvPatchField<Type>::initInterfaceMatrixUpdate
<< abort(FatalError);
}
const labelUList& nbrFaceCells =
lduAddr.patchAddr(cyclicACMIPatch_.neighbPatchID());
solveScalarField pnf(psiInternal, nbrFaceCells);
// Transform according to the transformation tensors
transformCoupleField(pnf, cmpt);
// Assume that sends are also OK
sendRequests_.clear();
cyclicACMIPatch_.initInterpolate
(
@ -635,6 +647,9 @@ void Foam::cyclicACMIFvPatchField<Type>::updateInterfaceMatrix
recvRequests_,
scalarRecvBufs_
);
// Receive requests all handled by last function call
recvRequests_.clear();
}
else
{
@ -676,7 +691,16 @@ void Foam::cyclicACMIFvPatchField<Type>::initInterfaceMatrixUpdate
<< exit(FatalError);
}
if (!this->ready())
const labelUList& nbrFaceCells =
lduAddr.patchAddr(cyclicACMIPatch_.neighbPatchID());
Field<Type> pnf(psiInternal, nbrFaceCells);
// Transform according to the transformation tensors
transformCoupleField(pnf);
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
@ -685,13 +709,8 @@ void Foam::cyclicACMIFvPatchField<Type>::initInterfaceMatrixUpdate
<< abort(FatalError);
}
const labelUList& nbrFaceCells =
lduAddr.patchAddr(cyclicACMIPatch_.neighbPatchID());
Field<Type> pnf(psiInternal, nbrFaceCells);
// Transform according to the transformation tensors
transformCoupleField(pnf);
// Assume that sends are also OK
sendRequests_.clear();
cyclicACMIPatch_.initInterpolate
(
@ -741,6 +760,9 @@ void Foam::cyclicACMIFvPatchField<Type>::updateInterfaceMatrix
recvRequests_,
recvBufs_
);
// Receive requests all handled by last function call
recvRequests_.clear();
}
else
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -446,14 +446,27 @@ void Foam::cyclicAMIFvPatchField<Type>::initEvaluate
// Start sending
// By-pass polyPatch to get nbrId. Instead use cyclicAMIFvPatch virtual
// neighbPatch()
// Bypass polyPatch to get nbrId.
// - use cyclicACMIFvPatch::neighbPatch() virtual instead
const cyclicAMIFvPatch& neighbPatch = cyclicAMIPatch_.neighbPatch();
const labelUList& nbrFaceCells = neighbPatch.faceCells();
const Field<Type> pnf(this->primitiveField(), nbrFaceCells);
const cyclicAMIPolyPatch& cpp = cyclicAMIPatch_.cyclicAMIPatch();
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
<< cyclicAMIPatch_.name()
<< " field " << this->internalField().name()
<< abort(FatalError);
}
// Assume that sends are also OK
sendRequests_.clear();
cpp.initInterpolate
(
pnf,
@ -516,6 +529,10 @@ void Foam::cyclicAMIFvPatchField<Type>::evaluate
defaultValues
).ptr()
);
// Receive requests all handled by last function call
recvRequests_.clear();
auto& patchNeighbourField = patchNeighbourFieldPtr_.ref();
if (doTransform())
@ -563,6 +580,19 @@ void Foam::cyclicAMIFvPatchField<Type>::initInterfaceMatrixUpdate
const cyclicAMIPolyPatch& cpp = cyclicAMIPatch_.cyclicAMIPatch();
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
<< cyclicAMIPatch_.name()
<< " field " << this->internalField().name()
<< abort(FatalError);
}
// Assume that sends are also OK
sendRequests_.clear();
cpp.initInterpolate
(
pnf,
@ -624,6 +654,9 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
scalarRecvBufs_,
defaultValues
);
// Receive requests all handled by last function call
recvRequests_.clear();
}
else
{
@ -682,6 +715,19 @@ void Foam::cyclicAMIFvPatchField<Type>::initInterfaceMatrixUpdate
const cyclicAMIPolyPatch& cpp = cyclicAMIPatch_.cyclicAMIPatch();
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
<< cyclicAMIPatch_.name()
<< " field " << this->internalField().name()
<< abort(FatalError);
}
// Assume that sends are also OK
sendRequests_.clear();
cpp.initInterpolate
(
pnf,
@ -742,6 +788,9 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
recvBufs_,
defaultValues
);
// Receive requests all handled by last function call
recvRequests_.clear();
}
else
{

View File

@ -43,7 +43,7 @@ Type Foam::functionObjects::extractEulerianParticles::faceValue
{
label patchi = patchIDs_[localFacei];
label pFacei = patchFaceIDs_[localFacei];
if (patchi != 0)
if (patchi != -1)
{
return field.boundaryField()[patchi][pFacei];
}

View File

@ -302,7 +302,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
TFilmPatch_ = film.Tf().primitiveField();
// Direct copy (one-to-one mapping)
TFilmPatch_ = film.Cp().primitiveField();
CpFilmPatch_ = film.Cp().primitiveField();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013 OpenFOAM Foundation
Copyright (C) 2019,2023 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -217,6 +217,18 @@ void Foam::cyclicACMIGAMGInterfaceField::initInterfaceMatrixUpdate
: AMI.srcMap()
);
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
<< cyclicACMIInterface_.index()
<< abort(FatalError);
}
// Assume that sends are also OK
sendRequests_.clear();
// Insert send/receive requests (non-blocking). See e.g.
// cyclicAMIPolyPatchTemplates.C
const label oldWarnComm = UPstream::commWarn(AMI.comm());
@ -276,6 +288,9 @@ void Foam::cyclicACMIGAMGInterfaceField::updateInterfaceMatrix
solveScalarField work;
map.receive(recvRequests_, scalarRecvBufs_, work);
// Receive requests all handled by last function call
recvRequests_.clear();
solveScalarField pnf(faceCells.size(), Zero);
AMI.weightedSum
(

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2019,2023 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -218,6 +218,18 @@ void Foam::cyclicAMIGAMGInterfaceField::initInterfaceMatrixUpdate
: AMI.srcMap()
);
// Assert that all receives are known to have finished
if (!recvRequests_.empty())
{
FatalErrorInFunction
<< "Outstanding recv request(s) on patch "
<< cyclicAMIInterface_.index()
<< abort(FatalError);
}
// Assume that sends are also OK
sendRequests_.clear();
// Insert send/receive requests (non-blocking). See e.g.
// cyclicAMIPolyPatchTemplates.C
const label oldWarnComm = UPstream::commWarn(AMI.comm());
@ -290,6 +302,9 @@ void Foam::cyclicAMIGAMGInterfaceField::updateInterfaceMatrix
solveScalarField work;
map.receive(recvRequests_, scalarRecvBufs_, work);
// Receive requests all handled by last function call
recvRequests_.clear();
solveScalarField pnf(faceCells.size(), Zero);
AMI.weightedSum
(

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021-2022 OpenCFD Ltd.
Copyright (C) 2021-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -70,7 +70,7 @@ static tmp<vectorField> getBoundedColours
const scalar boundMax
)
{
const label boundDelta = (boundMax - boundMin + ROOTVSMALL);
const scalar boundDelta = (boundMax - boundMin + ROOTVSMALL);
auto tresult = tmp<vectorField>::New(field.size());
auto& result = tresult.ref();
@ -167,7 +167,7 @@ Foam::scalarMinMax Foam::coordSetWriters::gltfWriter::getFieldLimits
{
const dictionary fieldDict = fieldInfoDict_.subOrEmptyDict(fieldName);
scalarMinMax limits;
scalarMinMax limits(-GREAT, GREAT);
fieldDict.readIfPresent("min", limits.min());
fieldDict.readIfPresent("max", limits.max());
@ -191,7 +191,7 @@ Foam::coordSetWriters::gltfWriter::getAlphaField
{
// Not specified
}
else if (!eptr->stream().peek().isString())
else if (!eptr->stream().peek().isWord())
{
// Value specified

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021-2022 OpenCFD Ltd.
Copyright (C) 2021-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,24 +45,27 @@ Description
\verbatim
formatOptions
{
// Apply colours flag (yes | no ) [optional]
colours yes;
// List of options per field
fieldInfo
gltf
{
p
// Apply colours flag (yes | no ) [optional]
colour yes;
// List of options per field
fieldInfo
{
// Colour map [optional]
colourMap <colourMap>;
p
{
// Colour map [optional]
colourMap <colourMap>;
// Colour map minimum and maximum limits [optional]
// Uses field min and max if not specified
min 0;
max 1;
// Colour map minimum and maximum limits [optional]
// Uses field min and max if not specified
min 0;
max 1;
// Alpha channel [optional] (<scalar>)
alpha 0.5;
// Alpha channel [optional] (<scalar>)
alpha 0.5;
}
}
}
}
@ -73,35 +76,38 @@ Description
\verbatim
formatOptions
{
// Apply colours flag (yes | no) [optional]
colours yes;
// Animate tracks (yes | no) [optional]
animate yes;
// Animation properties [optional]
animationInfo
gltf
{
// Colour map [optional]
colourMap <colourMap>;
// Apply colours flag (yes | no) [optional]
colour yes;
// Colour [optional] (<vector> | uniform | field)
colour (1 0 0); // RGB in range [0-1]
// Animate tracks (yes | no) [optional]
animate yes;
//colour uniform;
//colourValue (1 0 0); // RGB in range [0-1]
// Animation properties [optional]
animationInfo
{
// Colour map [optional]
colourMap <colourMap>;
//colour field;
//colourField d;
// Colour [optional] (<vector> | uniform | field)
colour (1 0 0); // RGB in range [0-1]
// Colour map minimum and maximum limits [optional]
// Note: for colour = field option
// Uses field min and max if not specified
min 0;
max 1;
//colour uniform;
//colourValue (1 0 0); // RGB in range [0-1]
// Alpha channel [optional] (<scalar>)
alpha 0.5;
//colour field;
//colourField d;
// Colour map minimum and maximum limits [optional]
// Note: for colour = field option
// Uses field min and max if not specified
min 0;
max 1;
// Alpha channel [optional] (<scalar>)
alpha 0.5;
}
}
}
\endverbatim

View File

@ -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);
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020-2021 OpenCFD Ltd.
Copyright (C) 2020-2021,2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -201,7 +201,10 @@ Foam::mappedPatchBase::updateSampleMeshTime() const
{
if (!updateSampleMeshTimePtr_)
{
const auto& mesh = sampleMesh();
// Note: explicitly register on our mesh instead of sampleMesh
// since otherwise the destructor might give problems since sampleMesh
// might have already been taken down before.
const auto& mesh = patch_.boundaryMesh().mesh();
updateSampleMeshTimePtr_.reset
(

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 OpenCFD Ltd.
Copyright (C) 2023-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -26,7 +26,6 @@ License
\*---------------------------------------------------------------------------*/
#include "triangulatedPatch.H"
#include "triPointRef.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -50,6 +49,8 @@ bool Foam::triangulatedPatch::randomPoint
// Find corresponding decomposed face triangle
// Note: triWght_ is sized nTri+1 (zero added at start)
//
// TBD: binary search with findLower(triWght_, c) ??
label trii = 0;
for (label i = 0; i < triWght_.size() - 1; ++i)
{
@ -62,11 +63,9 @@ bool Foam::triangulatedPatch::randomPoint
// Find random point in triangle
const pointField& points = patch_.points();
const face& tf = triFace_[trii];
const triPointRef tri(points[tf[0]], points[tf[1]], points[tf[2]]);
result = tri.randomPoint(rnd);
facei = triToFace_[trii];
result = triFace_[trii].tri(points).randomPoint(rnd);
facei = triFace_[trii].index();
celli = patch_.faceCells()[facei];
if (perturbTol_ > 0)
@ -97,7 +96,6 @@ Foam::triangulatedPatch::triangulatedPatch
patch_(patch),
perturbTol_(perturbTol),
triFace_(),
triToFace_(),
triWght_()
{
update();
@ -115,70 +113,95 @@ Foam::triangulatedPatch::triangulatedPatch
{}
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
void Foam::triangulatedPatch::triangulate
(
const polyPatch& pp,
List<labelledTri>& tris
)
{
const pointField& points = pp.points();
// Triangulate the patch faces and create addressing
label nTris = 0;
for (const face& f : pp)
{
nTris += f.nTriangles();
}
DynamicList<labelledTri> dynTris(nTris);
DynamicList<face> tfaces(8); // work array
label facei = 0;
for (const face& f : pp)
{
tfaces.clear();
f.triangles(points, tfaces);
for (const auto& t : tfaces)
{
dynTris.emplace_back(t[0], t[1], t[2], facei);
}
++facei;
}
tris.transfer(dynTris);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::triangulatedPatch::update()
{
triFace_.clear();
triWght_.clear();
triangulate(patch_, triFace_);
const pointField& points = patch_.points();
// Triangulate the patch faces and create addressing
DynamicList<label> triToFace(2*patch_.size());
DynamicList<face> triFace(2*patch_.size());
DynamicList<scalar> triWght(2*patch_.size());
DynamicList<face> tris(8);
const label myProci = UPstream::myProcNo();
const label numProc = UPstream::nProcs();
// Calculate the cumulative triangle weights
triWght_.resize_nocopy(triFace_.size()+1);
auto iter = triWght_.begin();
// Set zero value at the start of the tri area/weight list
triWght.push_back(0);
scalar patchArea = 0;
*iter = patchArea;
++iter;
forAll(patch_, facei)
// Calculate cumulative and total area (processor-local at this point)
for (const auto& t : triFace_)
{
const face& f = patch_[facei];
patchArea += t.mag(points);
tris.clear();
f.triangles(points, tris);
for (const auto& t : tris)
{
triToFace.push_back(facei);
triFace.push_back(t);
triWght.push_back(t.mag(points));
}
*iter = patchArea;
++iter;
}
scalarList procSumWght(Pstream::nProcs()+1, Zero);
procSumWght[Pstream::myProcNo()+1] = sum(triWght);
// FIXME: use allGatherList of subslice
scalarList procSumWght(numProc+1, Foam::zero{});
procSumWght[myProci+1] = patchArea;
Pstream::listCombineReduce(procSumWght, maxEqOp<scalar>());
// Convert to cumulative
for (label i = 1; i < procSumWght.size(); ++i)
{
// Convert to cumulative
procSumWght[i] += procSumWght[i-1];
}
const scalar offset = procSumWght[Pstream::myProcNo()];
forAll(triWght, i)
const scalar offset = procSumWght[myProci];
const scalar totalArea = procSumWght.back();
// Apply processor offset and normalise - for a global 0-1 interval
for (scalar& w : triWght_)
{
if (i)
{
// Convert to cumulative
triWght[i] += triWght[i-1];
}
// Apply processor offset
triWght[i] += offset;
w = (w + offset) / totalArea;
}
// Normalise
const scalar sumWght = procSumWght.back();
for (scalar& w : triWght)
{
w /= sumWght;
}
// Transfer to persistent storage
triFace_.transfer(triFace);
triToFace_.transfer(triToFace);
triWght_.transfer(triWght);
}
@ -190,6 +213,14 @@ bool Foam::triangulatedPatch::randomLocalPoint
label& celli
) const
{
if (triWght_.empty())
{
result = point::min;
facei = -1;
celli = -1;
return false;
}
const scalar c = rnd.position<scalar>(triWght_.front(), triWght_.back());
return randomPoint(rnd, c, result, facei, celli);
@ -204,20 +235,23 @@ bool Foam::triangulatedPatch::randomGlobalPoint
label& celli
) const
{
boolList valid(UPstream::nProcs(), false);
valid[UPstream::myProcNo()] = randomLocalPoint(rnd, result, facei, celli);
UPstream::listGatherValues(valid);
forAll(valid, proci)
if (UPstream::parRun())
{
// Choose first valid processor
if (valid[proci])
{
return (proci == UPstream::myProcNo());
}
}
const scalar c = rnd.sample01<scalar>();
const bool ok = randomPoint(rnd, c, result, facei, celli);
return false;
boolList valid(UPstream::listGatherValues(ok));
// Select the first valid processor
label proci = valid.find(true);
Pstream::broadcast(proci);
return (proci == UPstream::myProcNo());
}
else
{
return randomLocalPoint(rnd, result, facei, celli);
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 OpenCFD Ltd.
Copyright (C) 2023-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -35,6 +35,7 @@ Description
#define Foam_triangulatedPatch_H
#include "polyMesh.H"
#include "labelledTri.H"
#include "Random.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,13 +56,12 @@ class triangulatedPatch
//- Perturbation tolerance to move the point towards the cell centre
bool perturbTol_;
//- Face triangles
faceList triFace_;
//- The polyPatch faces as triangles, the index of each corresponds
//- to the undecomposed patch face index.
List<labelledTri> triFace_;
//- Triangle to patch face addressing
labelList triToFace_;
//- Triangle weights
//- The cumulative triangle area per triangle face,
//- globally normalised as a 0-1 interval.
scalarList triWght_;
@ -81,6 +81,11 @@ class triangulatedPatch
) const;
// Static Member Functions
//- Triangulate the patch faces and create addressing
static void triangulate(const polyPatch& pp, List<labelledTri>& tris);
public:
//- Constructors

View File

@ -420,19 +420,21 @@ void Foam::incompressibleAdjointSolver::accumulateBCSensitivityIntegrand
fvPatchVectorField& Uab = UaBoundary[patchI];
if (isA<adjointVectorBoundaryCondition>(Uab))
{
const fvPatch& patch = mesh_.boundary()[patchI];
tmp<vectorField> tnf = patch.nf();
const scalarField& magSf = patch.magSf();
tmp<tensorField> dxdbMult =
refCast<adjointVectorBoundaryCondition>(Uab).dxdbMult();
if (dxdbMult)
{
const fvPatch& patch = mesh_.boundary()[patchI];
tmp<vectorField> tnf = patch.nf();
const scalarField& magSf = patch.magSf();
tmp<vectorField> DvDbMult =
nuEffBoundary[patchI]*(Uab.snGrad() + (gradUabf[patchI] & tnf))
// - (nf*pa.boundaryField()[patchI])
+ adjointTurbulence().adjointMomentumBCSource()[patchI];
bcDxDbMult()[patchI] +=
(
DvDbMult
& refCast<adjointVectorBoundaryCondition>(Uab).dxdbMult()
)*magSf*dt;
tmp<vectorField> DvDbMult =
nuEffBoundary[patchI]
*(Uab.snGrad() + (gradUabf[patchI] & tnf))
// - (nf*pa.boundaryField()[patchI])
+ adjointTurbulence().adjointMomentumBCSource()[patchI];
bcDxDbMult()[patchI] += (DvDbMult & dxdbMult())*magSf*dt;
}
}
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -39,7 +39,11 @@ Foam::sampledMeshedSurface::sampleOnFaces
{
const Type deflt
(
defaultValues_.getOrDefault<Type>(sampler.psi().name(), Zero)
defaultValues_.getOrDefault<Type>
(
sampler.psi().name(),
Foam::zero{}
)
);
const labelList& elements = sampleElements_;
@ -71,13 +75,16 @@ Foam::sampledMeshedSurface::sampleOnFaces
const polyBoundaryMesh& pbm = mesh().boundaryMesh();
Field<Type> bVals(mesh().nBoundaryFaces(), Zero);
Field<Type> bVals(mesh().nBoundaryFaces(), deflt);
const auto& bField = sampler.psi().boundaryField();
forAll(bField, patchi)
{
SubList<Type>(bVals, pbm[patchi].range()) = bField[patchi];
// Note: restrict transcribing to actual size of the patch field
// - handles "empty" patch type etc.
const auto& pfld = bField[patchi];
SubList<Type>(bVals, pfld.size(), pbm[patchi].offset()) = pfld;
}
// Sample within the flat boundary field
@ -109,7 +116,11 @@ Foam::sampledMeshedSurface::sampleOnPoints
{
const Type deflt
(
defaultValues_.getOrDefault<Type>(interpolator.psi().name(), Zero)
defaultValues_.getOrDefault<Type>
(
interpolator.psi().name(),
Foam::zero{}
)
);
const labelList& elements = sampleElements_;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2023 OpenCFD Ltd.
Copyright (C) 2017-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -183,8 +183,6 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
while (is.good())
{
// Parsing position within current line
std::string::size_type linei = 0;
is.getLine(line);
if (NASCore::debug > 1) Info<< "Process: " << line << nl;
@ -319,16 +317,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);
@ -357,12 +369,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);
@ -406,11 +426,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.push_back(index);
dynPoints.emplace_back(x, y, z);
@ -423,6 +453,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
@ -452,7 +484,10 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
// have the 'weird' format where the immediately preceeding
// comment contains the information.
label groupId = readLabel(nextNasField(line, linei, 8)); // 8-16
// Fixed format:
// 8-16 : pshell id
label groupId = readLabel(nextNasField(line, linei, 8, freeFormat));
if (lastComment.size() > 1 && !nameLookup.contains(groupId))
{

View File

@ -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)
{

View File

@ -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

View File

@ -10,11 +10,11 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
object muTilda;
object nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;

View File

@ -36,7 +36,7 @@ divSchemes
div(phi,k) Gauss limitedLinear 1;
div(phi,B) Gauss limitedLinear 1;
div(phi,muTilda) Gauss limitedLinear 1;
div(phi,nuTilda) Gauss limitedLinear 1;
div(B) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
@ -57,5 +57,9 @@ snGradSchemes
default corrected;
}
wallDist
{
method meshWave;
}
// ************************************************************************* //

View File

@ -13,8 +13,8 @@ rm -rf 0/domain3 constant/domain3 system/domain3
# Remove fluid fields from solid regions (important for post-processing)
for region in $(foamListRegions solid)
do
rm -f 0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f processor*/0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f 0/$region/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f processor*/0/$region/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
done
# Set the initial fields

View File

@ -15,8 +15,8 @@ rm -rf 0/domain3 constant/domain3 system/domain3
# Remove fluid fields from solid regions (important for post-processing)
for region in $(foamListRegions solid)
do
rm -f 0/"$region"/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f processor*/0/"$region"/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f 0/"$region"/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f processor*/0/"$region"/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
done
# Set the initial fields

View File

@ -1,60 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format binary;
class volScalarField;
object mut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
symmetry
{
type symmetryPlane;
}
walls
{
type mutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
cabin_to_ice
{
type mutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -29,8 +29,7 @@ divSchemes
default Gauss linear;
div(phi,U) bounded Gauss linearUpwind gradUConv;
div(-phi,Uaas1) bounded Gauss linearUpwind gradUaConv;
div(-phi,Uavol) bounded Gauss linearUpwind gradUaConv;
div(-phi,Ua) bounded Gauss linearUpwind gradUaConv;
div((nuEff*dev(grad(U).T()))) Gauss linear;
div((nuEff*dev(grad(Ua).T()))) Gauss linear;

View File

@ -16,7 +16,7 @@ FoamFile
dimensions [ 0 1 -1 0 0 0 0 ];
internalField uniform ( 0.3 0 0 );
internalField uniform ( 4.95 0 0 );
boundaryField
{
@ -46,7 +46,7 @@ boundaryField
Inlet
{
type fixedValue;
value uniform ( 0.3 0 0 );
value uniform ( 4.95 0 0 );
}
Outlet

View File

@ -22,13 +22,13 @@ startTime 0;
stopAt endTime;
endTime 70;
endTime 100;
deltaT 1;
writeControl timeStep;
writeInterval 70;
writeInterval 100;
purgeWrite 0;

View File

@ -108,7 +108,7 @@ adjointManagers
type flowRatePartition;
inletPatches (inlet);
outletPatches (outlet outlet-right);
targetFractions (0.5 0.5);
targetFractions (0.3 0.7);
target 1.e-05;
normalize true;
}

View File

@ -108,7 +108,7 @@ adjointManagers
type flowRatePartition;
inletPatches (inlet);
outletPatches (outlet outlet-right);
targetFractions (0.5 0.5);
targetFractions (0.7 0.3);
target 1.e-05;
normalize true;
}

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -15,6 +15,11 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 60;
method scotch;
method hierarchical;
coeffs
{
n (5 4 3);
}
// ************************************************************************* //

View File

@ -29,8 +29,9 @@ solvers
relTol 0.01;
}
"U|Ua.*" smoothSolver
"U|Ua.*"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-12;
relTol 0.1;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -15,6 +15,11 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 60;
method scotch;
method hierarchical;
coeffs
{
n (5 4 3);
}
// ************************************************************************* //

View File

@ -29,8 +29,9 @@ solvers
relTol 0.01;
}
"U|Ua.*" smoothSolver
"U|Ua.*"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-12;
relTol 0.1;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -15,6 +15,11 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 60;
method scotch;
method hierarchical;
coeffs
{
n (5 4 3);
}
// ************************************************************************* //

View File

@ -29,8 +29,9 @@ solvers
relTol 0.01;
}
"U|Ua.*" smoothSolver
"U|Ua.*"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-12;
relTol 0.1;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -15,6 +15,11 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 60;
method scotch;
method hierarchical;
coeffs
{
n (5 4 3);
}
// ************************************************************************* //

View File

@ -29,8 +29,9 @@ solvers
relTol 0.01;
}
"U|Ua.*" smoothSolver
"U|Ua.*"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-12;
relTol 0.1;

View File

@ -12,7 +12,7 @@ runParallel $(getApplication)
if [[ ! -z $(which cartesian2DMesh) ]]
then
cd reEval
./AllrunReEval > log.AllrunReEval 2>&1 &
./AllrunReEval > log.AllrunReEval 2>&1 && echo "End" >> log.AllrunReEval
cd ..
fi