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

A problem for equation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 27, 2011, 10:22
Default A problem for equation
  #1
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 7
bojiezhang is on a distinguished road
HI every former:
I have a problem about equation. Now I have a equation like this:
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- (add)
);
the function for "add" in the () is like this:
for X dirction: add(x)=x ; fro Y dirction: add(y)=u.component(y)*y; for Z dirction add(z)=0;
how can add for this? I really hope someone can heip me. Thank you in davance!

bojie zhang
bojiezhang is offline   Reply With Quote

Old   October 30, 2011, 03:24
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
first declare a volVectorField add variable, then loop over it and fill it with your values.
Quote:
forAll (add , celli)
{
add[celli] = vector (mesh.C()[celli].x() ,U[celli].y(),0.0);

}
then add it in your Eqn.
Quote:
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- (add)
);
of course i didn't have checked it, but its the general idea
nimasam is offline   Reply With Quote

Old   October 31, 2011, 04:52
Default
  #3
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 7
bojiezhang is on a distinguished road
Thank you very much! I will try it right now!
bojiezhang 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


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