CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Morphology Divergence of a boundary patch field (

ngj June 26, 2008 10:11

Hi all I am going to couple
Hi all

I am going to couple a sediment transport evaluation with a morphological updating of the sediment bed. In contrast to the flow-equations the problem is purely 2-dimensional, as the bed load transport is tangential to the bed. The change in bed level is proportional to the divergence of the transport field.

My question is, how do I calculate the divergence of a field, which is basically a boundaryField?

Is there some routines right there on the shelf in OF or should I consider doing something similar to [1], where the bed is mapped into a 2D-mesh and everything is calculated on that. If so, are there any routines to do so in OF or does it require some "home-cooking"? If the latter, could you recommend any good literature on mesh mapping using arbitrary polygons. As in [1] it would probably be easiest to map to a x-y plane.

Thank you very much for any of your help or tricks

/ Niels


ngj July 3, 2008 05:54

Hi All I am considering to
Hi All

I am considering to change my tactics a little bit, thus right now I am working with primitivePatchInterpolation in OF-1.4.1.

My question is whether it is correct or not that the faceToEdge interpolation is simply a matter of linear interpolation between the two faces which share the edge?

If yes, would it then be a tremendous task to extend it to higher order upwind schemes?



hjasak July 3, 2008 08:04

Sorry, I may be out of the flo
Sorry, I may be out of the flow of discussions, but do you know about the Finite Area Method? It is implemented for a 2-D FVM on a curved surface in 3-D and available in SVN.

There should be a mention of it in some of my slides + I will definitely talk about it at the Workshop in Milan. Author: Zeljko Tukovic: I not simply advertising own stuff


ngj July 3, 2008 09:48

Hi Hrv Thanks for the answe
Hi Hrv

Thanks for the answer, I'll look into it and look forward to the presentation in Milan.

I saw in another thread (2006) that the translation of Zeljko' Thesis was in working progress. Has this translation ended, if yes would it be possible to get a hold on?



liu July 3, 2008 11:18

what I did is to do a one-to-o
what I did is to do a one-to-one mapping, i.e., the bottem boundary is the the same as the 2D xy boundary. The reason is to reduce the loss of accuracy due to mapping. If you mesh is fine enough, the loss of accuracy will be minimum.

For sediment transport and morphology, I suppose you are solving Exner equation, which is the conservation of sediment in the bed. It's a wave-like equation. The morphological time scale is so small (except in the area of rapid scour/deposition) that you can solve it explicitly. The divergence can be calcualted via Green's theorem.

I would like to see the FAM be used.

Also see:
X. Liu and M.H. García (2008). A 3D Numerical Model with Free Water Surface and Mesh Deformation for Local Sediment Scour. Journal of Waterway, Port, Coastal, and Ocean Engineering. 134(4): 203-217

ngj July 3, 2008 12:18

Hi Xiaofeng Yes, I am indee
Hi Xiaofeng

Yes, I am indeed going to solve the Exner equation, but as I am going to look at self-formed features, i.e. no presence of structures, I'll take your advise and solve it explicitly.

The adoption of Green theorem was actual the reason for adopting 'primitivePatchInterpolation', but the FAM seems interesting, thus I'll do a compile of the dev and see what I can achieve.

- Niels

ngj July 7, 2008 11:13

Hi Xiaofeng, Hrv and others
Hi Xiaofeng, Hrv and others

I have tried locating your article, but I have only been able to find it on your web-page. Is it in press?

I have had a look at the finiteArea implementation, and I would say that it looks rather interesting, and I believe it would be straight forward to implement the evaluation of the Green' theorem. Though just to clarify things, I have a couple of questions:

> void faMesh::calcLe() const
This function calculates the normal to the edges, and the normal being tangential to the surface, correct?

> Having the bed load, qB, on the faces, the flux over the edges would be:
linearEdgeInterpolate(qB) & aMesh.Le(),
with aMesh.Le coming from the above function, correct?

> Boundary conditions
I assume that boundary conditions should be set as in the hydrofoil case to calculate the edge normals correctly? (Especially in the case of cyclic boundaries).

Thank you for you help so far, it is highly appreciated.

/ Niels

ngj February 22, 2010 06:39

Hi all

I have now been working on the morphological updating routine, and I would just recommend to all of you to do it in the framework of FAM, as the methods implemented into FAM are tailored to the morphological updating problems.

One feature is e.g. the filtering of the morphological response, which rewritten into differential form becomes easy as one can rely on the existing differential operators.

Have fun:)


Arnoldinho May 6, 2011 08:30

Hi Niels,

it has been a quite long time since you responded to your own topic started here...

As I have to implement a scour model in OpenFOAM as well now (after having done physical model tests), I'm also going to implement the Exner equation and use the automatic mesh motion algorithm in OF 1.6-ext.
Did you do your work using the FAM in the end? Could you give me a little hint on how to start implementing the equations? Unfortunately, the FAM seems to be rarely commented...


BTW: Did you already finish your PhD?

ngj May 18, 2011 09:27

Hi Arne

Yes, I have used the FAM framework, which offers some advances. It is a very long implementation, thus I can hardly put is simply into an email. The model description for sediment transport and morphology extends more than 20 pages.

I have turned in my thesis and I will defend it on the 10th of June. After the defense, the thesis will be made available on our university web side. Until then only a pre-defense version is available. If interested, please send me an email.

Best regards


Arnoldinho October 5, 2011 12:33

Hi Niels (and others),

I again have a question on solving the exner equation within the FAM framework. At the moment I'm struggling with some problems on incompatible dimensions in solving it... Could you help me out on the correct notation of the equation?


( fam::ddt(hb) == - 1/(1-n) * fam::div(phi, x) )
with hb beeing the elevation change and phi the flux over the edges coming from linearEdgeInterpolate(qb) & aMesh.Le(). So what does x have to be in this case? Sorry for asking this kind of presumably simple question, but I am really blockhead at the moment...


liu October 14, 2011 10:24

Remember Exner equation is a 2D eqn (the elevation is what you want to calculate). One should also be careful with the stability since shocks could emerge where in reality the sediment pile will collapse.

Arnoldinho October 14, 2011 10:33

Thanks for your answer Liu,

although I'm not sure what you mean...


Remember Exner equation is a 2D eqn (the elevation is what you want to calculate).
I thought FAM is working in 2D, so what's wrong about fam:: and fac::?


aka April 19, 2013 03:03

To all who worked Morphology with OpenFOAM,
I have incorporated a Morphology scheme in OpenFOAM by using fam in the two dimensional bed boundary mesh. My scheme is running without any problems, however I am getting oscillations/numerical instabilities while the dune/ripple is forming. I am solving the exner equation explicitly (fac) by taking the divergence of the bedload flux and other contributions.

Do you guys use explicit or implicit scheme while solving the exner equation either in time or space?

Thanks a lot !


ngj April 20, 2013 04:01

Hi Aka,

It is a well know problem, especially for non-scour problems, so you might need a set of stabilising mechanisms, such as sand slide and numerical filtering.

I am solving the Exner equation explicitly - at least I have not found a way of performing the time integration implicitly.

Kind regards


aka April 22, 2013 15:03

Thanks Niels, I will read about numerical filtering and sand slide if I am able to include them easily in my model.

I am reading your dissertation about the Adam-Bashforth scheme you used for explicit time integration based on 'F'. did you use the .oldTime () and old.Time().oldTime() functions to access your previous time step values? I tried using those functions and I was getting a 0 value for the time integrated value of the bed change with time though "F" is not zero in each time. did you initialize a zero value for the previous time steps at the start of the simulation when "i" becomes -1 and -2.

Thanks a lot!


ngj April 22, 2013 15:10

No, I merely had three files, which I called something like flux, flux0 and flux00, and then I implemented all of the book-keeping myself.

The main reason for this is that I used period averaging, which could easily consist of 1000 time steps per wave period. Yes, at the beginning of the simulation, everything is initialised to 0.

Kind regards


aka May 7, 2013 13:26

Thanks Niels, now I have got a working Adam-Bashforth scheme. I put both third and fourth order schemes. Do you think there would be any advantages or disadvantages if I proceed with the fourth order scheme?


Detian Liu June 20, 2014 03:14

Dear Niels,
I am a new comer to OpenFOAM, I am very eager to know how to realize the sand slide in OpenFOAM,could you please give me some advice?
Thanks for all the help!
Best Wishes!

Fanfei November 4, 2014 10:47


Originally Posted by ngj (Post 246852)
Hi all

I have now been working on the morphological updating routine, and I would just recommend to all of you to do it in the framework of FAM, as the methods implemented into FAM are tailored to the morphological updating problems.

One feature is e.g. the filtering of the morphological response, which rewritten into differential form becomes easy as one can rely on the existing differential operators.

Have fun:)


Hei Niels
I have used FAM to solve Exner equation. while the program run, there is a problem. It need creat famesh in constant file, but I couldn't find examples of FAM in of-3.1-extend, so i didn't kow how to do that. Could you give me some hints about how to creat a famesh.

Best regards
Fan Fei

All times are GMT -4. The time now is 00:20.