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

Why doesnbt the macro forall work for the volVectorField variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2006, 17:20
Default Hi, Everyone: I am a new u
  #1
New Member
 
Siwen Xue
Join Date: Mar 2009
Location: Sherbrooke, QC, Canada
Posts: 2
Rep Power: 0
siwen is on a distinguished road
Hi, Everyone:

I am a new user of OpenFoam. I am trying to use OpenFoam to model the axisymmetrical inductive plasma torch. In my computational domain, there are many different regions. In some regions I need to set the velocity to zero because they are solid. So after solving the momentum equations I use the following macro to set velocity to zero.
forAll(U, cellI)
{
U[cellI].component(vector::Z)=0.0;
if(((yb[cellI])>25e-3)||((xb[cellI]<0.05)&&(yb[celli]>0.019)&&(yb[cellI]<0.021)) )
{
U[cellI].component(vector::X)=0.0;
U[cellI].component(vector::Y)=0.0; }
}

where the xb and yb are defined as:
const vectorField& centres = mesh.C();
scalarField xb = centres.component(vector::X);
scalarField yb = centres.component(vector::Y);
But this macro doesn't work. In the region I set the velocity to zero, they are not zero(very big value).

When I use "forall" micro to set temperature in some region it works very well.

Why doesn't the macro "forall" work for the volVectorField variable?
Can anyone help me to solve this problem?

Thank you very much!

Siwen Xue
siwen is offline   Reply With Quote

Old   February 24, 2006, 04:46
Default The forAll macro works. Try
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
The forAll macro works.

Try printing out the value of U[cellI] after you have changed it to find your problem:

Pout<< U[cellI] << endl;
mattijs is offline   Reply With Quote

Old   February 24, 2006, 16:27
Default Hi, Dr. Mattijs: Thank you
  #3
New Member
 
Siwen Xue
Join Date: Mar 2009
Location: Sherbrooke, QC, Canada
Posts: 2
Rep Power: 0
siwen is on a distinguished road
Hi, Dr. Mattijs:

Thank you very much for your prompt answer. I found the problem. It was the code in another file for the continuity (rho) equation which correct the velocity. And there the velocity is given another value. Now my program works very well.

Sorry I have another question to bother you! I worked on the axisymmetrical system. I create my geometry in 5 degree and I set both front and back surface as wedge. But OpenFoam solves vector form of momentum equation.
My question is what kind of component equations OpenFoam solve, the component equations in rectangular coordinate system or the component equations in cylindrical coordinate system?. They are quite different in the two coordinate system?

Thank you very much!

Siwen Xue
siwen 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
Tensor mathematics forAll macro combination tensors with vectors olesen OpenFOAM Running, Solving & CFD 4 February 25, 2009 06:03
Why the noslip doesnbt work corenc OpenFOAM Running, Solving & CFD 9 August 26, 2008 08:26
Why my code is ok with single processor but doesnbt work in openmpi xiuying OpenFOAM Running, Solving & CFD 0 November 23, 2007 14:44
Install doesnbt work hplum OpenFOAM Bugs 7 August 14, 2007 05:45
How does THREAD_STORAGE macro work? Vishal FLUENT 0 March 8, 2006 06:16


All times are GMT -4. The time now is 05:31.