CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Oscillating velocity inlet (https://www.cfd-online.com/Forums/openfoam-solving/58014-oscillating-velocity-inlet.html)

xiuying October 8, 2007 19:24

Hi, I began to use Openfoam s
 
Hi,
I began to use Openfoam simulating a rough channel flow with turbulent model and oscillating velocity inlet. I wrote the file /0/U as follows. But when I run it, The wrong is like the following. Could you tell me how to deal with problem. Thank you.

Kang


Nprocs : 1
Create time

Create mesh for time = 0

Reading field p

Reading field U



--> FOAM FATAL IO ERROR : wrong token type - expected Scalar found on line 36 the word 'uniform'

file: /OpenFOAM/xiuying-1.4.1/run/tutorials/turbFoam/rough/0/U::amplitude at line 36.

From function operator>>(Istream&, Scalar&)
in file lnInclude/Scalar.C at line 85.

FOAM exiting




/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class volVectorField;
object U;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type oscillatingFixedValue;
refValue uniform (0 0 0);
amplitude uniform (1.0 0 0);
frequency 100;
value uniform (0 0 0);
}

outlet
{
type zeroGradient;
}

upperWall
{
type slip;
}

lowerWall
{
type fixedValue;
value uniform (0 0 0);
}

frontAndBack
{
type empty;
}
}


// ************************************************** ***********************

mattijs October 9, 2007 04:14

It says that at line 36 it exp
 
It says that at line 36 it expects a scalar but is reading 'uniform'.

My guess is that the amplitude and frequency are all single scalars. Check the source code (finiteVolume/lnInclude/oscillatingFixedValueFvPatchField.*) to make sure is my advice.

xiuying October 9, 2007 17:07

Hi,Mattijs, The velocity is
 
Hi,Mattijs,

The velocity is a vector. Please tell me how to deal with the problem. Thanks.

Kang

patriem February 1, 2009 11:53

Hello, did you handle that
 
Hello,

did you handle that problem? I am at the same point at the moment...
Would be great if someone could help finding a solution.

Regards,
Patrick

daniels February 2, 2009 02:05

Hi, amplitude is a scalar,
 
Hi,

amplitude is a scalar, try

...
inlet
{
type oscillatingFixedValue;
refValue uniform (1. 0 0);
amplitude 1.0;
frequency 100;
value uniform (0 0 0);
}

(You can find out what type is required in line 59ff of src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingF ixedValueFvPatchField.H)

Daniel


All times are GMT -4. The time now is 19:43.