CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Other] Geometry inside mesh (https://www.cfd-online.com/Forums/openfoam-meshing/194895-geometry-inside-mesh.html)

pyroWinter October 26, 2017 10:41

Geometry inside mesh
 
Fellow foamers,
I generated a packed bed using Blender + SnappyHex (please see image attached), however whenever I try to run a simulation the solver crashes, and I get an error related to the solver (I think its the pressure):
Code:

  PISO: Operating solver in PISO mode

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.005

Courant Number mean: 7.65614e-06 max: 0.355821
smoothSolver:  Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 6.50901e-06, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 0, Final residual = 0, No Iterations 0
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::DICPreconditioner::calcReciprocalD(Foam::Field<double>&, Foam::lduMatrix const&) at ??:?
#4  Foam::DICSmoother::DICSmoother(Foam::word const&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&) at ??:?
#5  Foam::lduMatrix::smoother::addsymMatrixConstructorToTable<Foam::DICSmoother>::New(Foam::word const&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&) at ??:?
#6  Foam::lduMatrix::smoother::New(Foam::word const&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::dictionary const&) at ??:?
#7  Foam::GAMGSolver::initVcycle(Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::lduMatrix::smoother>&, Foam::Field<double>&, Foam::Field<double>&) const at ??:?
#8  Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#9  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
#10  Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam5/platforms/linux64GccDPInt32Opt/bin/icoFoam"
#11  ? in "/opt/openfoam5/platforms/linux64GccDPInt32Opt/bin/icoFoam"
#12  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13  ? in "/opt/openfoam5/platforms/linux64GccDPInt32Opt/bin/icoFoam"
Floating point exception (core dumped)

If I remove the bed everything seems to work normally. Also, I dont know if this may have an impact, but the mesh was generated by adding the STL files and snapping everything from the background mesh (i.e. no tools other than snappyHex were used).

http://i64.tinypic.com/9pwfpe.png
http://i68.tinypic.com/24g7diu.png
https://ibb.co/ks2Y6R https://ibb.co/jF5QLm

Averome October 26, 2017 11:40

in blender there is a function to set the gap, try to play it, then you can import the geometry to SOLIDWORKS or other similar programs, conduct an interference check, and then export in the required format

pbalz October 27, 2017 02:46

Hi pyroWinter,

could you please post the output of checkMesh -constant?
Most likely this is a mesh problem but it could also be related to your boundary conditions. The reason for this is that the solver solves for Uy only, but the current should be in z direction if I see that correctly. This means that your inflow U boundary condition is wrong which could easily lead to a solver crash.

pyroWinter October 27, 2017 04:18

Thank you both for your answers. I hadnt run the checkMesh. This certainly looks not good:
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  5.0                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 5.0-dbb428a3a855
Exec  : checkMesh
Date  : Oct 27 2017
Time  : 09:07:47
Host  : "david-VirtualBox"
PID    : 11119
I/O    : uncollated
Case  : /home/david/Bed
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:          591951
    faces:            1712347
    internal faces:  1641745
    cells:            563168
    faces per cell:  5.95576
    boundary patches: 4
    point zones:      0
    face zones:      0
    cell zones:      0

Overall number of cells of each type:
    hexahedra:    542734
    prisms:        11007
    wedges:        0
    pyramids:      0
    tet wedges:    35
    tetrahedra:    0
    polyhedra:    9392
    Breakdown of polyhedra by number of faces:
        faces  number of cells
            4  4447
            5  4945

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
  *Number of regions: 17
    The mesh has multiple regions which are not connected by any face.
  <<Writing region information to "0/cellToRegion"
  <<Writing region 0 with 563152 cells to cellSet region0
  <<Writing region 1 with 1 cells to cellSet region1
  <<Writing region 2 with 1 cells to cellSet region2
  <<Writing region 3 with 1 cells to cellSet region3
  <<Writing region 4 with 1 cells to cellSet region4
  <<Writing region 5 with 1 cells to cellSet region5
  <<Writing region 6 with 1 cells to cellSet region6
  <<Writing region 7 with 1 cells to cellSet region7
  <<Writing region 8 with 1 cells to cellSet region8
  <<Writing region 9 with 1 cells to cellSet region9
  <<Writing region 10 with 1 cells to cellSet region10
  <<Writing region 11 with 1 cells to cellSet region11
  <<Writing region 12 with 1 cells to cellSet region12
  <<Writing region 13 with 1 cells to cellSet region13
  <<Writing region 14 with 1 cells to cellSet region14
  <<Writing region 15 with 1 cells to cellSet region15
  <<Writing region 16 with 1 cells to cellSet region16

Checking patch topology for multiply connected surfaces...
                  Patch    Faces  Points                  Surface topology
                    bed    30006    36208      ok (closed singly connected)
                  walls    21286    21867  ok (non-closed singly connected)
                  inlet    9742    9969  ok (non-closed singly connected)
                  oulet    9568    9792  ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (-0.424503 -0.424643 -0.203557) (0.424503 0.424651 0.326444)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-9.14422e-17 -4.27301e-16 5.18499e-16) OK.
    Max cell openness = 3.08821e-16 OK.
    Max aspect ratio = 10.1721 OK.
    Minimum face area = 2.57596e-09. Maximum face area = 0.00018358.  Face area magnitudes OK.
    Min volume = 6.21598e-13. Max volume = 1.42826e-06.  Total volume = 0.262035.  Cell volumes OK.
    Mesh non-orthogonality Max: 64.9884 average: 3.9514
    Non-orthogonality check OK.
    Face pyramids OK.
 ***Max skewness = 4.14991, 1 highly skew faces detected which may impair the quality of the results
  <<Writing 1 skew faces to set skewFaces
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

Do you think my mesh needs extensive repairing, or maybe increasing the element count will suffice?
I will try different things and if I solve this I will post it. Again, thanks.

pyroWinter October 27, 2017 11:35

Indeed the problem was in the mesh. It had to do with something I modified in Blender to account for the collision (vertexes were placed inside my domain). Everything is working now, time to wait for the simulations to finish.

wangchengan2003 November 11, 2019 06:13

Dear David,


I want to generate the packed bed media too. Your post interests me a lot. I want to try the blender software. Could you share some tutorials of blender?


Best regards,
Chengan


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