
[Sponsors] 
October 8, 2011, 19:03 
Linear Solver

#1 
Member
Join Date: Jan 2010
Posts: 44
Rep Power: 8 
Assuming one linear system AX=B, where A is a matrix of NxN and B is a vector, A and B are known and vector X is unknown. How to use the linear solver in OpenFoam to solve this linear system?


October 8, 2011, 20:28 

#2 
Member
Join Date: Jan 2010
Posts: 44
Rep Power: 8 
I thought that two fields of X and B are probably created first as
Info<< "Reading field T\n" <<endl; volScalarField X ( IOobject ( "X", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); while I don't know how to set up B since it is known. Another question is how to set an equation to solve fvScalarMatrix XEqn ( A(X) ???? ); XEqn.solve(); If this step is properly handled, it could be easy to set up linear solver and preconditioner in fvSolution Any idea on this problem? 

October 8, 2011, 21:36 

#3 
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 420
Rep Power: 15 
Argen, X and B creating is just as you showed in the post. Respect the matrix, as far as I know the problem is that fvMatrices in FOAM are ever related to a geometrical problem and its discretization, so that is not possible to create them only from their coefficients and positions in the matrix (Both fvMatrix and lduMatrix don't have constructors from elements and positions). It requires to use the lduAddressing at low level and would require to code your own classes to do so.
Please FOAMers correct me if I'm wrong. Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Postdoctoral Fellow Research Center for Computational Mechanics (CIMEC)  CONICET/FICHUNL T.E.: 543424511594 Ext. 1005 Güemes 3450  (3000) Santa Fe Santa Fe  Argentina http://www.cimec.org.ar 

October 10, 2011, 01:17 

#4  
Member
Join Date: Jan 2010
Posts: 44
Rep Power: 8 
Quote:
Do you have more suggestions on it? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Dealing with BC's in OF 1.6  vkrastev  OpenFOAM Running, Solving & CFD  5  September 4, 2012 11:58 
ERROR #004100018; Fatal overflow in linear solver  Attila  CFX  1  April 13, 2012 22:22 
What's the difference between a linear and a nonlinear solver?  bearcat  Main CFD Forum  1  February 5, 2010 08:11 
free C code for large sparse matrix linear solver  ztdep  Main CFD Forum  7  May 24, 2007 14:14 
linear solver failure when using SST model  fanzhong Meng  CFX  4  March 21, 2006 21:16 