View Issue Details

IDProjectCategoryView StatusLast Update
0001566OpenFOAMBugpublic2015-03-13 22:20
Reporteruser1101Assigned Tohenry  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Summary0001566: Time dependant Boundary Condition crash with shallowWaterFoamSolver
DescriptionUsing time dependant BC for shallowWaterFoam solver with:
-> uniformFixedValue and table value "http://www.openfoam.org/version2.1.0/boundary-conditions.php"
or
-> groovyBC (from swak4Foam)
is impossible.

In the first case, the solver crash at first iteration.
In the second case, no crash but boundary conditions are not affected at all
Steps To ReproduceUse the attached 0/U file for the shallowWaterFoam squareBump tutorial
Additional InformationI fixed this issue using h and hU boundary conditions, instead of h and U.
In order to do that, I have modified the createFields.H of shallowWaterFoam solver like:

Info<< "Creating field hU\n" << endl;
volVectorField hU
(
    IOobject
    (
        "hU",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
    ),
    mesh
);

Info<< "Reading field U\n" << endl;
volVectorField U
(
    IOobject
    (
        "U",
    runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    hU/h
);
TagsNo tags attached.

Activities

user1101

2015-03-11 15:09

 

U (1,250 bytes)   
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0.1 0 0);

boundaryField
{
    sides
    {
        type            slip;
    }
    inlet
    {
        type            uniformFixedValue;
        uniformValue    table 
	(
		(0  (0 0 0))
		(100 (0.5 0 0))
	);
    }
    outlet
    {
        type            zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
}


// ************************************************************************* //
U (1,250 bytes)   

henry

2015-03-13 21:04

manager   ~0004118

Yes, to handle complex boundary conditions it is necessary that hU rather than U is read unless special treatment to transfer BC data is implemented which is a pain. I will change the code to read hU as you suggest.

henry

2015-03-13 22:20

manager   ~0004119

Resolved by commit 7077338993a18fdd3bbf8488b172aab15e4d6443

Issue History

Date Modified Username Field Change
2015-03-11 15:09 user1101 New Issue
2015-03-11 15:09 user1101 File Added: U
2015-03-11 15:11 henry Priority urgent => normal
2015-03-13 21:04 henry Note Added: 0004118
2015-03-13 22:20 henry Note Added: 0004119
2015-03-13 22:20 henry Status new => resolved
2015-03-13 22:20 henry Resolution open => fixed
2015-03-13 22:20 henry Assigned To => henry
2015-03-24 00:17 liuhuafei Issue cloned: 0001612