mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -40,16 +41,18 @@ namespace Foam
|
||||
|
||||
Foam::solidBodyMotionFunction::solidBodyMotionFunction
|
||||
(
|
||||
const dictionary& SBMFCoeffs,
|
||||
const dictionary& dict,
|
||||
const Time& runTime
|
||||
)
|
||||
:
|
||||
SBMFCoeffs_
|
||||
(
|
||||
SBMFCoeffs.optionalSubDict
|
||||
dict.found("solidBodyMotionFunction")
|
||||
? dict.optionalSubDict
|
||||
(
|
||||
SBMFCoeffs.get<word>("solidBodyMotionFunction") + "Coeffs"
|
||||
dict.get<word>("solidBodyMotionFunction") + "Coeffs"
|
||||
)
|
||||
: dict
|
||||
),
|
||||
time_(runTime)
|
||||
{}
|
||||
@ -57,9 +60,9 @@ Foam::solidBodyMotionFunction::solidBodyMotionFunction
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::solidBodyMotionFunction::read(const dictionary& SBMFCoeffs)
|
||||
bool Foam::solidBodyMotionFunction::read(const dictionary& dict)
|
||||
{
|
||||
SBMFCoeffs_ = SBMFCoeffs.optionalSubDict(type() + "Coeffs");
|
||||
SBMFCoeffs_ = dict.optionalSubDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -110,14 +110,14 @@ void Foam::fa::externalHeatFluxSource::addSup
|
||||
false
|
||||
);
|
||||
|
||||
auto tQ = new areaScalarField
|
||||
auto tQ = tmp<areaScalarField>::New
|
||||
(
|
||||
io,
|
||||
regionMesh(),
|
||||
dimensionedScalar("q", dimPower/sqr(dimLength), 0),
|
||||
zeroGradientFaPatchScalarField::typeName
|
||||
);
|
||||
areaScalarField& Q = *tQ;
|
||||
areaScalarField& Q = tQ.ref();
|
||||
|
||||
switch (mode_)
|
||||
{
|
||||
|
||||
@ -148,6 +148,11 @@ Foam::binModel::binModel
|
||||
|
||||
bool Foam::binModel::read(const dictionary& dict)
|
||||
{
|
||||
if (!functionObjects::writeFile::read(dict))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
patchSet_ = mesh_.boundaryMesh().patchSet(dict.get<wordRes>("patches"));
|
||||
fieldNames_ = dict.get<wordHashSet>("fields").sortedToc();
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ bool Foam::binModels::singleDirectionUniformBin::processField
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Pstream::master() && !writtenHeader_)
|
||||
if (writeToFile() && !writtenHeader_)
|
||||
{
|
||||
writeFileHeader<Type>(filePtrs_[fieldi]);
|
||||
}
|
||||
@ -183,7 +183,12 @@ bool Foam::binModels::singleDirectionUniformBin::processField
|
||||
}
|
||||
}
|
||||
|
||||
if (Pstream::master())
|
||||
for (auto& binList : data)
|
||||
{
|
||||
reduce(binList, sumOp<List<Type>>());
|
||||
}
|
||||
|
||||
if (writeToFile())
|
||||
{
|
||||
writeBinnedData(data, filePtrs_[fieldi]);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ bool Foam::binModels::uniformBin::processField(const label fieldi)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Pstream::master() && !writtenHeader_)
|
||||
if (writeToFile() && !writtenHeader_)
|
||||
{
|
||||
writeFileHeader<Type>(filePtrs_[fieldi]);
|
||||
}
|
||||
@ -166,7 +166,12 @@ bool Foam::binModels::uniformBin::processField(const label fieldi)
|
||||
}
|
||||
}
|
||||
|
||||
if (Pstream::master())
|
||||
for (auto& binList : data)
|
||||
{
|
||||
reduce(binList, sumOp<List<Type>>());
|
||||
}
|
||||
|
||||
if (writeToFile())
|
||||
{
|
||||
writeBinnedData(data, filePtrs_[fieldi]);
|
||||
}
|
||||
|
||||
@ -171,8 +171,8 @@ void Foam::functionObjects::forceCoeffs::calcForceCoeffs()
|
||||
|
||||
Cf_.reset
|
||||
(
|
||||
forceScaling.value()*coordSys.localVector(sumPatchForcesV_),
|
||||
forceScaling.value()*coordSys.localVector(sumPatchForcesP_),
|
||||
forceScaling.value()*coordSys.localVector(sumPatchForcesV_),
|
||||
forceScaling.value()*coordSys.localVector(sumInternalForces_)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user