Edit linear solver
Hi all,
How can i edit linear solvers (PCG,PBICG,...) of openfoam, then compile them? Regards. |
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... |
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! |
compile openfoam linear solver
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.) |
Greetings Hassan,
Please study the following pages, before continuing to try and modify a linear solver:
Good luck! Best regards, Bruno |
openfoam linear solver
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? |
Hi all
any body? please help me?
|
friends? please
|
1 Attachment(s)
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 |
Greetings Bruno,
thank you very much:) Best regards, Hassan. |
edit precontitioner
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: Best regards, Hassan. |
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 |
1 Attachment(s)
thank you,
source file is attached. |
Hi Hassan,
It's simple. Notice these two lines in the header file "*.H"? Code:
//- Runtime type information Code:
//- Runtime type information Bruno |
Mr. Bruno
It,s OK! Thank You very very much:) best regards, Hassan |
myPBiCG/Make/options
1 Attachment(s)
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. |
Hi Hassan,
There are two details you need to check:
Bruno |
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 |
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 |
Thank you Mr. Bruno:):):)
|
Matrix in OpenFoam
Hello Mr. Bruno
According to the reference that it's address link is below, in page 53; http://www.diva-portal.org/smash/get...T01.pdf I can,t undrestand that what is the placeholder matrix in openFoam? and how get this equations: u(0)=[2,0] u(1)=[3,1] l(0)=[0,2] l(1)=[1,3] UpperAddr=(2,3) LowerAddr=(0,1) If it is possible for you, please explain a little about this concept. Best regards, Hassan |
Hi Hassan,
Sorry, but this is beyond my experience level. My suggestion is that you'll have to search for more information on this topic, possibly among the reference thesis made around OpenFOAM and the OpenFOAM Programmers Guide: http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf Good luck! Best regards, Bruno |
thank you Mr. Bruno:)
|
Ueqn
Hi,
In the icoFoam solver, where is the top level of Ueqn where Navier-stoke equation carries out? best regards, Hassan |
Hi Hassan,
The best I can do on this question is to point you to this wiki page: http://openfoamwiki.net/index.php/IcoFoam - it basically explains how the icoFoam solver works. Best regards, Bruno |
Hi friends,
I can't understand the PCG linear solver how work in the icoFoam solver? In other words, which part of the icoFoam.C related to the PCG linear solver and use it? please show me. Regards, Hassan |
Hi Hassan,
The PCG solver is not available directly to icoFoam. It's used very deep into the solve() methods and equation solving algorithms. Some more reading material:
Bruno |
Thanks.
Regards, Hassan. |
Dear Foamers,
How can I extract the linear system (AX=B) from the cavity case in tutorials using OpenFOAM? Regards, Hassan |
extract the linear system
Hi dear Bruno,
Could I use the PCG linear solver for my linear system (Ax=b) separately? In the other words, I want to send two input files A and b, then get the x from this solver? yes or no please? regards, Hassan |
Hi Hassan,
I'm sorry to say that I don't know the answer. In theory, it should be possible. AFAIK, do keep in mind that PCG will not be able to give you an exact solution. At most, it's able to give you a partial/possible near solution, but not an exact one: http://www.cfd-online.com/Wiki/Conju...adient_methods If I had to start investigating into this, I would have a look into the source code experiments that try to use one or more GPUs to help solve simulations faster, such as:
Best regards, Bruno |
Quote:
I am also working on the same problem of solving sparse linear matrix (AX=B) using PCG solver. Did you find any solution ? Any useful inputs from your side apart from what is available here? Thanks, Meher. |
Hi Meher,
thanks for your attention, but no. |
All times are GMT -4. The time now is 13:12. |