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

Problem in the calculation of function

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 19, 2009, 14:43
Default Problem in the calculation of function
  #1
Senior Member
 
Antonio Martins
Join Date: Mar 2009
Location: Porto, Porto, Portugal
Posts: 112
Rep Power: 17
titio is on a distinguished road
Send a message via MSN to titio Send a message via Skype™ to titio
Hi all,

I have a problem where I have to calculate the value of a scalar function func, in the form

func=1+A*tr(tensor1)

where A is a scalar constant, tensor is a volume tensorial field, and func is scalar field.

In the createFields.h file I included the following line

volScalarField trac_tensor
(
IOobject
(
"trac_tensor",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
tr(tensor)
);

volScalarField func
(
IOobject
(
"func",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
1.0 + A*trac_tensor
);

I have considered that the trace of tensor generates a scalar field. Although it compiles fine and the code runs, when I check the values given by func_lin, I noted that it is always returning one. The value of A is defined and the components of the tensor change, but, func_lin never changes.

Am i doing something wrong? How I should do the calculation of func?

Antonio Martins
titio is offline   Reply With Quote

 


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
problem in drag force calculation M.Hasib FLUENT 1 March 16, 2009 12:01
Wall function calculation of tau_wall KRK FLUENT 0 October 30, 2007 13:50
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23
Warning 097- AB Siemens 6 November 15, 2004 04:41
Stream function in axisymmetrical problem Daniel Siemens 0 September 8, 2003 11:20


All times are GMT -4. The time now is 23:55.