# Adding equations to existing solvers

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

 July 9, 2012, 09:46 Adding equations to existing solvers #1 Member   Join Date: Mar 2012 Location: Munich, Germany Posts: 67 Rep Power: 7 Sponsored Links Hello, 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 while(runtime.run()) { ... calculations rhoCentralFoam ... // definition factors a11 = pow(rhoU.component(0),2) + pow(rhoU.component(1),2); a12 = rhoE; and so on. // building matrices // solving equation } To my problems: problem1: 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. problem2: 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. problem3: 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. Thanks! Best regards treima Last edited by treima; July 10, 2012 at 02:23.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Hisham OpenFOAM Programming & Development 8 November 27, 2015 06:14 pete Site Help, Feedback & Discussions 20 June 16, 2015 13:52 jbvw96 OpenFOAM Running, Solving & CFD 2 December 26, 2010 18:16 bunni OpenFOAM 1 November 4, 2010 14:03 Carola CFX 9 August 12, 2003 08:27