CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Fully Coupled Solvers for OpenFOAM7+ (To be ported From FE4 code base)

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree6Likes
  • 4 Post By ELwardi
  • 1 Post By DoQuocVu
  • 1 Post By ELwardi

LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2020, 06:41
Lightbulb Fully Coupled Solvers for OpenFOAM7+ (To be ported From FE4 code base)
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 40
Rep Power: 9
ELwardi is on a distinguished road
Hi folks,

So, while trying to re-write my awful library for reservoir simulations (Was my end-of-studies project, so I had little time ...), I decided to ditch the whole thing and start anew. Here is the logic:

- Reservoir Engineering Problems desperately need fully coupled solvers (not provided in mainline OpenFOAM), so I turned to Foam-Extend: The base functionality is there (basically BlockLduMatrix); I only had to consume the library.

- I don't know why, but I get the feeling that the Foam-Extend project is dying out!

- FE4 was actually based on OF3 I think. So, the code base is fairly old. It has no fvOptions and the IO/solver interface is not great (among many other things). OF5+ introduced significant library-interface changes and I want to port (at least) the block-matrix functionality to newer OF releases before things get worse!

Hence I have two questions:

1. How come this fully-coupled functionality didn't make it to mainline OF yet? It has been around since FE-1.6 I think!

I started poking around the code in both libraries to estimate how hard (or time-consuming) porting the code from FE4 to OF7 would be (We only need several classes: VectorN/TensorN, CoeffField, [Block]:lduInterface,lduMatrix,preconditionners,solvers and smoothers).

Generally speaking, It's a matter of coping with the changing interfaces of original classes but something in particular is interesting; and that is the handling of "coupled interfaces" in the code.

In short, the coupled interface functionality in FE4 is handled with 3 member methods for the lduInterfaceField class (See this line from FE4 source code). Talking about: transformCoupleField, initInterfaceMatrixUpdate and updateInterfaceMatrix.

As you can see, some of these methods take a lduMatrix as an argument, so, when one wants to create equivalent functions for block-coupled interfaces, it's natural to put a blockLduMatrix instead of lduMatrix.

The thing is, in OF7 (See the equivalent class in OF7), these methods no longer have a lduMatrix argument (check coupledFvPatchField for an example usage of one of these methods).

2. What should I do? Stick to the interface from FE4? or is there something else I'm missing here.

Best Regards
ELwardi is offline   Reply With Quote

Old   July 22, 2020, 07:06
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 40
Rep Power: 9
ELwardi is on a distinguished road
Just for future reference; if anyone would attempt this again, one of the first commands you should run is (inside $FOAM_SRC/foam from foam-extend of course):
find -type d -not -iname "(*[bB]lock*)" -exec grep -r {} -e "#include.*[bB]lock.*" \; | grep -ve "/Block"
Why? Because it reveals what OpenFOAM-core classes you need to "edit" to
account for Block-specific operations (foam-extend explicitly includes
block-specific headers in those classes).

Mainly, we need to edit (or create a similar class) "lduMatrix/lduSolverPerformance.H" and "GeometricField/GeometricField.H".

In short, I need to re-write the hole lduMatrix and *GeometricField framework.
ELwardi is offline   Reply With Quote

Old   July 27, 2020, 00:07
Join Date: Nov 2016
Posts: 42
Rep Power: 9
DoQuocVu is on a distinguished road
I have been asking the same question for a long time. Hopefully, someone can reveal the reasons behind the abandonment of that feature.

By the way, You might want to try the blockCoupleSolver in rhoTool (, which is a library developed on top of OpenFOAM. It uses petsc to assembly and solves for the matrix of coupled equations.
arashn18 likes this.
DoQuocVu is offline   Reply With Quote

Old   July 27, 2020, 05:34
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 40
Rep Power: 9
ELwardi is on a distinguished road
Yep, I asked related questions in different places and apparently, there is a licensing
issue (Although not sure why OF devs themselves didn't incorporate this feature in
the code).


As of JUL 2020, I see this as a lost case and won't engage in any related development.

Also, I think using PETSc is cool as I hear it supports hybrid GPU/MPI parallelism
but I would still prefer using a native solution. Otherwise, it might be better (from
the programmer's perspective) to switch another CFD package that uses coupling
out of the box

You see, this feature is vital for me so I have to continue using FE4 for the time being.

Thank you for reading this far! likes this.
ELwardi is offline   Reply With Quote

Old   January 7, 2024, 03:54
Default Block-coupled solvers in OpenFOAM
New Member
Join Date: Jul 2013
Posts: 6
Rep Power: 13
komodo is on a distinguished road
Dear Elwardi,

I stumbled upon this thread while looking into this topic.
I've seen that a few years passed by since your last post.

Is there any news on this front?
Do you know if the maintainers of OpenFOAM (either .com/.org) plan to implement this feature in the code?

komodo is offline   Reply With Quote


block matrix, coupled solver, discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[swak4Foam] swak4foam openfoam 7 installation problem Andrea23 OpenFOAM Community Contributions 1 February 17, 2020 18:11
Demand for a VOF OPENFOAM code base on Welch, Wilson paper (VOFWW) Asghari_M OpenFOAM Running, Solving & CFD 0 May 30, 2018 04:47
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56

All times are GMT -4. The time now is 02:42.