# Coupled equations solution

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 14, 2007, 07:19 Hi I have few transport equat #1 litonx Guest   Posts: n/a Hi I have few transport equations which are coupled. coupling is only in the source term. Does the following method is okay. time loop { solve(eqn1=x1*x2); solve(eqn2=x1*x3); .. solve(eqnN=x2*xn); } Does it mean sense. here eqn1..N all the transport equations of variable x1..N. or is it possible to use a vector of length N as a variable in the transport equation. In such case, RHS would be a Matrix(N*N) and a vector(N) multiplication. any suggestions!! Regards -Liton

 February 14, 2007, 07:29 I think that you will have to #2 Senior Member   Gavin Tabor Join Date: Mar 2009 Posts: 181 Rep Power: 9 I think that you will have to solve the equations sequentially. The only issue would be if you need to loop around the transport equations because of the coupling. Block solution would be cool, but would only be possible if someone was willing (and able) to template fvm to accept a field of arbitrary data type - something I thought about years ago but quickly decided was beyond my programming ability. Gavin

 February 14, 2007, 07:43 Hi Gavin, Actually, you are #3 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,783 Rep Power: 22 Hi Gavin, Actually, you are trampling all over my "work in progress" :-) This has been done recently, it is not in a public domain yet but it will eventually get there. You can get the gist from the top-level code organisation - the quoted stuff will do conjugate heat transfer in 2 regions connected by a coupled boundary conditions on the boundary. The code allows you to couple as many equations as you like, across as many variables as you like, which are then solved as a "ganged" matrix. coupledFvScalarMatrix TEqns(2); TEqns.hook ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DT, T) ); TEqns.hook ( fvm::ddt(Tsolid) - fvm::laplacian(DTsolid, Tsolid) ); TEqns.solve(); Enjoy, Hrv __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 February 14, 2007, 08:10 Hi Hrv. Am I right that you ar #4 Senior Member   Gavin Tabor Join Date: Mar 2009 Posts: 181 Rep Power: 9 Hi Hrv. Am I right that you are lumping the individual matrices together? So the arrangement of data in the vector would be (T1 T2 T3 .... Ts1 Ts2 Ts3...) and the uber-matrix be comprised of 2 (or more) NxN matrices? Looks good. Sorting out the storage of the uber-matrix must be a nightmare though. What I was thinking about was more basic; templating the basic matrix routines to operate on any data type. The vector then becomes a vector of subvectors ((T1 Ts1) (T2 Ts2) (T3 Ts3) .....) and the matrix an NxN matrix of (in this case) 2x2 submatrices. This would be a really cute way of doing things - but templating the whole lot would be a nightmare. Gavin

 February 14, 2007, 08:18 Hi Hrvoje, I can't tell you h #5 Member   Ivor Clifford Join Date: Mar 2009 Location: Switzerland Posts: 91 Rep Power: 9 Hi Hrvoje, I can't tell you how excited I am to hear about the coupledFvScalarMatrix class you are working on. Its exactly what I've been looking for. Even though it's not in the public domain yet, is it available in the development version for us to start playing around with? Regards, Ivor

 February 14, 2007, 08:49 Hi Hrv As I mentioned before, #6 litonx Guest   Posts: n/a Hi Hrv As I mentioned before, I want to deal with few coupled equations, the coupledFvScalarMatrix class would help me a lot. Therefore, I have the same request like Ivor Clifford Regards, -Liton

 February 14, 2007, 14:52 Hi Gavin, Actually, the tem #7 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,783 Rep Power: 22 Hi Gavin, Actually, the templating is done as well. You can now have component-coupled vector and tensor variables, for implicit div-grad-transpose terms and similar. I have done bending-dominated linear stress analysis in 1 solver call, which was the original objective. For the things you wish to do, I'm not sure which approach is better. Multi-phase will like the matrix coupling; otherwise you have to invent new "multiple vector together" variables, which looks ugly in the top-level code. FOr example, imagine what it feels like to calculate a gradient of a variable in a compressible density-based solver (rho, rhoU, rhoE). The middle one out of 5 is a vector so a grad of this thingy is going to be ugly... In any case, the solvers are working, parallelism is cooking and in general I am getting there. The real power is when you put all components together. As for the code, I have to say I feel a bit like the Pinball Wizzard: both are very very clean and actually tidy up a lot of existing mess as well. Enjoy, Hrv __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 February 14, 2007, 19:31 Hi Gavin, >>I think that yo #8 litonx Guest   Posts: n/a Hi Gavin, >>I think that you will have to solve the equations sequentially. I have written my code sequentially as mentioned early. Is it Okay. What you think. I am bit doubt that each solutions here are individual. therefore no coupling is done. >>The only issue would be if you need to loop around the transport equations because of the coupling. I could not understand what you want to mean? Hrv, Could you please tell me, how to get your newly created coupledFvScalarMatrix class. Regards -Liton

 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 nandiganavishal OpenFOAM Running, Solving & CFD 4 November 22, 2008 17:43 nandiganavishal OpenFOAM Running, Solving & CFD 1 November 12, 2008 23:47 chris1980 OpenFOAM Running, Solving & CFD 7 August 25, 2006 08:18 Renaud FLUENT 3 May 24, 2006 10:39 Wenca CD-adapco 1 December 19, 2004 14:47

All times are GMT -4. The time now is 00:04.

 Contact Us - CFD Online - Top