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

Solving simultaneous algebraic equations for complex coefficients

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By Hisham
  • 2 Post By j-avdeev

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2012, 09:02
Default Solving simultaneous algebraic equations for complex coefficients
  #1
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
Dear Foamers,

I need to solve a system of linear equations using OpenFOAM (needed at each time step). The system has complex coefficients. I think the simpleMatrix is used for the solution of simultaneous linear algebraic equations.

Although the simpleMatrix::solve() returns a Field<type>
http://foam.sourceforge.net/docs/cpp...ce.html#l00074
Code:
00073 template<class Type>
00074 Foam::Field<Type> Foam::simpleMatrix<Type>::solve() const
00075 {
00076     scalarSquareMatrix tmpMatrix = *this;
00077     Field<Type> sourceSol = source_;
00078 
00079     Foam::solve(tmpMatrix, sourceSol);
00080 
00081     return sourceSol;
00082 }
It seems that it can solve only for real scalars. I need to solve for a complexField. Is it possible from within OF?

It would be nice if someone points me to an example of the simpleMatrix use?


Edit: As expected simpleMatrix works only for real scalars!

Best regards,
Hisham

Last edited by Hisham; May 9, 2012 at 09:50.
Hisham is offline   Reply With Quote

Old   January 19, 2014, 03:57
Default Dear Hisham
  #2
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Dear Hisham
I have the same problem
and I want to solve a system of linear equation with complex coefficients
do you find how can it be solved ?

Best Regards
mechy is offline   Reply With Quote

Old   January 19, 2014, 06:01
Default
  #3
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
Hi mechy,

The Armadillo project was my solution:

http://arma.sourceforge.net/


Hope it helps you too!

Best regards,
Hisham
Hisham is offline   Reply With Quote

Old   January 19, 2014, 10:09
Default
  #4
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Dear Hisham
you have used it separately or used it in openfoam ?
is it possible to use it in openfoam codes ?

Best Regards
mechy is offline   Reply With Quote

Old   January 19, 2014, 10:18
Default
  #5
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
In an OpenFOAM application, you just make sure that armadillo is installed on your system using Synaptic (or so). The lib names are: libarmadillo2 and libarmadillo-dev. You can try to compile it if you are more adventurous :-)

In the Make/options of your application add -larmadillo to EXE_LIBS:
Code:
EXE_LIBS = -lfiniteVolume \                                                                                                           
                      -larmadillo
Then follow the examples provided by the armadillo website. You would need to (of course) include proper armadillo headers to your app.

Best regards,
Hisham
hua1015 and scleakey like this.
Hisham is offline   Reply With Quote

Old   January 19, 2014, 11:40
Default
  #6
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
thanks for useful comments
Best Regards
mechy is offline   Reply With Quote

Old   January 19, 2014, 13:42
Default
  #7
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Dear Hisham
is it possible to couple OpenFoam and Aarmadillo
in other word, is it possible to transfer data between openfoam objects and Aarmadillo objects ?
Best Regards
mechy is offline   Reply With Quote

Old   March 1, 2014, 11:09
Default
  #8
Member
 
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 69
Blog Entries: 1
Rep Power: 21
j-avdeev will become famous soon enough
Send a message via Skype™ to j-avdeev
Probably will useful.

http://openfoamwiki.net/index.php/Ho...lo_in_OpenFOAM
wyldckat and anothr_acc like this.
j-avdeev is offline   Reply With Quote

Reply

Tags
algebraic, complex, complexfield, equations, simultaneous


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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 05:03
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 06:24
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 07:33.