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

Basic question about forAll loop and volVectorField

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 9, 2014, 23:14
Default Basic question about forAll loop and volVectorField
  #1
Member
 
Tayo
Join Date: Aug 2012
Location: FL
Posts: 94
Rep Power: 4
tayo is on a distinguished road
Hello all, Pls I have two basic questions.
1.) What's the difference between the forAll loops below i.e. what's the effect of using the variable "A" with the index "celli"?

Code:
forAll (A,celli)
{
  if (A <= 1.0)
  {
  Talpha[A[celli]] = x[A[celli]]*y[A[celli]];
....
compared to solving as

Code:
  Talpha[celli] = x[celli]*y[celli];
2.) Given a surfaceVectorField, how can I transform it into a volVectorField? I've tried using fvc::reconstruct() but it makes my case blow up, guess it's only ideal for scalar field.

Thanks in advance for your help
tayo is offline   Reply With Quote

Old   January 10, 2014, 02:23
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
1-
A is array so A[celli] returns the value of A in the celli, for example celli is 1 but the value of A[celli] is 10, then T[A[celli]] equals T[10] and T[celli] equals T[1]

2- you can use forexample: surfaceSum, there are several else in programmer guide
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   January 10, 2014, 02:56
Default
  #3
Member
 
Tayo
Join Date: Aug 2012
Location: FL
Posts: 94
Rep Power: 4
tayo is on a distinguished road
Thanks for your quick response
tayo is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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



All times are GMT -4. The time now is 18:14.