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

Adding source term involving derivative in y direction

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By iqbalsk8
  • 1 Post By iqbalsk8

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2013, 13:51
Default Adding source term involving derivative in y direction
  #1
New Member
 
Sohail
Join Date: Mar 2012
Posts: 11
Rep Power: 14
iqbalsk8 is on a distinguished road
Hi everyone,

I want to add a new transport equation to simpleFoam.
The source term looks like Sw = nu/pow(y,2) * dw/dy
where y is the y-coordinate of the cell and
dw/dy is the derivative in the y-direction.

fvScalarMatrix UwEqn
(

fvm::div(phi, w)
- fvm::laplacian(nu, w)
- Sw
);

My confusion is to get the derivative in a one direction not to calculate the
whole gradient.

Can anybody give me an idea how to achieve this.

regards,

Sohail
Luttappy likes this.
iqbalsk8 is offline   Reply With Quote

Old   February 22, 2013, 15:10
Default
  #2
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
If i'm correct you may get the gradient only in the explicit way which would be:
vectorField gradU=fvc::grad(w)
then you can extract the desired component by:
scalarField dwdy=gradU.component(vector::Y)
I may not be correct in spelling or own the best way, but this should work
anishtain4 is offline   Reply With Quote

Old   February 24, 2013, 09:31
Default
  #3
New Member
 
Sohail
Join Date: Mar 2012
Posts: 11
Rep Power: 14
iqbalsk8 is on a distinguished road
Dear Hosseinali,

Thankyou for giving time to answer. I also thought the same and
it works fine.
But now I have another problem. I have a term
Sw = (Uy * w)/y

where Uy is the y component of velocity
and y coordinate.

Can this term be put in UwEqn as,

fvm::Sp(Uy/y, w)

where Uy=U.component(vector::Y)

Best regards,

Sohail
iqbalsk8 is offline   Reply With Quote

Old   February 25, 2013, 05:20
Default
  #4
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
Just from the top of my head, when you are using the SIMPLE every equation is being solved separately, also in source term of your equation for UwEqn there is no Uw (Uy is being considered known from previous step) so I think there would be no difference if you use fvm or mention it explicitly
anishtain4 is offline   Reply With Quote

Old   February 25, 2013, 10:30
Default
  #5
New Member
 
Sohail
Join Date: Mar 2012
Posts: 11
Rep Power: 14
iqbalsk8 is on a distinguished road
Dear Hosseinali,

I tried to put the term

Sw = (Uy * w)/y

with fvm::Sp and explicitely. but in both cases the value of Sw tends to infinity
after 500 iterations approximately.

I am using OpenFOAM-1.6-ext. I am simulating a 2D axisymmetric case.
Where this new transport equation calculates the swirl-component
of velocity.

Please have a look at the file.
If you want the whole case file, I can also send you that...

regards,

Sohail
Attached Files
File Type: h wEqn.H (637 Bytes, 48 views)
Luttappy likes this.

Last edited by iqbalsk8; February 25, 2013 at 11:48.
iqbalsk8 is offline   Reply With Quote

Old   March 2, 2013, 11:39
Default
  #6
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
I'm not sure how this affects your stability, All I'm saying is that with the solver you chose this term would have same effect explicitly or implicitly on the solution.
anishtain4 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
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44
lid-driven cavity in matlab using BiCGStab Don456 Main CFD Forum 1 January 19, 2012 16:00
derivative of source term denise Fluent UDF and Scheme Programming 1 October 29, 2009 05:41
UDF Source Term Units? Brian FLUENT 1 October 24, 2005 10:15


All times are GMT -4. The time now is 01:49.