View Issue Details

IDProjectCategoryView StatusLast Update
0000739OpenFOAMBugpublic2013-02-11 10:19
Reporteruser589Assigned Tohenry  
PrioritylowSeveritytrivialReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSUbuntuOS Version10.04
Summary0000739: h0 file in tutorial squareBump is in the wrong folder
DescriptionIn the tutorial squareBump ($FOAM_TUTORIALS/incompressible/shallowWaterFoam/squareBump) the file for the initial field h0 is in the wrong folder. Should be moved from folder 'constant' to folder '0'.
TagsNo tags attached.

Activities

henry

2013-02-08 13:20

manager   ~0001886

Why?

user589

2013-02-08 13:27

  ~0001887

The case does not run properly when the h0 file is in the constant folder. It is needed as an initial field for shallowWaterFoam. Not sure what values are used for h0 when it is not stored in the '0' folder, but the results do not become what they should.

This is also noted in the following tutorial at page 5: www.tfd.chalmers.se/~hani/kurser/OS_CFD_2010/johanPilqvist/johanPilqvistReport.pdf

henry

2013-02-08 14:10

manager   ~0001888

It is an initial field but also a constant field hence it is in the constant directory. The case runs propersy for me with h0 being in the constant directory.

user589

2013-02-11 08:22

  ~0001892

I have looked a bit more into this and I still think h0 should be moved to the 0/ folder. When running setFields before running the case it fails if the h0 file is in the constant folder, but not when it is in the 0/ folder. This happens because the field cannot be initialized from the setFieldsDict file. The error arises in line 19 in that file:

volScalarFieldValue h0 0

henry

2013-02-11 10:19

manager   ~0001893

h0 is a constant field and SHOULD be in the "constant" directory. When I wrote the code to create the fields in shallowWaterFoam I specifically select the directory in which the mesh directory resides for h0 because it is effectively geometry:

volScalarField h0
(
    IOobject
    (
        "h0",
        runTime.findInstance("polyMesh", "points"),
        mesh,
        IOobject::READ_IF_PRESENT
    ),
    mesh,
    dimensionedScalar("h0", dimLength, 0.0)
);


If you really want h0 to be in the 0 directory despite the fact that it is time-invariant you will need to change the above code.

To avoid further confusion I have removed the setFieldsDict file which is not used.

Issue History

Date Modified Username Field Change
2013-02-08 13:11 user589 New Issue
2013-02-08 13:20 henry Note Added: 0001886
2013-02-08 13:27 user589 Note Added: 0001887
2013-02-08 14:10 henry Note Added: 0001888
2013-02-08 14:13 henry Status new => closed
2013-02-08 14:13 henry Assigned To => henry
2013-02-08 14:13 henry Resolution open => no change required
2013-02-11 08:22 user589 Note Added: 0001892
2013-02-11 08:22 user589 Status closed => feedback
2013-02-11 08:22 user589 Resolution no change required => reopened
2013-02-11 10:19 henry Note Added: 0001893
2013-02-11 10:19 henry Status feedback => resolved
2013-02-11 10:19 henry Resolution reopened => no change required