|
[Sponsors] |
May 19, 2009, 15:43 |
Problem in the calculation of function
|
#1 |
Senior Member
|
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 |
|
May 20, 2009, 10:18 |
|
#2 |
Senior Member
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18 |
the code looks fine
one question though- are you updating the values during the simulation? the createFields.h is called once at the beginning of the simulation before the main loop. It initiates the values, sets them for automatic reading/writing but does not set any automatic refreshment of the values. maybe if you put something like: Code:
trac_tensor=tr(tensor); func=1.0 + A*trac_tensor; otherwise it will be always only the ones which were initiated Pawel |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem in drag force calculation | M.Hasib | FLUENT | 1 | March 16, 2009 13:01 |
Wall function calculation of tau_wall | KRK | FLUENT | 0 | October 30, 2007 14:50 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 09:23 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |
Stream function in axisymmetrical problem | Daniel | Siemens | 0 | September 8, 2003 12:20 |