|
[Sponsors] |
July 29, 2018, 15:56 |
NusselCalc compilation
|
#1 |
New Member
Bruno Paes Fragoso
Join Date: Mar 2018
Location: Brazil
Posts: 6
Rep Power: 8 |
I'm facing a problem with nusseltcalc compilation. I have modified the tool wallheatflux (OpenFoam Version 4.1) and I don't know how to solve the problem bellow. Thanks for your help!
wmakeMaking dependency list for source file nusseltCalc.C g++ -std=c++0x -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/openfoam4/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam4/src/TurbulenceModels/compressible/lnInclude -I/opt/openfoam4/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam4/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/openfoam4/src/transportModels/compressible/lnInclude -I/opt/openfoam4/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam4/src/thermophysicalModels/solidThermo/lnInclude -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c nusseltCalc.C -o Make/linux64GccDPInt32Opt/nusseltCalc.o nusseltCalc.C: In function ‘int main(int, char**)’: nusseltCalc.C:168:49: error: passing ‘const Foam::fvPatchField<double>’ as ‘this’ argument discards qualifiers [-fpermissive] nusseltNumber.boundaryField()[patchi] = length*patchHeatFlux[patchi]/ ^ In file included from /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.H:592:0, from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:40, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam4/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam4/src/finiteVolume/lnInclude/fvCFD.H:8, from nusseltCalc.C:34: /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.C:395:6: note: in call to ‘void Foam::fvPatchField<Type>:perator=(const Foam::UList<T>&) [with Type = double]’ void Foam::fvPatchField<Type>:perator= ^ /opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/nusseltCalc.o' failed make: *** [Make/linux64GccDPInt32Opt/nusseltCalc.o] Error 1 |
|
July 30, 2018, 04:35 |
|
#2 |
Senior Member
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11 |
Did you forget to change from $(FOAM_APPBIN) to $(FOAM_USER_APPBIN) in Make/files?
Just a wild guess though.
__________________
If you liked my answer to your question, please consider leaving a "Like" in return |
|
July 30, 2018, 18:02 |
|
#3 | |
New Member
Bruno Paes Fragoso
Join Date: Mar 2018
Location: Brazil
Posts: 6
Rep Power: 8 |
Quote:
bruno@bruno-300E5M-300E5L:~/openfoam4/meu/2018-2/matrizpimple/nusseltCalc$ wmakeMaking dependency list for source file nusseltCalc.C g++ -std=c++0x -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/openfoam4/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam4/src/TurbulenceModels/compressible/lnInclude -I/opt/openfoam4/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam4/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/openfoam4/src/transportModels/compressible/lnInclude -I/opt/openfoam4/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam4/src/thermophysicalModels/solidThermo/lnInclude -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c nusseltCalc.C -o Make/linux64GccDPInt32Opt/nusseltCalc.o nusseltCalc.C: In function ‘int main(int, char**)’: nusseltCalc.C:168:49: error: passing ‘const Foam::fvPatchField<double>’ as ‘this’ argument discards qualifiers [-fpermissive] nusseltNumber.boundaryField()[patchi] = length*patchHeatFlux[patchi]/ ^ In file included from /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.H:592:0, from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:40, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam4/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam4/src/finiteVolume/lnInclude/fvCFD.H:8, from nusseltCalc.C:34: /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.C:395:6: note: in call to ‘void Foam::fvPatchField<Type>:perator=(const Foam::UList<T>&) [with Type = double]’ void Foam::fvPatchField<Type>:perator= ^ /opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/nusseltCalc.o' failed make: *** [Make/linux64GccDPInt32Opt/nusseltCalc.o] Error 1 Now my nusseltCalc.C /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Application wallHeatFlux Description Calculates and writes the heat flux for all patches as the boundary field of a volScalarField and also prints the integrated flux for all wall patches. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "turbulentFluidThermoModel.H" #include "solidThermo.H" #include "wallFvPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { timeSelector::addOptions(); #include "addRegionOption.H" #include "setRootCase.H" #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); #include "createNamedMesh.H" forAll(timeDirs, timeI) { runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; mesh.readUpdate(); #include "createFields.H" surfaceScalarField heatFlux ( fvc::interpolate ( ( turbulence.valid() ? turbulence->alphaEff()() : thermo->alpha() ) )*fvc::snGrad(h) ); const surfaceScalarField::Boundary& patchHeatFlux = heatFlux.boundaryField(); const volScalarField::Boundary& patchRadHeatFlux = Qr.boundaryField(); const surfaceScalarField::Boundary& magSf = mesh.magSf().boundaryField(); Info<< "\nWall heat fluxes [W]" << endl; forAll(patchHeatFlux, patchi) { if (isA<wallFvPatch>(mesh.boundary()[patchi])) { scalar convFlux = gSum(magSf[patchi]*patchHeatFlux[patchi]); scalar radFlux = -gSum(magSf[patchi]*patchRadHeatFlux[patchi]); Info<< mesh.boundary()[patchi].name() << endl << " convective: " << convFlux << endl << " radiative: " << radFlux << endl << " total: " << convFlux + radFlux << endl; } } Info<< endl; volScalarField wallHeatFlux ( IOobject ( "wallHeatFlux", runTime.timeName(), mesh ), mesh, dimensionedScalar("wallHeatFlux", heatFlux.dimensions(), 0.0) ); volScalarField::Boundary& wallHeatFluxBf = wallHeatFlux.boundaryFieldRef(); forAll(wallHeatFluxBf, patchi) { wallHeatFluxBf[patchi] = patchHeatFlux[patchi]; } wallHeatFlux.write(); // Write the total heat-flux including the radiative contribution // if available if (Qr.headerOk()) { volScalarField totalWallHeatFlux ( IOobject ( "totalWallHeatFlux", runTime.timeName(), mesh ), mesh, dimensionedScalar ( "totalWallHeatFlux", heatFlux.dimensions(), 0.0 ) ); volScalarField::Boundary& totalWallHeatFluxBf = totalWallHeatFlux.boundaryFieldRef(); forAll(totalWallHeatFluxBf, patchi) { totalWallHeatFluxBf[patchi] = patchHeatFlux[patchi] - patchRadHeatFlux[patchi]; } totalWallHeatFlux.write(); //NusseltNumber volScalarField nusseltNumber ( IOobject ( "nusseltNumber", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("nusseltNumber", dimless, 0.0) ); #include "readRefValues.H" forAll(nusseltNumber.boundaryField(), patchi) { nusseltNumber.boundaryField()[patchi] = length*patchHeatFlux[patchi]/((T_hot-T_initial)*k); } nusseltNumber.write(); } Info<< "End\n" << endl; return 0; } } // ************************************************** *********************** // |
||
|
|
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 |
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 |