CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Error in compilation of geometricVoF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2022, 09:46
Default Error in compilation of geometricVoF
  #1
New Member
 
Muhd Jamil Al Hakim
Join Date: Feb 2015
Posts: 5
Rep Power: 11
Jamill1283 is on a distinguished road
Send a message via Yahoo to Jamill1283 Send a message via Skype™ to Jamill1283
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:
reconstructionSchemes/plicSchemes/gradAlpha/gradAlpha.C:98:2: error: uninitialized reference member in ‘class Foam::zoneDistribute&’ [-fpermissive]
98 | Foam::reconstruction::gradAlpha::gradAlpha
| ^~~~
The code for gradAlpha.c is as below


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();
 }
  
  
 // ************************************************************************* //
I attached the log file as a reference


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
Attached Files
File Type: c gradAlpha.C (6.3 KB, 0 views)
Jamill1283 is offline   Reply With Quote

Old   June 21, 2022, 04:52
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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.
olesen is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[foam-extend.org] foam-extend-3.2 compilation on windows kirmaks OpenFOAM Installation 7 December 3, 2019 20:20
[waves2Foam] Problems with the compilation of the third party dependencies chia87 OpenFOAM Community Contributions 7 May 20, 2017 06:04
Compilation error for OpenFOAM-ext on Ubantu 10.04 32 bit Sargam05 OpenFOAM Installation 13 March 22, 2014 05:21
Compilation Error (V 1.7.1; Icc 12.1.0, OpenMPI 1.4.3) floydfan OpenFOAM Installation 7 December 20, 2011 05:56
Compilation Error.... Arnab Siemens 4 September 12, 2004 15:54


All times are GMT -4. The time now is 00:14.