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/)
-   -   Modified tutorial 3D to 2D; pimpleDyMFoam crashing (http://www.cfd-online.com/Forums/openfoam-solving/119729-modified-tutorial-3d-2d-pimpledymfoam-crashing.html)

Boloar June 24, 2013 02:13

Modified tutorial 3D to 2D; pimpleDyMFoam crashing
 
1 Attachment(s)
Hi everyone.
I'm very much an OpenFOAM beginner, so advice here would really be appreciated.

With a lot of effort, I repurposed the tutorial incompressible/pimpleDyMFoam/propeller to model a wind turbine in 2D. Or at least I've attempted to.
After running snappyHexMesh, the checkMesh utility gives me these errors:
Code:

...

 ***Total number of faces on empty patches is not divisible by the number of cells in the mesh. Hence this mesh is not 1D or 2D.
...
 ***Number of edges not aligned with or perpendicular to non-empty directions: 102515
...

In addition (or perhaps, as a result of this), the pimpleDyMFoam solver crashes almost immediately on starting with a floating point exception.

My case files are attached for your perusal.
Thanks in advance for any help!

nimasam June 24, 2013 07:11

Dear anand
you are going to solve a 2D problem, so your mesh should have just one cell thick,
after snappyHexMesh, you should use extrudeMesh to create a true 2D geometry

Boloar June 25, 2013 05:37

Mesh is proper 2D! pimpleDyMFoam still crashing
 
1 Attachment(s)
Quote:

Originally Posted by nimasam (Post 435592)
after snappyHexMesh, you should use extrudeMesh to create a true 2D geometry

Hi nimasam,
Thanks for that, I had not realized that. The mesh is now correct.

I am still unable to figure out why pimpleDyMFoam keeps crashing, though.

I have redone my case, and borrowed several of the boundary and initial conditions from the incompressible/pimpleDyMFoam/wingMotion tutorials. It keeps crashing almost immediately, giving the error below. I'm sure it has to do with the initial conditions, since it crashes immediately after reading k, but all of them seem valid to me ...

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.0-5be49240882f
Exec  : pimpleDyMFoam
Date  : Jun 25 2013
Time  : 15:00:48
Host  : "fedorael"
PID    : 9244
Case  : wingMotion/pimpleDyMFoam
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Selecting dynamicFvMesh solidBodyMotionFvMesh
Selecting solid-body motion function rotatingMotion
Applying solid body motion to cellZone AMIsurface_z
Reading field p

AMI: Creating addressing and weights between 1536 source faces and 1536 target faces
AMI: Patch source weights min/max/average = 0.04771037154, 1, 0.9089661396
AMI: Patch target weights min/max/average = 0, 1.632719212, 0.9069578828
Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
bounding k, min: 0 max: 37 average: 37
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2 
 at sigaction.c:?
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  void Foam::divide<Foam::fvPatchField>(Foam::FieldField<Foam::fvPatchField, double>&, Foam::FieldField<Foam::fvPatchField, double> const&, Foam::FieldField<Foam::fvPatchField, double> const&) at ??:?
#5  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#6  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::average<double>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#7  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::average<double>(Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&) at ??:?
#8  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::average<double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::average<double>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#10  Foam::bound(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::dimensioned<double> const&) at ??:?
#11  Foam::incompressible::RASModels::kOmegaSST::kOmegaSST(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&, Foam::word const&) at ??:?
#12  Foam::incompressible::RASModel::adddictionaryConstructorToTable<Foam::incompressible::RASModels::kOmegaSST>::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#13  Foam::incompressible::RASModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#14  Foam::incompressible::turbulenceModel::addturbulenceModelConstructorToTable<Foam::incompressible::RASModel>::NewturbulenceModel(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#15  Foam::incompressible::turbulenceModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#16 
 at ??:?
#17  __libc_start_main at ??:?
#18 
 at ??:?
Floating point exception (core dumped)

Any idea how to fix this? Case files are attached.

kilroy June 27, 2013 11:29

Anand,

Have you tried to clean your "/constant/polyMesh/" folder? Maybe you still have some excess files in that folder from your previous runs.

Best,

Kilroy

Boloar June 28, 2013 00:40

Hi Kilroy,

I've removed any and all irrelevant files, to the best of my knowledge. Meshing is perfect, as far as I can tell, and pimpleDyMFoam still crashes. No previous runs - I haven't even got one successful run yet, lol

Boloar June 29, 2013 01:46

I've tried changing the relaxation factors, the solvers, the schemes, the initial condition values, anything I could.
Nothing works, it keeps getting a floating point exception in exactly the same spot: immediately after reading k. The bounding value of k goes from 0 to 37, and evidently it doesn't like that zero, according to the error report.
I have NO idea how to fix this. Help will be deeply appreciated.

kilroy June 29, 2013 01:48

I will try to look into your case on Monday and let you know if I can some errors. Have a nice weekend!

Boloar June 29, 2013 01:55

Thank you Kilroy!

Background info on the case: I modified the incompressible/pimpleDyMFoam/propeller 3D tutorial into a 2D form with my own STL files, to take advantage of the AMI implementation, and it seems correct.
Then I intended to use that AMI-enabled mesh with the pimpleDyMFoam/wingMotion airflow conditions - but it keeps crashing.
It seemed plausible in concept, I hope it can be resolved.

*****************
UPDATE:

Okay, so maybe I'm stupid. I had defined the AMI regions (type cyclicAMI;) in the initial conditions 0/include/AMI, but I foolishly forgot to assign a value to them i.e. value $internalField. Now the solver goes past that stage and crashes slightly later with exactly the same error.

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.0-5be49240882f
Exec  : pimpleDyMFoam
Date  : Jun 29 2013
Time  : 15:51:28
Host  : "fedorael"
PID    : 14108
Case  : wingMotion/pimpleDyMFoam
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Selecting dynamicFvMesh solidBodyMotionFvMesh
Selecting solid-body motion function rotatingMotion
Applying solid body motion to cellZone AMIsurface_z
Reading field p

Reading field U

Reading/calculating face flux field phi

AMI: Creating addressing and weights between 1536 source faces and 1536 target faces
AMI: Patch source weights min/max/average = 0.04771037154, 1, 0.9089661396
AMI: Patch target weights min/max/average = 0, 1.632719212, 0.9069578828
Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1        0.85034;
    alphaK2        1;
    alphaOmega1    0.5;
    alphaOmega2    0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1          0.075;
    beta2          0.0828;
    betaStar        0.09;
    a1              0.31;
    b1              1;
    c1              10;
    F3              false;
}

Reading field rAU if present

Creating finite volume options
No finite volume options present


PIMPLE: no residual control data found. Calculations will employ 2 corrector loops


Starting time loop

Courant Number mean: 12.53463609 max: 353.4174513
deltaT = 0.00025
Time = 0.00025

solidBodyMotionFunctions::rotatingMotion::transformation(): Time = 0.00025 transformation: ((0 0 0) (0.9999996916 (0 0 0.0007853980827)))
AMI: Creating addressing and weights between 1536 source faces and 1536 target faces
AMI: Patch source weights min/max/average = 0.06740513704, 2.343027326, 1.197313318
AMI: Patch target weights min/max/average = 0, 2.317230511, 1.190243699
GAMG:  Solving for pcorr, Initial residual = 1, Final residual = 0.01249677062, No Iterations 7
time step continuity errors : sum local = 1.535166181e-06, global = -2.375415942e-08, cumulative = -2.375415942e-08
PIMPLE: iteration 1
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2 
 at sigaction.c:?
#3  Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) at ??:?
#4  void Foam::divide<Foam::fvPatchField>(Foam::FieldField<Foam::fvPatchField, double>&, double const&, Foam::FieldField<Foam::fvPatchField, double> const&) at ??:?
#5  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#6 
 at ??:?
#7  __libc_start_main at ??:?
#8 
 at ??:?
Floating point exception (core dumped)


Boloar July 3, 2013 03:50

After my minor breakthrough about the initial conditions file, I haven't made any progress ... any luck, Kilroy? (or anyone else who may have taken a look at the case?)

For the life of me I can't figure out where that division error is coming from.

nimasam July 3, 2013 04:28

Dear annad
problem is somewhere else ;), it returns to your poor AMI BC,
now solver is going to map to a face with weight 0 and its not possible :),
so its better that you work on your meshing and create AMI with weighting around 1

Boloar July 3, 2013 05:16

Hi nimasam,
I think I see what you mean. But I'm not sure how to fix that ... Do I need to increase the snappyHexMesh refinement levels? Change the AMI tolerance or rotational velocity?
I tried to copy the AMI setup of the propeller tutorial as closely as possible.

nimasam July 3, 2013 05:21

i think you should work on snappyHexMesh, to create much more uniform AMI faces,
did you use stl file to create cylinder? or you may want to use edgeSnappFeature, to have better edge resolution

Boloar July 3, 2013 05:28

Quote:

Originally Posted by nimasam (Post 437502)
i think you should work on snappyHexMesh, to create much more uniform AMI faces,
did you use stl file to create cylinder? or you may want to use edgeSnappFeature, to have better edge resolution

I've increased the "feature edge refinement" in sHM from 2 levels to 4. Yes, I used a cylinder STL file to define the AMI where it intersects with the blockMesh ... would it work better if I implemented it as a "searchableCylinder" instead?
Could you elaborate a little bit on the edgeSnappFeature you just mentioned?

nimasam July 3, 2013 05:45

propeller
 
1 Attachment(s)
enjoy it;)

Boloar July 3, 2013 06:00

Quote:

Originally Posted by nimasam (Post 437511)
enjoy it;)

You, sir, are a God among men. I honestly would never have thought to reduce the sHM refinement :eek:
Thank you! :D


All times are GMT -4. The time now is 08:30.