|
[Sponsors] |
March 22, 2016, 10:39 |
ghRef defination location
|
#1 |
Member
Manoj
Join Date: Jun 2013
Posts: 38
Rep Power: 13 |
Hi, I am trying to compile modify interDyMfoam and create waveDyMfoam. I am getting following error.
waveDyMFoam.C:130:43: error: ‘ghRef’ was not declared in this scope gh = (g & mesh.C()) - ghRef; I want to know where is ghRef defined.. Thanks, Manoj |
|
March 22, 2016, 16:13 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Try going to your OpenFOAM source root, and searching for it. Start with OpenFOAM/src, and if it's not there, search OpenFOAM/applications
find -name "*.[HC]" | xargs grep ghRef or grep -r ghRef *
__________________
~~~ Follow me on twitter @DavidGaden |
|
March 23, 2016, 04:41 |
|
#3 | |
Member
Manoj
Join Date: Jun 2013
Posts: 38
Rep Power: 13 |
Quote:
I found that ghRef is defined in gh.H . After including this in my code, I am now getting following error. Code:
In file included from waveDyMFoam.C:69:0: ../createFields.H: In function ‘int main(int, char**)’: ../createFields.H:83:18: error: redeclaration of ‘Foam::volScalarField gh’ volScalarField gh("gh", g & (mesh.C() - referencePoint)); ^ In file included from waveDyMFoam.C:63:0: /opt/openfoam30/src/finiteVolume/lnInclude/gh.H:8:20: note: ‘Foam::volScalarField gh’ previously declared here volScalarField gh("gh", (g & mesh.C()) - ghRef); ^ In file included from waveDyMFoam.C:69:0: ../createFields.H:84:23: error: redeclaration of ‘Foam::surfaceScalarField ghf’ surfaceScalarField ghf("ghf", g & (mesh.Cf() - referencePoint)); ^ In file included from waveDyMFoam.C:63:0: /opt/openfoam30/src/finiteVolume/lnInclude/gh.H:9:24: note: ‘Foam::surfaceScalarField ghf’ previously declared here surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef); Regards, Manoj |
||
March 23, 2016, 07:15 |
|
#4 |
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15 |
Hi,
did you included that gh.H file in your code? It seems the error comes because you are defining it twice: when you include the H file and when you code it. Try to comment out your own definitions. |
|
May 20, 2016, 14:26 |
|
#5 |
New Member
Pierre-Henri Musiedlak
Join Date: Dec 2015
Posts: 11
Rep Power: 10 |
Hello Manoj and Agustino,
I am struggling at the same step. I found this: http://www.cfd-online.com/Forums/ope...c-meshing.html And proceed to the opposite: in createFields.H uncomment the two #include and comment the two solScalar and surfaceSaclar: original: Code:
//include "readhRef.H" //include "gh.H" #volScalarField gh("gh", g & (mesh.C() - referencePoint)); #surfaceScalarField ghf("ghf", g & (mesh.Cf() - referencePoint)); Code:
#include "readhRef.H" #include "gh.H" //volScalarField gh("gh", g & (mesh.C() - referencePoint)); //surfaceScalarField ghf("ghf", g & (mesh.Cf() - referencePoint)); The other solution I found is to copy-paste the definition of gh.H just before it is used in waveDyMFoam, but in removing the two last lines. Code:
if (mesh.changing()) { Info<< "Execution time for mesh.update() = " << runTime.elapsedCpuTime() - timeBeforeMeshUpdate << " s" << endl; dimensionedScalar ghRef ( mag(g.value()) > SMALL ? g & (cmptMag(g.value())/mag(g.value()))*hRef : dimensionedScalar("ghRef", g.dimensions()*dimLength, 0) ); //volScalarField gh("gh", (g & mesh.C()) - ghRef); //surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef); gh = (g & mesh.C()) - ghRef; ghf = (g & mesh.Cf()) - ghRef; } Code:
#include "readhRef.H" This way i am not altering the createFields.H The simulation runs and then crash the same (hopefully meaning it does not come from here) Cheers Pierre-Henri Last edited by phmusi; May 20, 2016 at 15:27. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |