CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Definition of a variable in a class

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2012, 03:54
Default Definition of a variable in a class
  #1
New Member
 
Nilesh
Join Date: Sep 2012
Posts: 7
Rep Power: 14
u396852 is on a distinguished road
I am trying to define a variable in a following class.

Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::EllisLaw::calcNu() const
{

dimensionedScalar current_time(U_.time());
//.value());

const volScalarField& old_visc = U_.mesh().lookupObject<volScalarField>("visco_old" );

}

I want a variable AB which is "old_visc*strain_rate()".

I tried all the definitions for AB. (double, volScalarField etc)
but in all cases it gives compilation error for the definition.
The C++ file and the error message image is attached with the thread.
Please respond if any one has some comments on it.

Thanks and regards,
Nilesh
Attached Images
File Type: jpg error-message.jpg (91.0 KB, 23 views)
Attached Files
File Type: c EllisLaw.C (6.1 KB, 8 views)
u396852 is offline   Reply With Quote

Old   September 25, 2012, 04:19
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Please put ALL (or at least the first few) the error messages in your post. It is a bit difficult to read from the screenshot. Also, what is the return type of the function strainRate()? Is it volSymmTensorField? I would assume the type of a volScalarField*volSymmTensorField to be again volSymmTensorField?
Bernhard is offline   Reply With Quote

Old   September 25, 2012, 05:07
Default
  #3
New Member
 
Nilesh
Join Date: Sep 2012
Posts: 7
Rep Power: 14
u396852 is on a distinguished road
Thanks Bernhard for such a quich response.

The function strain_rate() returns "mag(fvc::grad(U_))".

I am attaching the full output of the command "wmake libso" in the error.txt file. Please let me know if you need any further information.

Thnaks and regards,
--
Nilesh
Attached Files
File Type: txt error.txt (14.7 KB, 5 views)
u396852 is offline   Reply With Quote

Old   September 26, 2012, 05:50
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
You're calling the function strain_rate(), but in the code it is called strainRate(), where is strainRate() defined exactly, and how? Also, I see an error message in line 89 of EllisLaw.C, but that line appears to be commented. And, why did you define AB and BC as const?
Bernhard is offline   Reply With Quote

Reply

Tags
definition of a variable, volscalarfield


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 11:36.