|
[Sponsors] |
May 11, 2013, 15:57 |
Edit linear solver
|
#1 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Hi all,
How can i edit linear solvers (PCG,PBICG,...) of openfoam, then compile them? Regards. |
|
May 14, 2013, 16:34 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
Its open source so you can really do whatever you please with the linear solvers.
You might be better of starting with simpler OpenFOAM programming before diving into the linear solvers, it sounds like you are really just getting started... |
|
June 6, 2013, 05:19 |
|
#3 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
ok tanx for your attention, but please help me how can i do it?
i copy the linear solver, for example PBC directory, in my home then compile this by wmake, but there is not exist Make directory in the PCG directory for compiling! |
|
June 10, 2013, 13:53 |
compile openfoam linear solver
|
#4 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
hi all,
how an i compile linear solver of openfoam? for example, i copy PCG directory in my home then compile this by wmake, but there is not exist Make directory in the PCG directory for compiling! please help me. (i want edit this linear solver.) |
|
June 10, 2013, 14:30 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Hassan,
Please study the following pages, before continuing to try and modify a linear solver:
Good luck! Best regards, Bruno
__________________
|
|
July 18, 2013, 19:16 |
openfoam linear solver
|
#6 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Hi,
In order to create and use the new linear solver myPBiCG:
myPBiCG.C LIB = $(FOAM_USER_LIBBIN)/libmyPBiCG options: EXE_INC = -I$(OBJECTS_DIR) LIB_LIBS = \ $(FOAM_LIBBIN)/libOSspecific.o \ -L$(FOAM_LIBBIN)/dummy -lPstream \ -lz
But when I run the cavity by icoFoan, I recevie this error at the end of running the case: “Segmentation fault” Why? what is this error? how can i solve this error? |
|
July 19, 2013, 17:10 |
Hi all
|
#7 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
any body? please help me?
|
|
July 20, 2013, 19:49 |
|
#8 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
friends? please
|
|
July 21, 2013, 06:07 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Hassan,
People that usually can help here in the forum, only do it when they have some spare time. So, please be patient I followed your steps and as far as I can figure out, the only problem could be that you added too many things to the file "Make/options". Since I had the trouble to follow your steps and to create both the library and the test case, attached are both ready for testing. I used OpenFOAM 2.2.x, but should work fine on any 2.2. edit: next time you post code, please use the "[CODE]" marker, as exemplified in the second link on my signature. Best regards, Bruno
__________________
Last edited by wyldckat; July 21, 2013 at 06:07. Reason: see "edit:" |
|
July 21, 2013, 08:48 |
|
#10 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Greetings Bruno,
thank you very much Best regards, Hassan. |
|
August 18, 2013, 15:00 |
edit precontitioner
|
#11 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Hi,
After compile the new preconditioner(myDILUPreconditioner) Successfully in the same way for adding the new linear solver library(myPBiCG). I add to controlDict in the cavity/system directory: libs("libmyDILUPreconditioner.so"); and edite system/fvSolution to use myDILU instead of DILU. But I recevie this error: Code:
--> FOAM FATAL IO ERROR: Unknown asymmetric matrix preconditioner myDILUPreconditioner Valid asymmetric matrix preconditioners : 4 ( DILU GAMG diagonal none ) file: From function lduMatrix::preconditioner::New(const solver&, const dictionary&) in file matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C at line 123. FOAM exiting Best regards, Hassan. |
|
August 18, 2013, 15:04 |
|
#12 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Hassan,
Go into the folder where you have the "myDILUPreconditioner" source code and run: Code:
wclean all This way I'm able to tell you what you forgot to do. Best regards, Bruno
__________________
|
|
August 18, 2013, 15:11 |
|
#13 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
thank you,
source file is attached. |
|
August 18, 2013, 15:35 |
|
#14 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Hassan,
It's simple. Notice these two lines in the header file "*.H"? Code:
//- Runtime type information TypeName("DILU"); Code:
//- Runtime type information TypeName("myDILU"); Bruno
__________________
|
|
August 18, 2013, 15:43 |
|
#15 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Mr. Bruno
It,s OK! Thank You very very much best regards, Hassan |
|
August 22, 2013, 04:10 |
myPBiCG/Make/options
|
#16 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Greetings Bruno,
Why the options file of myPBiCG can be empty? I use two diffrence form of options file, but both of them seems true! What is the difference between options_1 and options_2 files that is attached? Best regards, Hassan. |
|
August 22, 2013, 06:47 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Hassan,
There are two details you need to check:
Bruno
__________________
|
|
August 22, 2013, 09:38 |
|
#18 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Thank you Mr. Bruno,
Yes, I run Code:
wmake libso Code:
wmake libso In the output, lines that start with "SOURCE", show occurrences that I added in the options file, but how can I find out which folders have headers files that should be added to the search list for the file being currently compiled? Best regards, Hassan |
|
August 22, 2013, 09:55 |
|
#19 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Well, whenever the compiler complains about not finding a header file, you can use the find command like this:
Code:
find $FOAM_SRC -name the_name_of_the_header_file.H
__________________
|
|
August 22, 2013, 11:16 |
|
#20 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Thank you Mr. Bruno
|
|
Tags |
compile, linear solver, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fatal overflow in linear solver (RSM) | Luis | CFX | 12 | October 16, 2019 18:36 |
How to avoid checkerboard? | dohnie | OpenFOAM Programming & Development | 7 | January 26, 2015 04:12 |
ERROR #004100018; Fatal overflow in linear solver | Attila | CFX | 1 | April 13, 2012 23:22 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 12:46 |
free C code for large sparse matrix linear solver | ztdep | Main CFD Forum | 7 | May 24, 2007 15:14 |