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

Basic question about forAll loop and volVectorField

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 9, 2014, 23:14
Default Basic question about forAll loop and volVectorField
  #1
Member
 
Tayo
Join Date: Aug 2012
Posts: 94
Rep Power: 13
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 Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

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

Reply

Thread Tools Search this Thread
Search this Thread:

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



All times are GMT -4. The time now is 17:21.