# Matrix and Varialbe Definition

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

 July 12, 2012, 02:51 Matrix and Varialbe Definition #1 Member   Join Date: Mar 2012 Location: Munich, Germany Posts: 67 Rep Power: 7 Hello, is it possible to define a 5x5 matrix in OpenFoam? If yes, how? The same question is, if there is a possibility to define a vector with 5 components? But Iīve to make this definition in "createFields.H" I would like to solve the equation where A,B,C are 5x5 matrices and v a 5x1 vector. Best regards treima

 July 13, 2012, 02:27 #2 Senior Member   Kathrin Kissling Join Date: Mar 2009 Location: Besigheim, Germany Posts: 134 Rep Power: 10 Is it just the equation or are you going to solve that on a finite-volume grid? In Version 1.6-ext there is support for NxN matrices. You might want to check this out! Best Kathrin

 July 13, 2012, 02:49 #3 Member   Join Date: Mar 2012 Location: Munich, Germany Posts: 67 Rep Power: 7 Thanks. Iīd like to solve that one the grid for v, yes. Iīve tried to divied this into three equations like the density, momentum and energy equation like the "normal" way, but they are coupled. Have you ever tried this with OpenFoam 2.1.0, too? Or have you any experience if there is support, too? And the last question . Do you know how it is done in 1.6-ext? Best treima

 August 10, 2012, 03:23 #4 Member   Join Date: Mar 2012 Location: Munich, Germany Posts: 67 Rep Power: 7 Hello, I didnīt work on this for a while, but now Iīve found some possiblities and, of course, new problems. Here ist my partial differential equation system, which i like to solve: Iīve defined the matrices via Matrix jacobi_f(5,5), jacobi_g(5,5), jacobi_h(5,5); and assigned the elements via jacobi_f[i][j] = functions; and so on. My problem is now, how to deal with vectors of dimension five. Itīs not possible to define a five-dimensional volVectorField and to combine this with my matrices. Is it possible to solve the five dimensional coupled system with OpenFoam? If yes, how can this be done? Do you have any ideas? regards, treima

 August 10, 2012, 03:32 #5 Senior Member   Kathrin Kissling Join Date: Mar 2009 Location: Besigheim, Germany Posts: 134 Rep Power: 10 Check out the VectorN class in 1.6-ext. There is no such thing in the vanilla version. Sorry Best Kathrin

 August 10, 2012, 05:05 #6 Member   Join Date: Mar 2012 Location: Munich, Germany Posts: 67 Rep Power: 7 Thanks a lot for this quick reply! Iīve to make some changes in my solver for using it with 1.6-ext. But do you know an existing solver where VectorN is used?

 August 10, 2012, 05:14 #7 Senior Member   Kathrin Kissling Join Date: Mar 2009 Location: Besigheim, Germany Posts: 134 Rep Power: 10 Hey treima, in 1.6-ext there is blockCoupledScalarTransportFoam documentation and application of the tecnique can be found in Ivor Cliffords work (6th OFW training material) and in my work (see this years OFW presentation slides) Best Kathrin

 August 11, 2012, 07:36 #8 Senior Member     Hisham Elsafti Join Date: Apr 2011 Location: Braunschweig, Germany Posts: 253 Blog Entries: 10 Rep Power: 10 Hello I think you can go around your problem in OF 2.x by dividing your equation into 5 scalar equations and solve each separately. I mean the interaction-terms can be treated explicitly and you iterate to converge (the segregated way) Regards, Hisham

 August 14, 2012, 02:30 #9 Member   Join Date: Mar 2012 Location: Munich, Germany Posts: 67 Rep Power: 7 Hello, Iīve thought about this, too. But the five equations are coupled with each other, so that it isnīt possible to extract parts with less then four variables and I think. In OpenFOAM you canīt solve equations with more than one variable, right? Perhaps I didnīt understand this solution, but at the moment I canīt see your point Thanks Kathrin for hints, Iīll have a closer look at the blockCoupled-solver and try to extend this one for five equations! Regards treima