|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
R.B.
Join Date: Aug 2017
Posts: 7
Rep Power: 9 ![]() |
Dear all,
I am new to OpenFOAM. I have downloaded a solver (SbmFoam) that was created around 2012 (exact OF version is unknown or I have not found it yet). While compiling in the OF5, I have found several issues while compiling. The first modification I made was to include the following lines to Make/options file: Code:
-I$(LIB_SRC)/meshTools/lnInclude Code:
# include "readPISOControls.H" Code:
# include "pisoControl.H" Code:
wmake Code:
.......5.0/run/SbmFoam$ wmake Making dependency list for source file SbmFoam.C g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam5/src/finiteVolume/lnInclude -I/opt/openfoam5/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam5/src/OpenFOAM/lnInclude -I/opt/openfoam5/src/OSspecific/POSIX/lnInclude -fPIC -c SbmFoam.C -o Make/linux64GccDPInt32Opt/SbmFoam.o SbmFoam.C: In function ‘int main(int, char**)’: SbmFoam.C:105:31: error: ‘nCorr’ was not declared in this scope for (int corr=0; corr<nCorr; corr++) ^ SbmFoam.C:118:26: error: passing ‘const Foam::fvMatrix<Foam::Vector<double> >’ as ‘this’ argument discards qualifiers [-fpermissive] UEqn().relax(); ^ In file included from /opt/openfoam5/src/finiteVolume/lnInclude/fvMatrix.H:1061:0, from /opt/openfoam5/src/finiteVolume/lnInclude/ddtScheme.C:29, from /opt/openfoam5/src/finiteVolume/lnInclude/ddtScheme.H:342, from /opt/openfoam5/src/finiteVolume/lnInclude/fvcDdt.C:28, from /opt/openfoam5/src/finiteVolume/lnInclude/fvcDdt.H:205, from /opt/openfoam5/src/finiteVolume/lnInclude/fvc.H:44, from /opt/openfoam5/src/finiteVolume/lnInclude/fvCFD.H:8, from SbmFoam.C:45: /opt/openfoam5/src/finiteVolume/lnInclude/fvMatrix.C:674:6: note: in call to ‘void Foam::fvMatrix<Type>::relax() [with Type = Foam::Vector<double>]’ void Foam::fvMatrix<Type>::relax() ^ SbmFoam.C:122:44: error: passing ‘const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary’ as ‘this’ argument discards qualifiers [-fpermissive] p.boundaryField().updateCoeffs(); ^ In file included from /opt/openfoam5/src/OpenFOAM/lnInclude/GeometricField.C:1352:0, from /opt/openfoam5/src/OpenFOAM/lnInclude/GeometricField.H:660, from /opt/openfoam5/src/OpenFOAM/lnInclude/GeometricScalarField.H:38, from /opt/openfoam5/src/OpenFOAM/lnInclude/GeometricFields.H:34, from /opt/openfoam5/src/finiteVolume/lnInclude/volFields.H:37, from /opt/openfoam5/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27, from /opt/openfoam5/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:307, from /opt/openfoam5/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam5/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam5/src/finiteVolume/lnInclude/fvCFD.H:8, from SbmFoam.C:45: /opt/openfoam5/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:399:6: note: in call to ‘void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::updateCoeffs() [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]’ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary:: ^ SbmFoam.C:133:42: error: ‘nNonOrthCorr’ was not declared in this scope for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) ^ /opt/openfoam5/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/SbmFoam.o' failed make: *** [Make/linux64GccDPInt32Opt/SbmFoam.o] Error 1 If it is any help, I am running guest Ubuntu 16.04 on a VirtualBox host Windows 10. Many thanks. Last edited by rbabhi; September 1, 2017 at 05:41. Reason: Correction |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Join Date: May 2016
Posts: 30
Rep Power: 10 ![]() |
There are mainly two problems here.
The first one is: Code:
SbmFoam.C:105:31: error: ‘nCorr’ was not declared in this scope for (int corr=0; corr<nCorr; corr++) ^ For this, I think that this commit message and this topic may help. As a first step, try replacing the Code:
for (int corr=0; corr<nCorr; corr++) Code:
while (piso.correct()) The second problem is: Code:
SbmFoam.C:118:26: error: passing ‘const Foam::fvMatrix<Foam::Vector<double> >’ as ‘this’ argument discards qualifiers [-fpermissive] UEqn().relax(); ^ I think you can just solve it if you replace Code:
UEqn().relax() Code:
UEqn.ref().relax() |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
R.B.
Join Date: Aug 2017
Posts: 7
Rep Power: 9 ![]() |
Many thanks for your reply. Even after trying your suggestions and fixing several errors, I was left with lists of other issues that I needed to solve. I just gave up at the end and installed OF 1.7.1 and the file compiles perfectly well.
|
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 7 ![]() |
Hi!
I apologies for hopping into a previous post. But I find this post relevant to my present problem. I am describing my problem: I am trying to write some code by modifying densityBasedTurbo in foam extend 4. I am getting the following error: ************************************************** ************************************************** ************************* BSTurboFoam.C:127:25: error: passing ‘const surfaceVectorField {aka const Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ as ‘this’ argument discards qualifiers [-fpermissive] dbnsFlux.dotX() = mrfZones.faceU(); ************************************************** In BSTurboFoam.C : dbnsFlux.dotX() = mrfZones.faceU(); ************************************************** In numericFlux.H: ..... const surfaceVectorField& dotX() const //virtual { return dotX_; } surfaceVectorField& dotX() { return dotX_; } .... ************************************************** In numericFlux.C: template<class Flux, class Limiter> Foam::numericFlux<Flux, Limiter>::numericFlux ( const volScalarField& p, const volVectorField& U, const volScalarField& T, basicThermo& thermo ) : numericFluxBase<Flux>(p.mesh()), p_(p), U_(U), T_(T), thermo_(thermo), rhoFlux_ ( .... ), rhoUFlux_ ( ... ), rhoEFlux_ ( ... ), dotX_ ( IOobject ( "dotX", this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), this->mesh(), dimensionedVector("zero", dimVelocity, vector::zero) ) {} ************************************************** In MRFZone.C : void Foam::MRFZone::faceU ( surfaceVectorField& zoneFaceU ) const { ... } ************************************************** In MRFZones.C : Foam::tmp<Foam::surfaceVectorField> Foam::MRFZones::faceU() const { tmp<surfaceVectorField> tMRFZonesFaceU ( new surfaceVectorField ( ... ) ); surfaceVectorField& MRFZonesFaceU = tMRFZonesFaceU(); forAll(*this, i) { operator[](i).faceU(MRFZonesFaceU); } return tMRFZonesFaceU; } I shall be greatly helped if the error gets resolved and can proceed further. Thanks a lot for your time. Bidesh |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7 ![]() |
Have you tried to just pass the return argument of faceU() to a field? Might be less efficient but lets try to understand the problem first.
Code:
{ surfaceVectorField faceU = mrfZones.faceU() dbnsFlux.dotX() = faceU; } |
|
![]() |
![]() |
![]() |
![]() |
#6 | |||
Member
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 7 ![]() |
Quote:
Hi, Thanks a lot for your reply and suggestion. I tried the method you suggested but getting the same error. Code:
BSTurboFoam.C:129:19: error: passing ‘const surfaceVectorField {aka const Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ as ‘this’ argument discards qualifiers [-fpermissive] dbnsFlux.dotX() = faceU; In numericFlux.C Quote:
Quote:
Last edited by BSengupta; January 23, 2020 at 00:12. |
||||
![]() |
![]() |
![]() |
Tags |
cfd code, sbmfoam, wmake error, wmake problems, wmake warning |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
make: Clock skew detected. build may be incomplete. while compiling new solver. | savee | OpenFOAM Programming & Development | 1 | May 27, 2017 06:23 |
Hybrid discretisation - blend factor | gcoopermax | CFX | 5 | September 23, 2016 08:05 |
Compiling meltFoam solver | mick223 | OpenFOAM Programming & Development | 12 | July 31, 2015 10:33 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 20:02 |
Compiling new Solver with wmake | lin123 | OpenFOAM | 3 | April 13, 2010 14:18 |