CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Error in compiling a modified solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 26, 2013, 09:27
Default Error in compiling a modified solver
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,209
Rep Power: 19
immortality is on a distinguished road
I added some line to the rhoPimpleFoam as below:
Code:
word patchName = "left";
         label patchID = mesh.boundary().findPatchID(patchName);
         forAll(U.boundaryField()[patchID],faceI)
           {
               U.boundaryField()[patchID][faceI].component(0)=min(U[cellI].component(0), 500);
           }
but this error occurd:
Code:
ehsan@Ehsan-com:~/Desktop/rhoPimpleFoamLimited$ ./Allwmake
+ wmake
Making dependency list for source file rhoPimpleFoamLimited.C
SOURCE=rhoPimpleFoamLimited.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/finiteVolume/cfdTools -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoPimpleFoamLimited.o
rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’:
rhoPimpleFoamLimited.C:91:69: error: ‘cellI’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1
+ wmake rhoPorousMRFPimpleFoam
make: *** No rule to make target `rhoPorousMRFPimpleFoam'.  Stop.
+ wmake rhoPorousMRFLTSPimpleFoam
make: *** No rule to make target `rhoPorousMRFLTSPimpleFoam'.  Stop.
ehsan@Ehsan-com:~/Desktop/rhoPimpleFoamLimited$
whats the difficulty by cellI?how should I introduce cellI to solver?
immortality is offline   Reply With Quote

Old   March 26, 2013, 09:51
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,209
Rep Power: 19
immortality is on a distinguished road
it resolved I changed it so:
Code:
U.boundaryField()[patchID][faceI].component(0)=min(U.boundaryField()[patchID][faceI].component(0), 500);
immortality is offline   Reply With Quote

Old   March 27, 2013, 11:54
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,209
Rep Power: 19
immortality is on a distinguished road
what means this error now?
Code:
ehsan@Ehsan-com:~/Desktop/rhoPimpleFoamLimited$ wmake
Making dependency list for source file rhoPimpleFoamLimited.C
SOURCE=rhoPimpleFoamLimited.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/finiteVolume/cfdTools -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoPimpleFoamLimited.o
rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’:
rhoPimpleFoamLimited.C:90:85: error: invalid types ‘<unresolved overloaded function type>[Foam::label {aka int}]’ for array subscript
rhoPimpleFoamLimited.C:94:41: error: name lookup of ‘cellI’ changed for ISO ‘for’ scoping [-fpermissive]
rhoPimpleFoamLimited.C:94:41: note: (if you use ‘-fpermissive’ G++ will accept your code)
rhoPimpleFoamLimited.C:100:132: error: ‘Foam::T’ does not have class type
make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1
I changed the limiter code as below:
Code:
forAll(U,cellI)
           {
            U[cellI].component(0)=min(U[cellI].component(0), sqrt(1.4*287.14*T[cellI])-30);
           }
           forAll(U,cellJ)
           {
            U[cellJ].component(1)=max(U[cellI].component(1),-150);
           }
         word patchName = "left";
         label patchID = mesh.boundary().findPatchID(patchName);
         forAll(U.boundaryField()[patchID],faceI)
           {
               U.boundaryField()[patchID][faceI].component(0)=min(U.boundaryField()[patchID][faceI].component(0), sqrt(1.4*287.14*T.boundaryField()[patchID][faceI])-30);
               U.boundaryField()[patchID][faceI].component(1)=max(U.boundaryField()[patchID][faceI].component(1),-150);
           }
immortality is offline   Reply With Quote

Old   March 29, 2013, 01:29
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,209
Rep Power: 19
immortality is on a distinguished road
I've added T in I/O dictionary in createFields.H but nothing changed.
Why T doesn't have a class as OF says?what does this mean?what can do?
All helps,opinions and hints are appreciated!
immortality is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wmake compiling new solver mksca OpenFOAM Programming & Development 13 August 18, 2014 22:26
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 09:52
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
Using a user-defined solver in OF ozzythewise OpenFOAM Running, Solving & CFD 3 February 8, 2011 16:28
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 14:08


All times are GMT -4. The time now is 21:52.