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

How to add a summison term in the source code

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 8, 2010, 01:03
Default How to add a summison term in the source code
  #1
Senior Member
 
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 7
nakul is on a distinguished road
Hi,
I want to add a term like: Σaibi; i=1,2,...,n to a solver's governing equations.
Is there any inbuilt function in
openfoam that can be used to sum the individual terms

I don't think I can use for loop to add the terms because the values of these parameters are obtained simultaneoulsy by the solution of the governing equations.

Any help would be appreciated!!

Thanx


nakul is offline   Reply With Quote

Old   November 8, 2010, 05:28
Default
  #2
Senior Member
 
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 7
stevenvanharen is on a distinguished road
if a and b are vectors you can use the inner product operator

look at page 18 and 23 of the programmer's guide.
stevenvanharen is offline   Reply With Quote

Old   November 8, 2010, 08:00
Default
  #3
New Member
 
Patricia
Join Date: Oct 2010
Posts: 22
Rep Power: 6
schmittp54 is on a distinguished road
I am not sure if I understand your question correctly.

If both the ai and bi are part of your solution vector and you solve an equation including a*b on the left hand side (like M(a,b)+a*b=c), this is a nonlinear equation. Linearize the equation and you will be able to add the linearized expression for a*b as a source term.

Patricia
schmittp54 is offline   Reply With Quote

Old   November 9, 2010, 01:38
Default
  #4
Senior Member
 
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 7
nakul is on a distinguished road
Hi Patricia,

To be more specific I want to code the energy equation for combustion. The energy equation is in the form, shown in the attached screenshot.

The "summision" term that I want to code is the equ. (1. 48) in the screenshot. And this energy equation needs to be solved simultaneously with continuity, momentum and species equations.

So my question is how can I code this term in the OpenFOAM's source code?
I would be adding this term to the energy equation of rhoCentralFoam.
Attached Images
File Type: jpg Screenshot.jpg (43.5 KB, 36 views)
nakul is offline   Reply With Quote

Old   November 9, 2010, 04:56
Default
  #5
New Member
 
Patricia
Join Date: Oct 2010
Posts: 22
Rep Power: 6
schmittp54 is on a distinguished road
Hi Nakul,
unfortunately the screenshot is still not a complete description of the problem. Maybe you can start coding a solver using similar principles as in the existing OpenFoam solvers. Then describe where your solver fails, and people will be able to assist.
If you want to solve for all variables simultaneously, you have to wait until OpenFoam supports block matrices, and even then you have to linearize the problem. But I don't see why you'd need block matrices. Why not start with a loop summing over the species instead of giving up before you have tried?

Patricia
schmittp54 is offline   Reply With Quote

Old   November 9, 2010, 05:17
Default
  #6
Senior Member
 
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 7
nakul is on a distinguished road
Hi Patricia,

Actually I was just mentioning the equation, that I want to code, in the screenshot.

The problem is that I am unaware of the correct way to code that summision term in the solver.
All I want to know is that, .if there is some way to add such summision terms.

I don't think that for loop is a correct option because at every time step the values of Yk, ie, the species mass fraction is unkown. They are the variables that are being solved for.

So adding them using a loop might not generate any result.
nakul is offline   Reply With Quote

Old   November 9, 2010, 06:36
Default
  #7
New Member
 
Patricia
Join Date: Oct 2010
Posts: 22
Rep Power: 6
schmittp54 is on a distinguished road
Quote:
Originally Posted by nakul View Post
Actually I was just mentioning the equation, that I want to code, in the screenshot.
Yes, but an equation is not a problem description.

Quote:
Originally Posted by nakul View Post
I don't think that for loop is a correct option because at every time step the values of Yk, ie, the species mass fraction is unkown. They are the variables that are being solved for.
I think you should try things out before you think they don't work. Many of the existing solvers show how to solve for variables that are needed simultaneously. Most of them use the segregrated approach which I think will work for you as well. If you don't want to spend any time by yourself, there are companies behind OpenFoam who can do the work for you (no, I am not affiliated to any).

I am out of this discussion. Good luck!

Patricia

Edit: You cannot solve for the Yk from equation 1.48. You need at least N additional equations (transport equations with reaction kinetics?) to get a well posed problem.

Last edited by schmittp54; November 9, 2010 at 07:06.
schmittp54 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 source term Rajani Kanth.B Fluent UDF and Scheme Programming 4 May 1, 2013 09:31
Add time dependent Source term libe OpenFOAM Running, Solving & CFD 13 September 23, 2010 09:12
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
Please help me run UDF code for source Suga FLUENT 1 February 3, 2006 04:40
Add a source term into the Y mom. eq. Rucy FLUENT 0 December 12, 2005 05:24


All times are GMT -4. The time now is 16:23.