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

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

Register Blogs Community New Posts Updated Threads Search

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

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


So, while trying to re-write my awful library for reservoir simulations http://github.com/FoamScience/OpenRSR (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.




-----
Elwardi,
Best Regards
ELwardi is offline   Reply With Quote

Old   July 22, 2020, 08:06
Default
  #2
Member
 
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 41
Rep Power: 10
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):
Code:
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, 01:07
Default
  #3
Member
 
Vu
Join Date: Nov 2016
Posts: 42
Rep Power: 10
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 (https://github.com/fppimenta/rheoTool), 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, 06:34
Default
  #4
Member
 
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 41
Rep Power: 10
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).


See https://sourceforge.net/p/foam-extend/tickets/51/


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!
bali.sb likes this.
ELwardi is offline   Reply With Quote

Old   January 7, 2024, 04:54
Default Block-coupled solvers in OpenFOAM
  #5
New Member
 
Join Date: Jul 2013
Posts: 7
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?


Thanks
komodo is offline   Reply With Quote

Reply

Tags
block matrix, coupled solver, discussion


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


All times are GMT -4. The time now is 11:30.