CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Adding equations to existing solvers

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

LinkBack Thread Tools Display Modes
Old   July 9, 2012, 09:46
Default Adding equations to existing solvers
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 5
treima is on a distinguished road

I want to add some equations to existing solvers, at the moment to rhoCentralFoam. The difficulties in this task is the dependency of factors from the calculated values in rhoCentralFoam.

I like to add this equation:
A, B matrices (4x4), L a vector (which should be calculated).

A * dL/dx + B * dL/dy = 0.

and the coefficents from A and B consists of

a11 = func(rhoE,rhoU.components(0),rhoU.components(1)).
a12 = func(rhoE,rhoU.components(0),rhoU.components(1)).
and so on, the same for B.

In Code it looks like

... calculations rhoCentralFoam ...

// definition factors
<problem1> a11 = pow(rhoU.component(0),2) + pow(rhoU.component(1),2);
<problem1> a12 = rhoE;
and so on.

// building matrices

// solving equation

To my problems:

the matrix coefficents are scalars, but which datatyp is the best one? I thought of volScalarField, because for example rhoE and the components of rhoU are volScalarField, too. I have to deal with the components of rhoU, because I couldnīt find a vectorial notation.

How can I intialise the matrix? Taking the tensor-class seems not to be an option, because Iīve a 4x4 matrix and gives an error: "attempted to assign to a const reference to constant object" while performing the program.

The last point is the equation. If to find a implementation for the partial derive of L to x and multiplicate this with a matrix. The same for y. For this step I havenīt tried very much things, because Iīve problems building my matrix. But one thing is, for solving in need fvc::ddt(L). This means Iīve to be careful with the dimensions.

Perhaps anybody can help me with some of my problems and my description is not to confusing . Maybe there is another, and better one, entrance to this problem. Iīm open for every suggestion.


Best regards


Last edited by treima; July 10, 2012 at 02:23.
treima is offline   Reply With Quote


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
Adding porous zones to compressible multiphase solvers Hisham OpenFOAM Programming & Development 8 November 27, 2015 06:14
Guide: Writing Equations in LaTeX on the CFD Online Forums pete Site Help, Feedback & Discussions 20 June 16, 2015 13:52
Help with chtMultiRegionFoam jbvw96 OpenFOAM Running, Solving & CFD 2 December 26, 2010 18:16
adding features to elements of an existing mesh? bunni OpenFOAM 1 November 4, 2010 14:03
Solver Equations Carola CFX 9 August 12, 2003 08:27

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