CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Moving boundary problem based on calculated data (https://www.cfd-online.com/Forums/openfoam-programming-development/122557-moving-boundary-problem-based-calculated-data.html)

tladd June 23, 2016 12:18

dissolFoam
 
1 Attachment(s)
For those interested in solving moving boundary problems I would like to draw your attention to a package developed by my colleague Vitaliy Starchenko. Starting with Frederic Heckman's posting (#3) we have been studying the opening of fractures due to dissolution; a paper is under review at the present time.

dissolFoam is the solver Vitaliy developed for this work and the the latest snapshot is available at https://github.com/vitst/dissol240.

The main features are:

dissolFoam - the solver (including normal surface motion due to dissolution)

dissolMeshRelax - for surface mesh relaxation - this is still under development but it is essential for a simulation of any relevant duration. Right now it is specific to a geometry with parallel inlet and outlet planes for the flow

nonLinear - a boundary condition for nonlinear dissolution kinetics (based on mixed)
danckwerts - a Danckwerts bc (also based on mixed)

coupledPatchInterpolation - this fixes the faceToPoint interpolation across coupled patches, such as cyclic and processor. This has been discussed at several points on this thread
steadyStateControl - a modification of simpleControl so the time counter does not increment every loop (annoying in steady state flows).

patches - There are a couple of patches to the OF source code that should be compiled in. One of them is needed for steadyStateControl the other fixes a bug (in our opinion) in the solver convergence tests. Vectors are normed component by component which can lead to non-convergence if one of the components is zero (or near zero). The patch norms each component by the norm for the whole vector (or tensor).

cases - there are some sample case files, but none of them are that quick to run
docs - there is a longer description of the software in dissol240/docs/SI.pdf

examples - sample movies from dissolFoam simulations
The attached pdf illustrates what the simulations look like. The fracture is a narrow slot running through soluble rock. There are small random displacements in the initial surface positions. The large channels grow from that.

Tony

PS: dissolFoam is based on OpenFOAM-v2.4.0

dariodario32 August 4, 2017 08:27

I'm trying to do the same in OF 4.1
I got the following error:
error: no match for ‘operator==’ (operand types are ‘const Foam::pointPatchField<Foam::Vector<double> >’ and ‘Foam::vectorField {aka Foam::Field<Foam::Vector<double> >}’)
PointDisplacement.boundaryField()[patchI] == displacements;

it shows up even when I try to compile your example.
I understand that I should change pointVectorField in pointPatchField, but I didn't find a way to make it work. Anyone tried this in later versions of OF?

Thanks

tladd August 4, 2017 08:42

Hi Dario

That package was tested in OF 2.4.0 so you need to install that version (2.x should work). There was a major rewrite of the OF internals in 3.0. That breaks a lot of the things in the code. OF is developing very rapidly so its a bit of a moving target.

Vitaliy's codes do work with 4.1 but we do not have a bundled release. You can obtain development snapshots of the various pieces at
https://github.com/vitst?tab=repositories
The important repositories are:
dissolFoam - the solver
libsFoamAux - additional libraries
patches-OpenFOAM-v3.xPlus-unofficial - this still works for 4.x
dissolFoamTestCases - The README will tell you the commits for dissolFoam and libsFoamAux that were used to generate the results. The input files might be a bit different for different commits.

Hope this helps. Good luck

Tony

tladd April 5, 2018 10:15

dissolFoam-v1706
 
4 Attachment(s)
My colleague Vitaliy has released a new set of source codes and case files for moving boundary simulations based on OpenFoam-v1706

https://www.cfd-online.com/Forums/op...m-release.html

The release contains a solver, additional libraries, utilities and case files.

A packaged release can be found at

https://github.com/vitst/dissolFoam/releases/tag/v1706

Regards

Tony

PS: I added some images from one of the cases (dissolCirc). They shows a soluble cylinder dissolving: Initial mesh (snappyHex), an expanded view of the trailing edge of the cylinder, mesh at time 50 (dt = 0.2), an expanded view of the trailing edge of the cylinder at t=50

Ben UWIHANGANYE June 28, 2018 03:06

Oscillating cylinderField
 
2 Attachment(s)
Hello Foamers,

I have read this thread and trusted you that you may help.

Indeed, I want to move cylindrical Field created using topoSetDict to follow a certain path (x) in Cartesian grid. I wrote a C++ program that is giving me the value of x at each time step(see attached).

Does it sound possible to code and move that cylindrical Field following that path?

If yes how?
where should I start from?
which tutorial would help?
How to make that c++ working in OpenFoam?


Thank you!

tladd June 28, 2018 05:31

1 Attachment(s)
Quote:

Originally Posted by Ben UWIHANGANYE (Post 697518)
Hello Foamers,

I have read this thread and trusted you that you may help.

Indeed, I want to move cylindrical Field created using topoSetDict to follow a certain path (x) in Cartesian grid. I wrote a C++ program that is giving me the value of x at each time step(see attached).

Does it sound possible to code and move that cylindrical Field following that path?

If yes how?
where should I start from?
which tutorial would help?
How to make that c++ working in OpenFoam?


Thank you!


Ben


DissolFoam was designed to move a boundary patch in the direction of the local surface normal. If you want to move a field this is not what you want.


It is not clear to me what equations you are trying to solve, but what dissolFoam does is described in the attached document.


Tony



Tony

kayla1994 October 9, 2018 07:08

Hello everybody,
What boundary condition should I set in the pointDisplacement file if I have a complex surface and I cannot define only one normal vector for every points?

tladd October 9, 2018 09:05

Can you give some details. Are you trying to implement a moving boundary condition?



If you are using dissolFoam-v1706 then the PMU file should point to the normalSurfaceMotion boundary condition. There are case files in the release (#44) that will show you how to do that.


Tony

kayla1994 October 9, 2018 11:19

Quote:

Originally Posted by tladd (Post 709430)
Can you give some details. Are you trying to implement a moving boundary condition?

If you are using dissolFoam-v1706 then the PMU file should point to the normalSurfaceMotion boundary condition. There are case files in the release (#44) that will show you how to do that.

Tony

Hi Tony, thanks for your reply. I'm working with a variation of moveDynamicMesh.
What I would like to do it's deforming the surface geometry applying a displacement field at the nodes proportional to some scalar field.
If you need further details, I opened a thread here.

https://www.cfd-online.com/Forums/op...tml#post709417

Thank you for help,
best regards

Michael@UW April 3, 2020 00:18

Quote:

Originally Posted by ngj (Post 534006)
Dear all,
[*]In 2D simulations, the width of the computational domain in the empty direction has an effect on the mass conservation error. This is solely related to the fact that the weights are from the faces to the points. For instance, on non-equidistant grids and very wide meshes in the empty direction, the interpolation becomes a simple average (identical weights for all points). This is obviously not correct, since the mesh is defined as non-equidistant.[/LIST]An alternative interpolation method is proposed in the same paper.

I hope that these finding are valuable for some of you.


Kind regards,


Niels


Interesting findings! I wonder if the latest version of OF still has the same problem regarding empty boundary.

ArminAlavi September 4, 2020 14:05

Hello Frederic
I am struggling with a problem you answered in post #3. I use your exact code but I get the following error message:
Quote:

In file included from /opt/openfoam6/src/OpenFOAM/lnInclude/token.H:46:0,
from /opt/openfoam6/src/OpenFOAM/lnInclude/UListIO.C:28,
from /opt/openfoam6/src/OpenFOAM/lnInclude/UList.C:233,
from /opt/openfoam6/src/OpenFOAM/lnInclude/UList.H:484,
from /opt/openfoam6/src/OpenFOAM/lnInclude/List.H:43,
from /opt/openfoam6/src/OpenFOAM/lnInclude/labelList.H:48,
from /opt/openfoam6/src/OpenFOAM/lnInclude/UPstream.H:42,
from /opt/openfoam6/src/OpenFOAM/lnInclude/Pstream.H:42,
from /opt/openfoam6/src/OpenFOAM/lnInclude/parRun.H:35,
from /opt/openfoam6/src/finiteVolume/lnInclude/fvCFD.H:4,
from pyrolysisFoam.C:32:
/opt/openfoam6/src/OpenFOAM/lnInclude/typeInfo.H: In instantiation of ‘To& Foam::refCast(From&) [with To = Foam::Field<Foam::Vector<double> >; From = const Foam::pointPatchField<Foam::Vector<double> >]’:
moveMesh2.H:33:96: required from here
/opt/openfoam6/src/OpenFOAM/lnInclude/typeInfo.H:110:16: error: cannot dynamic_cast ‘r’ (of type ‘const class Foam::pointPatchField<Foam::Vector<double> >’) to type ‘class Foam::Field<Foam::Vector<double> >&’ (conversion casts away constness)
return dynamic_cast<To&>(r);
^~~~~~~~~~~~~~~~~~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/typeInfo.H:119:16: error: cannot dynamic_cast ‘r’ (of type ‘const class Foam::pointPatchField<Foam::Vector<double> >’) to type ‘class Foam::Field<Foam::Vector<double> >&’ (conversion casts away constness)
return dynamic_cast<To&>(r);
^~~~~~~~~~~~~~~~~~~~
/opt/openfoam6/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/pyrolysisFoam.o' failed
make: *** [Make/linux64GccDPInt32Opt/pyrolysisFoam.o] Error 1
my OF version is 6, i think it has something to do with the version. could you please guide me how to solve this problem?
Thank you
Armin

scleakey October 17, 2023 09:01

Quote:

Originally Posted by ArminAlavi (Post 782097)
Hello Frederic
I am struggling with a problem you answered in post #3. I use your exact code but I get the following error message:

my OF version is 6, i think it has something to do with the version. could you please guide me how to solve this problem?
Thank you
Armin

This happened to me too - I think you now have to write boundaryFieldRef instead of boundaryField for the line
Code:

vectorField &pDisp=refCast<vectorField>(PointDisplacement.boundaryField()[patchWallID]);
:)

tladd October 28, 2023 13:10

Armin


Vitaliy released a version of dissolFoam for OF 6. I did not see your message until now. Hope you found a solution.


Tony


All times are GMT -4. The time now is 07:10.