
[Sponsors] 
Why doesnbt the macro forall work for the volVectorField variable 

LinkBack  Thread Tools  Display Modes 
February 23, 2006, 17:20 
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 
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])>25e3)((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 

February 24, 2006, 04:46 
The forAll macro works.
Try

#2 
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 17 
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; 

February 24, 2006, 16:27 
Hi, Dr. Mattijs:
Thank you

#3 
New Member
Siwen Xue
Join Date: Mar 2009
Location: Sherbrooke, QC, Canada
Posts: 2
Rep Power: 0 
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 

Thread Tools  
Display Modes  


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 07: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 04:45 
How does THREAD_STORAGE macro work?  Vishal  FLUENT  0  March 8, 2006 06:16 