CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Inconsistent behaviour of function object "scale"

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 10, 2019, 09:12
Default Inconsistent behaviour of function object "scale"
  #1
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 129
Rep Power: 12
sita is on a distinguished road
Hi all,

I've been using velocity ramping to start my OF7 interFoam simulations for a while now, without too much trouble so far. However, in my most recent simulation, OpenFOAM suddenly no longer recognises the keyword "duration" in the "scale" entry in 0/U and fvOptions:

Code:
[0] --> FOAM FATAL IO ERROR: 
[0] Illegal dictionary entry or environment variable name "duration"
Valid dictionary entries are 
2
(
type
start
)
The strangest thing is that, when I go back to one of my previous cases and re-run it, they all still run without complaint. I'm fairly sure that there aren't any differences in how I defined the velocity ramp in my current case (in fact I foamClone'd it from one of the previous cases). The only difference I can think of is that, in this problematic case, I'm using a mesh created by SnappyHexMesh, while in all the other cases I used meshes imported from an external mesher. But I can't see how that would influence OF's behaviour regarding scale functionObjects.

Can anyone help me with this?

Many thanks,
Sita

P.S. For sake of completeness, I've also included the contents of my 0/U and fvOptions files below

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      binary;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include        "../constant/refValues";

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    inlet
    {
        type            uniformFixedValue;
        value            $internalField;
        uniformValue    
        {
            value        (#neg $Uref 0 0);
            type         scale;
            scale
            {
                type    quarterSineRamp;
                start    0;
                duration $duration;
            }
        }
    }
    outlet
    {
        type            outletPhaseMeanVelocity;
        alpha           alpha.water;
        value           $internalField;
        UnMean          
        {
            value        $Uref;
            type        scale;
            scale
            {
                type        quarterSineRamp;
                start        0;
                duration    $duration;
            }
        }
    }
    bottom
    {
        type            symmetryPlane;
    }
    side
    {
        type            symmetryPlane;
    }
    midPlane
    {
        type            symmetryPlane;
    }
    hull
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}


// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include    "refValues";

limitU
{
    type            limitVelocity;
    active            yes;
    selectionMode    all;
    max                50;
    duration         1000000.0;
}

velocityRamping
{
    type        accelerationSource;
    active      on;
    selectionMode all;
    U           U;
     velocity
    {
        type    scale;
        scale
        {
            type        quarterSineRamp;
            start       0;
            duration    $duration;
        }
        value    (#neg $Uref 0 0);
    }
}
sita is offline   Reply With Quote

Old   October 14, 2019, 08:36
Default
  #2
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 129
Rep Power: 12
sita is on a distinguished road
Update: by replacing the "duration" keyword in fvOptions in one of my old cases (one that did run) by "banana", I noticed that in the case that's throwing errors, OpenFOAM seems to be looking for "scale" in a different location.

In the working cases OpenFOAM looks in lnInclude/dictionaryTemplates.C, while in my problematic case it looks in db/dictionary/primitiveEntry/primitiveEntry.C

Does anyone have any idea what's going wrong here?

Many thanks,
Sita
sita is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
foamToTecplot360 thomasduerr OpenFOAM Post-Processing 120 March 5, 2019 00:00
How to create a function object in OpenFoam that runs properly ? mkhm OpenFOAM Programming & Development 1 October 20, 2018 16:16
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 1 May 19, 2017 10:13
[snappyHexMesh] Problem with parallel run of snappyHexMesh Lorenzo92 OpenFOAM Meshing & Mesh Conversion 5 April 15, 2016 04:12
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36


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