|
[Sponsors] |
June 26, 2011, 05:02 |
‘patchi’ was not declared in this scope
|
#1 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
I am trying to write gradT on a wall in laplacianFoam as follows (code addition in write.H file)
volScalarField surfGradT ( IOobject ( "surfGradT", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradT.boundaryField()[patchi].snGrad() ); on running wmake I am getting the error‘patchi’ was not declared in this scope. How can I resolve this error? |
|
June 26, 2011, 05:12 |
|
#2 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
I am using OF 1.7
|
|
June 26, 2011, 05:23 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings doubtsincfd,
Where did get that code from? The variable patchi is clearly to be used for iterating over all patches... So, if you check where the variable is defined and used, prior to the code from where you copied it from, you should be able to adapt to your code! Best regards, Bruno
__________________
|
|
June 26, 2011, 05:29 |
|
#4 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
Thank you, Bruno
I am trying to build a code based on the code for gradTx given in solvers/basic/laplacianFoam/write.H. I want to calculate normal gradient of T on the patches. I am not so familiar with code modification of OF, so it is quite likely that I am making a basic mistake. I am trying to define "surfGradT" variable in the same way gradTx has been defined. Why is the code not recognizing patchi? |
|
June 26, 2011, 05:36 |
|
#5 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Quote:
Code:
gradT.boundaryField()[patchi].snGrad()
__________________
|
||
June 26, 2011, 05:41 |
|
#6 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
I got it from the file
applications/utilities/postProcessing/wall/wallGradU The formula which I referred from the file is: wallGradU.boundaryField()[patchi] = -U.boundaryField()patchi].snGrad(); |
|
June 26, 2011, 06:11 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
You dropped a crucial line:
Code:
forAll(wallGradU.boundaryField(), patchi) { wallGradU.boundaryField()[patchi] = -U.boundaryField()[patchi].snGrad(); } My advice to you is this: if you haven't done this before, do this tutorial first: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam If you follow that tutorial, you will learn valuable lessons about the OpenFOAM code! Good luck! Bruno
__________________
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile calcMassFlowC | aurore | OpenFOAM Programming & Development | 13 | March 23, 2018 07:43 |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 09:31 |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 12:34 |
How to get the max value of the whole field | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 17, 2008 05:07 |
Compiling problems with hello worldC | fw407 | OpenFOAM Installation | 21 | January 6, 2008 17:38 |