
[Sponsors] 
How to solve an algebraic system of equations 

LinkBack  Thread Tools  Search this Thread  Display Modes 
July 13, 2020, 09:50 
How to solve an algebraic system of equations

#1 
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Fuenlabrada
Posts: 308
Rep Power: 13 
Hi,
I have a system of linear equations like A·X=B that I am able to solve by the expression: Code:
X = inv(A) * B However, when I move to a Reynolds stress model and I try to compute X it always diverges. Checking on the internet, I found the condition number of a matrix (the closest to 1, the easier is to have a reasonable result for X), and this value is more or less ok when running the kepsilon model, but it explodes whan applying the Reynolds stress model. (Please see attached figures) I have read that preconditioners are used to reduce the condition number when running numerical simulations. OpenFOAM has already some of then and they are applied before solving the PDE's iteratively. In my case I only have to solve it once has I do not have non linear elements. Is it possible to call a solver to use ir for linear equations? Last edited by agustinvo; July 13, 2020 at 10:56. 

July 14, 2020, 11:31 

#2 
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Fuenlabrada
Posts: 308
Rep Power: 13 
I have been playing around with different methods to solve the system of equations (using the TestMatrix inside the OF code), but the problem persists. I think the problem is more related to the A matrix values rather than a numerical problem.
I have been checking the results given by to different simulations:


July 14, 2020, 14:42 

#3 
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Fuenlabrada
Posts: 308
Rep Power: 13 
I found out the problem: inside the volTensorField A there where negative elements on the diagonal, and computing the inverse of it was giving errors (large condition number for tensor A).
I changed the coefficient model that affects the tensor construction and it works well! I might be a configuration to be taken into account when using Reynolds stress models instead of eddyviscosity models. I hoped you enjoyed this thread as much as I when guessing the error. Cheers, Agustín 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
algebraic equations in OpenFOAM  reverseila  OpenFOAM PreProcessing  2  July 10, 2020 16:58 
How to Solve System of Partial Differential Equations  HumanistEngineer  Main CFD Forum  9  June 7, 2019 20:39 
How to solve this coupled triangular system  Tushi  System Analysis  1  October 23, 2017 17:32 
Solving System of Linear equations  shchepan  OpenFOAM  13  December 5, 2013 11:40 
Solver for system of hyperbolic equations  treima  OpenFOAM Programming & Development  1  October 21, 2012 10:34 