CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Morphology Divergence of a boundary patch field (https://www.cfd-online.com/Forums/openfoam-solving/58754-morphology-divergence-boundary-patch-field.html)

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 trickshttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

/ Niels

[1] http://vtchl.uiuc.edu/~liu19/publica..._ewri_2006.pdf

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?

Thanks,

Niels

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 http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Hrv

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?

Thanks,

Niels

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

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

@All
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 05: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:)

Niels

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...

Greetings,
Arne


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

Niels

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?

Quote:

solve
( 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...

Arne

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...

Quote:

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::?

Arne

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 !

Getnet

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

Niels

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!

Getnet

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

Niels

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?

Thanks,
Getnet

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!
Detian
2014.6.20

Fanfei November 4, 2014 09:47

Quote:

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:)

Niels

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

Fanfei November 6, 2014 09:27

Quote:

Originally Posted by Fanfei (Post 517325)
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

hi all
I have found the example of Fam. They are in surfaceTracking file on tutorials.
Best regards
Fan fei

Fanfei March 27, 2015 06:15

3D sand slide model
 
Hi All:
Recently, I did some work on sand slide model. And I have understood the 2D sand slide model. But, i still confused how to work with 3D sand slide model. someone can give me some hints, any hints are welcome.
Best Regards!
Fan Fei

ngj March 27, 2015 07:33

Hallo Fan Fei,

I have recently had an article accepted, where I describe a 3D geometrical sand sliding routine:

http://onlinelibrary.wiley.com/doi/1....4015/abstract

Note that this article is also highly relevant with respect to the mass conservation of the sediment due to face-to-vertex interpolation of the rate of bed level change. The native method in OpenFoam (primitivePatchInterpolation with the faceToPoint method) is shown not to be mass conserving.

Kind regards,

Niels

lzhou April 28, 2015 08:17

Hello Niels,

Sorry to bother you but I am also trying to solve the Exner equation using FAM. I would like to ask is there a difference between directly using the fac::div() function and calculating linearEdgeInterpolate(qB) & aMesh.Le() as you mentioned in your posts ?

Also, when I am calculating the divergence on finite area mesh, I've got a problem related to boundary value which I explained here:http://www.cfd-online.com/Forums/ope...area-mesh.html

I think it is because I use Qsa.internalField()=vsm.mapToSurface(Qs.boundaryFi eld()) so only the internal field of Qs is mapped but not the boundary values. Is there a function like .correctBoundaryCondition() existed in finite area mesh ? Thank you in advance for any help !

Best regards !

Lu

ngj April 28, 2015 15:54

Hallo Lu,

I have never seen that type of problem (with non-periodic domains), and fac::div does obey to a zero gradient. I have very recently used a zero gradient on a bed load field and it worked perfectly.

The problem might be related to the mapping, and I have never used the mapping, i.e. I keep all fields on the boundary (in fa-fields).

With respect to the difference between fac::div and the dot-product approach, then I would suggest that you look into the article I sighted above, because both the usage of the fac:div approach and the dot-product contains vertical contributions, which even at the continuous level of the Exner equation can lead to instabilities.

Kind regards,

Niels

Fanfei May 21, 2015 22:16

Quote:

Originally Posted by ngj (Post 538542)
Hallo Fan Fei,

I have recently had an article accepted, where I describe a 3D geometrical sand sliding routine:

http://onlinelibrary.wiley.com/doi/1....4015/abstract

Note that this article is also highly relevant with respect to the mass conservation of the sediment due to face-to-vertex interpolation of the rate of bed level change. The native method in OpenFoam (primitivePatchInterpolation with the faceToPoint method) is shown not to be mass conserving.

Kind regards,

Niels


Hi Niels:
I'm so sorry to trouble you. I have study your papar about the mass conservation of interpolated. you did a good job. However, I still have problem understanding the 3D sand slide model. From my unstanding, after the mesh update, the steepest slope of each face are calculated. if the slope exceed the slope of repose, the face cell will need to adjust. And the face will rotated around the face centre for mass conservation, and new location of points of that face will be computed. and then the mesh update, is that right?
Greeting !
Fan Fei

ngj May 22, 2015 01:26

Hallo Fan Fei,

Thank you.

Yes, that is the overall methodology, but you do not need to move the mesh before the sand slide. You could simply use the information from the Exner equation (and prober interpolation) to evaluate the correction due to sand sliding.

Kind regards,

Niels

Fanfei May 22, 2015 02:21

Quote:

Originally Posted by ngj (Post 547257)
Hallo Fan Fei,

Thank you.

Yes, that is the overall methodology, but you do not need to move the mesh before the sand slide. You could simply use the information from the Exner equation (and prober interpolation) to evaluate the correction due to sand sliding.

Kind regards,

Niels

Hi Niels:
Thank you for your reply. But I'm more confuse now. Do you mean that as the exner equation solve, the correceted of sand slide should be computed at the same time. In other words, before the points of mesh move, a limiter is constructed to limited the moving of points. is that right?
Best regards
Fan Fei

ngj May 22, 2015 02:57

Yes, you can consider the sand sliding as a limiter.

(i) Solve the Exner equation, (ii) interpolation to the vertices, (iii) perform sand sliding on the new (but not moved points) and (iv) then update the mesh.

Kind regards

Niels

Fanfei May 22, 2015 05:14

Quote:

Originally Posted by ngj (Post 547266)
Yes, you can consider the sand sliding as a limiter.

(i) Solve the Exner equation, (ii) interpolation to the vertices, (iii) perform sand sliding on the new (but not moved points) and (iv) then update the mesh.

Kind regards

Niels

Hi Niels:
Thank you very mech. I'm clear now. However, I have a detials question on perform sand sliding. if i want to limitied the movement of vertices, some variables need: (1)the steepse angle of that face cell (2)the coordinate of face center (3) the coordinate of vertices of that face. Now I have trouble on access the coordinate of vertices of The assigned face. for example i want to get the coordinate of vertices of U.boundaryField()[patchID][i]. is there a function can do that? Thanks.
kind regards
Fan Fei

ngj May 22, 2015 10:53

Hi Fan Fei,

What you want to achieve is all available through the mesh-connectivity information, e.g.

Code:

mesh.faceCells();
mesh.facePoints();
// ... etc

But it requires some working to gather all the information; this is an additional advantage of using the faMesh, because you have simpler connectivity on the bed, because the mesh is only the bed.

Please note that the dualMesh interpolation approach, which I have suggested in my paper, is not available in OpenFoam, so you will need to construct that yourself.

With respect to the steepest slope, then it is a simple vectorial derivation, where you merely need the normal vector to the face and the direction of gravity. I will leave it to you to do the derivation.

Kind regards,

Niels

Fanfei May 22, 2015 19:38

Quote:

Originally Posted by ngj (Post 547349)
Hi Fan Fei,

What you want to achieve is all available through the mesh-connectivity information, e.g.

Code:

mesh.faceCells();
mesh.facePoints();
// ... etc

But it requires some working to gather all the information; this is an additional advantage of using the faMesh, because you have simpler connectivity on the bed, because the mesh is only the bed.

Please note that the dualMesh interpolation approach, which I have suggested in my paper, is not available in OpenFoam, so you will need to construct that yourself.

With respect to the steepest slope, then it is a simple vectorial derivation, where you merely need the normal vector to the face and the direction of gravity. I will leave it to you to do the derivation.

Kind regards,

Niels

Hi Niels:
Thank you very much for your reply.
I solve Exner and get the movement of face centre with FAM method, then mapped the value to FVM and then interpolated from face centre to vertices with FVM mesh. I test my model with local Scour dut to jet, it can work 5 min. however, when the slope exceed the repose, the critical shields be negative, and the program break down, so i decide to add sand slide model to it. You give me a lot of help for sand slide. Thank you very much. I'll try your method. if it works, i'll be let you know. Thanks.
Best regards,
Fan Fei

ngj May 23, 2015 06:28

Hi Fan Fei,

Yes, you will need a sand sliding module for most problems (especially scour). Your procedure sounds good, but I do not see, why you need to make the mapping between faMesh and fvMesh for the mesh motion. You should be able to perform all of these operations on the faMesh and only communicate directly to the mesh motion solver; through the setting of boundary conditions of the relevant fields, e.g. pointDisplacement, motionU, etc.

Kind regards,

Niels

Fanfei May 24, 2015 04:25

Quote:

Originally Posted by ngj (Post 547424)
Hi Fan Fei,

Yes, you will need a sand sliding module for most problems (especially scour). Your procedure sounds good, but I do not see, why you need to make the mapping between faMesh and fvMesh for the mesh motion. You should be able to perform all of these operations on the faMesh and only communicate directly to the mesh motion solver; through the setting of boundary conditions of the relevant fields, e.g. pointDisplacement, motionU, etc.

Kind regards,

Niels

Hi Niels:
I used mesh.Cf.boundaryField()[patchID][i] to access coordinate of the face centre of bed, as i access the points of face cell with mesh.facePoints().boundaryField()[patchID][i], some errors are occured. The error show that mesh has no member facePoints(). Is there something wrong with my openfoam version. my openfoam version is openfoam-extend 3.1.
Kind regards
Fan Fei

Fanfei May 24, 2015 08:27

Quote:

Originally Posted by ngj (Post 547424)
Hi Fan Fei,

Yes, you will need a sand sliding module for most problems (especially scour). Your procedure sounds good, but I do not see, why you need to make the mapping between faMesh and fvMesh for the mesh motion. You should be able to perform all of these operations on the faMesh and only communicate directly to the mesh motion solver; through the setting of boundary conditions of the relevant fields, e.g. pointDisplacement, motionU, etc.

Kind regards,

Niels

Hi Niels
I'm so sorry to trouble you. I find a function can access the points of assign face, it's localPoints(), i can use mesh.boundaryMesh[patchID].localPoints to access the the coordinate of points of assign faces. However, when i use for loop to access the assign face cell. some error occured.
*********************code************************* ************
for(int ii=0; ii<mesh.boundaryMesh[patchID].size();ii++)
int bb=sizeof(mesh.boundaryMesh[patchID][ii].localPoints);
************************************************** ********
the error is Error:'const class Foam::face' has no member named 'localPoints'. How I corrected this error. Thanks

Kind regards
Fan Fei

Fanfei May 25, 2015 23:16

Quote:

Originally Posted by ngj (Post 547349)
Hi Fan Fei,

What you want to achieve is all available through the mesh-connectivity information, e.g.

Code:

mesh.faceCells();
mesh.facePoints();
// ... etc

But it requires some working to gather all the information; this is an additional advantage of using the faMesh, because you have simpler connectivity on the bed, because the mesh is only the bed.

Please note that the dualMesh interpolation approach, which I have suggested in my paper, is not available in OpenFoam, so you will need to construct that yourself.

With respect to the steepest slope, then it is a simple vectorial derivation, where you merely need the normal vector to the face and the direction of gravity. I will leave it to you to do the derivation.

Kind regards,

Niels

Hi Niels
I have found a function in face.H file can help me access the points of assign face.
**********************code**********************
//- Return the points corresponding to this face
inline pointField points(const pointField& meshPoints) const;
*************************************************
however, when i used mesh.boundaryMesh().[patchWallID].[i].points() to access the points of face[i], an error occured: Error:no matching function for call to "Foam::face::points() const". I try a lot of methods to correcte it, but I fialed. could you help me to correct this error. Thanks.

Best regards
Fan Fei

ngj May 26, 2015 14:01

Hallo Fan Fei,

The method requires an input, put you do not pass anything.

Kind regards,

Niels

Fanfei May 26, 2015 20:56

Quote:

Originally Posted by ngj (Post 547747)
Hallo Fan Fei,

The method requires an input, put you do not pass anything.

Kind regards,

Niels

Hi Niels:
Thanks for your kindness. This problem has been solve with labelList and mesh.points() function. As we all know, that a point is shared by several face, as those faces rotated around their centres , this point will get a lot of values, which value should I choose?
Kind regards
Fan Fei

Fanfei May 27, 2015 00:47

Quote:

Originally Posted by ngj (Post 547266)
Yes, you can consider the sand sliding as a limiter.

(i) Solve the Exner equation, (ii) interpolation to the vertices, (iii) perform sand sliding on the new (but not moved points) and (iv) then update the mesh.

Kind regards

Niels

Hi Niels:
I think maybe i have misunderstood the sand slide model. Assume that a point shared by for face, and each face will have a value on this point. some of them are positive, some are negative. whether can i chose the maximum negative value and the minimum positive value as the limiter to limited the boundary points move?
Best regards
Fan fei

ngj May 27, 2015 02:32

Well, the procedure is to consider one face at the time until you have reached a state, where all faces are less than the sliding angle. Therefore, I do not see any problems in which value to assign to a given point.

Kind regards,

Niels


All times are GMT -4. The time now is 09:43.