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

Question about field defintion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 1, 2009, 10:12
Default Question about field defintion
  #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
I have a question concerning the definition of fields, either vectorial or tensorial, for CFD calculations. In
particular, during my calculations I have to calculate the gradient of velocity field, by defintion a volVectorField,
using the formula

DU = fvc :: grad (U);

Both DU and U are defined in the file createFields.H, in the following form

// Reading the velocity field

Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Creating Velocity Gradient Tensorial Field\n" << endl;
volTensorField DU
(
IOobject
(
"DU",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(U)
);

This way, I ensure that in each mesh point I calculate correctly DU, right?

Other form could be doing the following

volTensorField DU = fvc :: grad ( U() );

I believe the first form is correct, although the second may work. Can anybody help me out?

Regards,

Titio
titio is offline   Reply With Quote

Old   July 6, 2009, 06:39
Default
  #2
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
Dear Titio,

Both forms are possible and the second will work if you delete the brackets on U.

volTensorField DU = fvc::grad (U);

Henrik
henrik is offline   Reply With Quote

Reply


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
External magnetic field data Richard Lee FLUENT 7 January 11, 2019 04:43
Initial velocity field in StarCCM+ Subhadeep Siemens 3 December 21, 2008 03:40
rerun with same flow field, different fluid props Tim Phoenics 0 March 3, 2004 14:51
question K.L.Huang Siemens 1 March 29, 2000 04:57
Question concering about validating Temperature field ghlee Main CFD Forum 1 December 1, 1998 12:36


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