CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to solve an algebraic system of equations

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2020, 09:50
Default How to solve an algebraic system of equations
  #1
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
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
That I assume is the correct expression. During my steady-state simulations I have to relax the X calculated value as it tends to grow, but at the end it stabilizes. This happens when I am using a k-epsilon model. The tensor A takes into account the gradient of velocity, k and epsilon.

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 k-epsilon 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?
Attached Images
File Type: png cond_number_impingingJet_kepsilon.png (43.5 KB, 10 views)
File Type: png cond_number_impingingJet_ebrsm.png (11.2 KB, 9 views)

Last edited by agustinvo; July 13, 2020 at 10:56.
agustinvo is offline   Reply With Quote

Old   July 14, 2020, 11:31
Default
  #2
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
I have been playing around with different methods to solve the system of equations (using the Test-Matrix 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:
  • Eddy viscosity model: the ratio k/epsilon (time scale) is around 5
  • Reynolds stress model: the ratio grows up to 10
  • ¿The reason? the calculated epsilon value at that location is much lower on the Reynolds Stress model
The next movement should be revise the epsilon calulation
agustinvo is offline   Reply With Quote

Old   July 14, 2020, 14:42
Default
  #3
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
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 eddy-viscosity models.


I hoped you enjoyed this thread as much as I when guessing the error.


Cheers,
Agustín
agustinvo is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
algebraic equations in OpenFOAM reverseila OpenFOAM Pre-Processing 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


All times are GMT -4. The time now is 22:16.