CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

settlingFoam fails with timeVarying conditions on U

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 20, 2010, 21:32
Default settlingFoam fails with timeVarying conditions on U
  #1
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Hello,

Bug

settlingFoam fails when a timeVarying boundary condition is used for the U field, since Vdj inherits the boundaryField from U, leading the code to a segmentation fault when

Vdj.correctBoundaryConditions();

is executed.

Proposed solution

I'm not sure why Vdj inherits the BC's from V, since it is computed explicitly. However a workaround could be to replace the declaration of Vdj in createFields.H with (I left the commented line).

Code:
volVectorField Vdj
    (
        IOobject
        (
            "Vdj",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedVector("0.0", U.dimensions(), vector::zero)
        //,U.boundaryField().types()
    );
Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   April 21, 2010, 14:16
Default
  #2
Member
 
Fran
Join Date: Sep 2009
Location: Buenos Aires
Posts: 35
Rep Power: 7
lfbarcelo is on a distinguished road
The bug also exists for alpha BC, since Alpha inherits the boundaryField from alpha.
I tried a similar fix for this BC.

Code:
volScalarField Alpha
    (
        IOobject
        (
            "Alpha",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        alpha*rhod/rho
        //,alpha.boundaryField().types()
    );
Where I commented the comma and the last line.

But I get the next error message when trying to run the case:

Quote:
Starting time loop

Time = 0.1

Courant Number mean: 0.00597056 max: 0.0488136
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 3.67271e-10, No Iterations 3
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 9.12603e-10, No Iterations 3


--> FOAM FATAL ERROR:

gradientInternalCoeffs cannot be called for a calculatedFvPatchField
on patch lowerWall of field Alpha in file "/home/pablo/OpenFOAM/pablo-1.6.x/run/V_1/0/Alpha"
You are probably trying to solve for a field with a default boundary condition.

From function calculatedFvPatchField<Type>::gradientInternalCoef fs() const
in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 187.

FOAM exiting
I've tried creating the Alpha BC in the 0 folder of the case, and reading that boundaryField instead of inheriting it from alpha:

Code:
volScalarField Alpha
    (
        IOobject
        (
            "Alpha",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
       mesh
        // alpha*rhod/rho
        //,alpha.boundaryField().types()
    );
I changed NO_READ for MUST_READ, and commented the line where it calculates Alpha for the first step. I also added the word mesh.

It seems to work fine, but I had to manually calculate and create the Alpha bondaryField File in the 0 folder, and apply the timeVaryingUniformFixedValue to this BC instead of applying it to alpha.

P.S.: Note the difference between alpha and Alpha. Alpha= alpha*rhod/rho

Last edited by lfbarcelo; April 21, 2010 at 16:42. Reason: Found a solution
lfbarcelo is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 34 October 16, 2014 05:27
InterDyMFoam dynamic messing in parallel fails under nonquiescent conditions adona058 OpenFOAM Running, Solving & CFD 5 August 19, 2010 11:47
InterDyMFoam dynamic meshing in parallel fails under nonquiescent conditions adona058 OpenFOAM Bugs 7 November 18, 2008 15:58
Fluent accuracy and boundary conditions Paolo Lampitella FLUENT 0 June 12, 2008 06:25
A problem about setting boundary conditions lyang Main CFD Forum 0 September 19, 1999 18:29


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