CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Simulating Dam Break problem with icoFoam (http://www.cfd-online.com/Forums/openfoam-solving/122718-simulating-dam-break-problem-icofoam.html)

darthcoder August 26, 2013 13:16

Simulating Dam Break problem with icoFoam
 
I am trying to work through the examples mentioned in the user's guide as a step to understanding the working of openfoam.


As such it occurred to me to try to see if I cannot simulate the dam break problem with only one fluid. That is assuming that there is only one fluid in the simulation domain that is held behind a membrane as shown in the damBreak tutorial.

1. I created a new ribFlow folder in $FOAM_RUN
2. I created the 0, constant, system dictionaries
3. In constant I created polymesh by copying it over from tutorials/interFoam/laminar/damBreak/constant
4. I copied g from the same
5. The transportProperties I created by taking nu from tutorial/incompressible/icoFoam/cavity and rho from the interFoam directory
6. In 0 I had two directories p and U. U I copied directly from interFoam while p I created from the p of icoFoam with the patches of interFoam
7. the system dictionary I simply copied over from the cavity folder.

As expected there are no problems in mesh generation and it happens automatically without errors.

However when I try to run icoFoam, I get a segmentation fault error. I have included the total error message below.

It is quite possible that my understanding is warped. I didn't have a lot of hope that I would manage to sew these two disparate problems and make them gel. But, there is no reason that such a problem shouldn't be tractable with icoFoam.

Kindly tell me how to proceed forward. At the very least I think I can borrow the blockMeshDict, U, g, transportProperties and the system directory and would need to recreate the others. Any advice would be most helpful.

The error message(on executing icoFoam) is displayed below:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.001

Courant Number mean: 0 max: 0
DILUPBiCG: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam::operator/(Foam::tmp<Foam::Field<double> > const&, Foam::UList<double> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 Foam::fixedFluxPressureFvPatchScalarField::updateC oeffs() in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#6 at gaussLaplacianSchemes.C:0
#7 Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacianUncorrected(Foam::GeometricFi eld<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#8 Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#9 Foam::fv::laplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#10
in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/icoFoam"
#11
at icoFoam.C:0
#12
in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/icoFoam"
#13 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#14
in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/icoFoam"
Segmentation fault

akidess August 27, 2013 03:47

Let's disregard the simulation aspect for now - how would you reproduce this experiment in real life?

Phicau August 27, 2013 04:11

Hi Abdul,

what you are thinking is water and void right? This feature will be highly beneficial for OpenFOAM, as in certain cases we could disregard the air phase while simulating water with VOF.

There is a problem with your set-up and this is that void should be taken a phase, so you are bound to run it with interFoam. However, this solver does not allow "void" simulation, as zero-density fluids cause a division by 0.

From my experience it would be very difficult to modify the solver for this purpose, but it will be a very interesting advance.

Best,

Pablo

darthcoder August 27, 2013 13:41

Quote:

Originally Posted by akidess (Post 448258)
Let's disregard the simulation aspect for now - how would you reproduce this experiment in real life?


sorry for my late response i spent a lot of time wondering about this.

seems to me i was just trying to brute force a solver onto a physical problem without considering it in any sort of detail.

now it seems pretty straightforward to me to consider that the "rest of the space" would be filled with air(at atmospheric pressure most probably) and thus it is necessary to do a two phase solution and hence use interFoam, thus having to do the problem as it is attempted in the user guide. since it is already solved in a demo, there isn't really much for me to do except change some parameters and see what effects that causes.

on further deliberation i have two questions that i would like to ask you:

1. where is the software breaking down? what is causing the segfault? i cannot read c++(yet) so i cannot debug it.

2. suppose the whole region was filled with water at rest and at t=0 it is given some momentum(say by opening a membrane to the very right of the flow field while simultaneously pushing it with a piston on the opposite end) how do i go about solving this problem? what boundary conditions do i use?

thank you.


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