|
[Sponsors] |
September 16, 2019, 10:28 |
Modify a solver
|
#1 |
Member
X
Join Date: Jan 2019
Posts: 63
Rep Power: 7 |
I have modified interFoam solver without making any changes within.
I have already had a look at https://openfoamwiki.net/index.php/H...ure_to_icoFoam and have been successful with the example. I have changed the folder name changed the .C file changed the Make-files Code:
XFoam.C EXE = $(FOAM_USER_APPBIN)/XFoam Code:
Making dependency list for source file XFoam.C SOURCE=XFoam.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam231/src/transportModels/twoPhaseMixture/lnInclude -I/opt/openfoam231/src/transportModels -I/opt/openfoam231/src/transportModels/incompressible/lnInclude -I/opt/openfoam231/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam231/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam231/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam231/src/finiteVolume/lnInclude -I/opt/openfoam231/src/fvOptions/lnInclude -I/opt/openfoam231/src/meshTools/lnInclude -I/opt/openfoam231/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam231/src/OpenFOAM/lnInclude -I/opt/openfoam231/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/XFoam.o In file included from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcDiv.C:29:0, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcDiv.H:180, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcDDt.C:27, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcDDt.H:76, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvc.H:45, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvCFD.H:8, from XFoam.C:40: /opt/openfoam231/src/transportModels/incompressible/lnInclude/divScheme.H: In constructor ‘Foam::fv::divScheme<Type>::divScheme(const Foam::fvMesh&)’: /opt/openfoam231/src/transportModels/incompressible/lnInclude/divScheme.H:111:32: error: expected type-specifier before ‘linear’ tinterpScheme_(new linear<Type>(mesh)) ^ In file included from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcGrad.C:29:0, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcGrad.H:124, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvc.H:49, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvCFD.H:8, from XFoam.C:40: /opt/openfoam231/src/transportModels/incompressible/lnInclude/gaussGrad.H: In constructor ‘Foam::fv::gaussGrad<Type>::gaussGrad(const Foam::fvMesh&)’: /opt/openfoam231/src/transportModels/incompressible/lnInclude/gaussGrad.H:88:32: error: expected type-specifier before ‘linear’ tinterpScheme_(new linear<Type>(mesh)) ^ /opt/openfoam231/src/transportModels/incompressible/lnInclude/gaussGrad.H: In constructor ‘Foam::fv::gaussGrad<Type>::gaussGrad(const Foam::fvMesh&, Foam::Istream&)’: /opt/openfoam231/src/transportModels/incompressible/lnInclude/gaussGrad.H:101:21: error: expected primary-expression before ‘(’ token ( ^ /opt/openfoam231/src/transportModels/incompressible/lnInclude/gaussGrad.H:102:29: error: expected type-specifier before ‘linear’ new linear<Type>(mesh) ^ In file included from /opt/openfoam231/src/transportModels/incompressible/lnInclude/correctedSnGrad.H:150:0, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/laplacianScheme.H:42, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcLaplacian.C:28, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcLaplacian.H:242, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvc.H:53, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvCFD.H:8, from XFoam.C:40: /opt/openfoam231/src/transportModels/incompressible/lnInclude/correctedSnGrad.C: In member function ‘Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::fv::correctedSnGrad<Type>::fullGradCorrection(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const’: /opt/openfoam231/src/transportModels/incompressible/lnInclude/correctedSnGrad.C:54:9: error: ‘linear’ was not declared in this scope & linear<typename outerProduct<vector, Type>::type>(mesh).interpolate ^ /opt/openfoam231/src/transportModels/incompressible/lnInclude/correctedSnGrad.C:54:9: note: suggested alternative: In file included from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcAverage.C:29:0, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcAverage.H:91, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvc.H:42, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvCFD.H:8, from XFoam.C:40: /opt/openfoam231/src/transportModels/incompressible/lnInclude/linear.H:52:7: note: ‘Foam::compressibilityModels::linear’ class linear ^ In file included from /opt/openfoam231/src/transportModels/incompressible/lnInclude/correctedSnGrad.H:150:0, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/laplacianScheme.H:42, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcLaplacian.C:28, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcLaplacian.H:242, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvc.H:53, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvCFD.H:8, from XFoam.C:40: /opt/openfoam231/src/transportModels/incompressible/lnInclude/correctedSnGrad.C:54:57: error: expected ‘(’ before ‘>’ token & linear<typename outerProduct<vector, Type>::type>(mesh).interpolate ^ /opt/openfoam231/src/transportModels/incompressible/lnInclude/correctedSnGrad.C:54:65: error: ‘const class Foam::fvMesh’ has no member named ‘interpolate’ & linear<typename outerProduct<vector, Type>::type>(mesh).interpolate ^ In file included from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcLaplacian.C:28:0, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvcLaplacian.H:242, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvc.H:53, from /opt/openfoam231/src/transportModels/incompressible/lnInclude/fvCFD.H:8, from XFoam.C:40: /opt/openfoam231/src/transportModels/incompressible/lnInclude/laplacianScheme.H: In constructor ‘Foam::fv::laplacianScheme<Type, GType>::laplacianScheme(const Foam::fvMesh&)’: /opt/openfoam231/src/transportModels/incompressible/lnInclude/laplacianScheme.H:113:37: error: expected type-specifier before ‘linear’ tinterpGammaScheme_(new linear<GType>(mesh)), ^ In file included from createFields.H:29:0, from XFoam.C:60: /opt/openfoam231/src/transportModels/incompressible/lnInclude/createPhi.H: In function ‘int main(int, char**)’: /opt/openfoam231/src/transportModels/incompressible/lnInclude/createPhi.H:49:24: error: ‘linearInterpolate’ was not declared in this scope linearInterpolate(U) & mesh.Sf() ^ In file included from XFoam.C:60:0: createFields.H:74:13: error: ‘incompressible’ was not declared in this scope autoPtr<incompressible::turbulenceModel> turbulence ^ createFields.H:74:44: error: template argument 1 is invalid autoPtr<incompressible::turbulenceModel> turbulence ^ createFields.H:75:5: error: invalid type in declaration before ‘(’ token ( ^ createFields.H:76:9: error: ‘incompressible’ is not a class or namespace incompressible::turbulenceModel::New(U, phi, mixture) ^ In file included from XFoam.C:64:0: /opt/openfoam231/src/transportModels/incompressible/lnInclude/CourantNo.H:51:1: error: ‘namespace’ definition is not allowed here namespace Foam ^ In file included from XFoam.C:65:0: /opt/openfoam231/src/transportModels/incompressible/lnInclude/setInitialDeltaT.H:35:40: error: ‘CoNum’ was not declared in this scope if ((runTime.timeIndex() == 0) && (CoNum > SMALL)) ^ In file included from XFoam.C:76:0: setDeltaT.H:37:20: error: ‘CoNum’ was not declared in this scope min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL)); ^ In file included from XFoam.C:90:0: UEqn.H:5:19: error: base operand of ‘->’ is not a pointer + turbulence->divDevRhoReff(rho, U) ^ XFoam.C:100:27: error: base operand of ‘->’ is not a pointer turbulence->correct(); ^ In file included from XFoam.C:61:0: /opt/openfoam231/src/transportModels/incompressible/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable] scalar maxDeltaT = ^ make: *** [Make/linuxGccDPOpt/XFoam.o] Error 1 |
|
September 16, 2019, 12:39 |
|
#2 |
Senior Member
Join Date: Jul 2009
Posts: 358
Rep Power: 19 |
My first guess would be don't use a space in a file name in linux. Rather than "new linear", try "new_linear".
|
|
September 16, 2019, 13:03 |
|
#3 |
Member
X
Join Date: Jan 2019
Posts: 63
Rep Power: 7 |
My folder name doesnt have any space (changed from interFoam to XFoam)
|
|
September 16, 2019, 14:32 |
|
#4 |
Senior Member
Join Date: Jul 2009
Posts: 358
Rep Power: 19 |
Somewhere the compiler is seeing "new linear" and bombing on that. Because there is white space between those words the compiler sees it as a name and a modifier. I am not familiar with openFoam or any of its derivatives, but your compiler problem seems to be that "new linear" doesn't need to appear as two words. Find that and you'll probably fix your problem.
|
|
Tags |
solver compilation error |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Modify Particle Velocity in Lagrangian Solver | AustinG | OpenFOAM | 0 | August 23, 2018 18:38 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
CFX solver workspace properties: modify default values | zboud | CFX | 2 | March 8, 2010 09:10 |
why the solver reject it? Anyone with experience? | bearcat | CFX | 6 | April 28, 2008 15:08 |
To modify the interFoam solver for cavitating | zjucfd | OpenFOAM Running, Solving & CFD | 5 | August 26, 2007 09:03 |