|
[Sponsors] | |||||
|
|
|
#1 | |
|
New Member
|
Hi Everyone,
I am a new Open-FOAM user, and quite new to C++ programming with basic understanding. I am trying to manually compile geometricVoF as required by atomizationFoam solver (by Martin Heinrich) using OpenFOAM v1912. However, the following error appears that cause the compilation failed. Quote:
Code:
#include "gradAlpha.H"
#include "fvc.H"
#include "leastSquareGrad.H"
#include "addToRunTimeSelectionTable.H"
#include "profiling.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace reconstruction
{
defineTypeNameAndDebug(gradAlpha, 0);
addToRunTimeSelectionTable(reconstructionSchemes, gradAlpha, components);
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::reconstruction::gradAlpha::gradSurf(const volScalarField& phi)
{
addProfilingInFunction(geometricVoF);
leastSquareGrad<scalar> lsGrad("polyDegree1",mesh_.geometricD());
zoneDistribute& exchangeFields = zoneDistribute::New(mesh_);
exchangeFields.setUpCommforZone(interfaceCell_,true);
Map<vector> mapCC
(
exchangeFields.getDatafromOtherProc(interfaceCell_, mesh_.C())
);
Map<scalar> mapPhi
(
exchangeFields.getDatafromOtherProc(interfaceCell_, phi)
);
DynamicField<vector> cellCentre(100);
DynamicField<scalar> phiValues(100);
const labelListList& stencil = exchangeFields.getStencil();
forAll(interfaceLabels_, i)
{
const label celli = interfaceLabels_[i];
cellCentre.clear();
phiValues.clear();
for (const label gblIdx : stencil[celli])
{
cellCentre.append
(
exchangeFields.getValue(mesh_.C(), mapCC, gblIdx)
);
phiValues.append
(
exchangeFields.getValue(phi, mapPhi, gblIdx)
);
}
cellCentre -= mesh_.C()[celli];
interfaceNormal_[i] = lsGrad.grad(cellCentre, phiValues);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::reconstruction::gradAlpha::gradAlpha
(
volScalarField& alpha1,
const surfaceScalarField& phi,
const volVectorField& U,
const dictionary& dict
)
:
reconstructionSchemes
(
typeName,
alpha1,
phi,
U,
dict
),
mesh_(alpha1.mesh()),
interfaceNormal_(fvc::grad(alpha1)),
isoFaceTol_(modelDict().getOrDefault<scalar>("isoFaceTol", 1e-8)),
surfCellTol_(modelDict().getOrDefault<scalar>("surfCellTol", 1e-8)),
sIterPLIC_(mesh_,surfCellTol_)
{
reconstruct();
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::reconstruction::gradAlpha::reconstruct(bool forceUpdate)
{
addProfilingInFunction(geometricVoF);
const bool uptodate = alreadyReconstructed(forceUpdate);
if (uptodate && !forceUpdate)
{
return;
}
if (mesh_.topoChanging())
{
// Introduced resizing to cope with changing meshes
if (interfaceCell_.size() != mesh_.nCells())
{
interfaceCell_.resize(mesh_.nCells());
}
}
interfaceCell_ = false;
interfaceLabels_.clear();
forAll(alpha1_, celli)
{
if (sIterPLIC_.isASurfaceCell(alpha1_[celli]))
{
interfaceCell_[celli] = true; // is set to false earlier
interfaceLabels_.append(celli);
}
}
interfaceNormal_.resize(interfaceLabels_.size());
centre_ = dimensionedVector("centre", dimLength, Zero);
normal_ = dimensionedVector("normal", dimArea, Zero);
gradSurf(alpha1_);
forAll(interfaceLabels_, i)
{
const label celli = interfaceLabels_[i];
if (mag(interfaceNormal_[i]) == 0)
{
continue;
}
sIterPLIC_.vofCutCell
(
celli,
alpha1_[celli],
isoFaceTol_,
100,
interfaceNormal_[i]
);
if (sIterPLIC_.cellStatus() == 0)
{
normal_[celli] = sIterPLIC_.surfaceArea();
centre_[celli] = sIterPLIC_.surfaceCentre();
if (mag(normal_[celli]) == 0)
{
normal_[celli] = Zero;
centre_[celli] = Zero;
}
}
else
{
normal_[celli] = Zero;
centre_[celli] = Zero;
}
}
}
void Foam::reconstruction::gradAlpha::mapAlphaField() const
{
// Without this line, we seem to get a race condition
mesh_.C();
cutCellPLIC cutCell(mesh_);
forAll(normal_, celli)
{
if (mag(normal_[celli]) != 0)
{
vector n = normal_[celli]/mag(normal_[celli]);
scalar cutValue = (centre_[celli] - mesh_.C()[celli]) & (n);
cutCell.calcSubCell
(
celli,
cutValue,
n
);
alpha1_[celli] = cutCell.VolumeOfFluid();
}
}
alpha1_.correctBoundaryConditions();
alpha1_.oldTime () = alpha1_;
alpha1_.oldTime().correctBoundaryConditions();
}
// ************************************************************************* //
wmake_manual_geometricVoF1.txt The related file also attached as below zoneDistribute.H zoneDistributeI.H If you need something else, please just ask me. Many thanks
|
||
|
|
|
||
|
|
|
#2 |
|
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 41 ![]() ![]() |
The short answer (looking at your log) - get a newer OpenFOAM version such as OpenFOAM-v2112 or even wait a few days and grab OpenFOAM-v2206. The version you are using is already more than 2.5 years old and the compilation issues with SLList have long been fixed.
EDIT: you should also know that zoneDistribute is also part of the standard OpenFOAM in newer versions. |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [foam-extend.org] foam-extend-3.2 compilation on windows | kirmaks | OpenFOAM Installation | 9 | December 10, 2025 05:08 |
| [waves2Foam] Problems with the compilation of the third party dependencies | chia87 | OpenFOAM Community Contributions | 7 | May 20, 2017 07:04 |
| Compilation error for OpenFOAM-ext on Ubantu 10.04 32 bit | Sargam05 | OpenFOAM Installation | 13 | March 22, 2014 06:21 |
| Compilation Error (V 1.7.1; Icc 12.1.0, OpenMPI 1.4.3) | floydfan | OpenFOAM Installation | 7 | December 20, 2011 06:56 |
| Compilation Error.... | Arnab | Siemens | 4 | September 12, 2004 16:54 |