|
[Sponsors] |
November 26, 2013, 06:43 |
cell volume error
|
#1 |
New Member
Join Date: Feb 2012
Posts: 25
Rep Power: 14 |
In my code I want to calculate the volume of each cell in the mesh to be used.
here below is the code: forAll(Y, celli) { cell_volume[celli]=mesh.V()[celli]; z_y=cell_volume[celli]*Y[indexCO2][celli]/wCO2; } But I get following compilation error: ::mesh’ does not have class type Can someone let me know what I am missing..do I need to add some header files etc. ?? |
|
November 26, 2013, 07:44 |
|
#2 | |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
may you want to try:
Quote:
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
||
November 26, 2013, 08:05 |
|
#3 |
New Member
Join Date: Feb 2012
Posts: 25
Rep Power: 14 |
still the same error
|
|
November 26, 2013, 08:19 |
|
#4 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
would you please post the whole error line
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
November 29, 2013, 06:29 |
|
#5 |
New Member
Join Date: Feb 2012
Posts: 25
Rep Power: 14 |
error: ‘U’ was not declared in this scope
mesh’ does not have class type I should mention that I am writing this code for thermal radiation modelling and only need to calculate volume of each cell in the mesh. regards, |
|
November 29, 2013, 06:39 |
|
#6 |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
It would be good if you could give some more information like:
Where do you implement this code? Solver, library, utility ...? Is this part of a function or just in main? And please use the 'CODE' tags when you post code or error messages (see http://www.cfd-online.com/Forums/ope...-get-help.html). |
|
November 29, 2013, 10:06 |
|
#7 |
New Member
Join Date: Feb 2012
Posts: 25
Rep Power: 14 |
I have attached the files to compile (put in /thermophysical models/radiation models/submodels/absorptionEmissionModel). I get following errors:
submodels/absorptionEmissionModel/mygreyMeanAbsorptionEmission/mygreyMeanAbsorptionEmission.C: In member function ‘virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::radiation::mygreyMeanAbsorptionEmission::aCo nt(Foam::label) const’: submodels/absorptionEmissionModel/mygreyMeanAbsorptionEmission/mygreyMeanAbsorptionEmission.C:235:29: error: ‘((const Foam::radiation::mygreyMeanAbsorptionEmission*)thi s)->Foam::radiation::absorptionEmissionModel::mesh’ does not have class type submodels/absorptionEmissionModel/mygreyMeanAbsorptionEmission/mygreyMeanAbsorptionEmission.C:237:2: error: ‘((const Foam::radiation::mygreyMeanAbsorptionEmission*)thi s)->Foam::radiation::absorptionEmissionModel::mesh’ does not have class type submodels/absorptionEmissionModel/mygreyMeanAbsorptionEmission/mygreyMeanAbsorptionEmission.C:239:3: error: ‘pathLength’ was not declared in this scope make: *** [Make/linux64GccDPOpt/mygreyMeanAbsorptionEmission.o] Error 1 |
|
November 29, 2013, 10:28 |
|
#8 |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Without looking much further into your code, I see there a quite wild mix of 'mesh', 'mesh()' and 'mesh_' throughout your code.
Here some hints on how to fix it: The object 'mesh' is only defined in the constructor and can hence only be used there, i.e. Code:
Foam::radiation::mygreyMeanAbsorptionEmission::mygreyMeanAbsorptionEmission ( const dictionary& dict, const fvMesh& mesh ) { ... } Code:
this->mesh() Oh and btw, please read this: http://www.cfd-online.com/Forums/ope...-get-help.html Especially, always post proper error messages and use 'CODE' tags! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile calcMassFlowC | aurore | OpenFOAM Programming & Development | 13 | March 23, 2018 07:43 |
Errors in UDF | shashank312 | Fluent UDF and Scheme Programming | 6 | May 30, 2013 20:30 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 09:56 |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 12:34 |
On the damBreak4phaseFine cases | paean | OpenFOAM Running, Solving & CFD | 0 | November 14, 2008 21:14 |