CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   nuTilda profile Boundary Condition issue (https://www.cfd-online.com/Forums/openfoam-pre-processing/189826-nutilda-profile-boundary-condition-issue.html)

dferrando June 28, 2017 06:24

nuTilda profile Boundary Condition issue
 
Hi Foamer.
I'm testing a SpalartAllmaras RANS case, with velocity profile and nuTilda profile at the inlet. U fixedProfile works well but when i try to set this BC in nuTilda, OF brings me the next error.
Code:

--> FOAM FATAL ERROR:
3(1 2 3) does not have the expected length of 1


    From function Foam::Function1Types::CSV<Type>::CSV(const Foam::word&, const Foam::dictionary&, const Foam::word&) [with Type = double]
    in file lnInclude/CSV.C at line 221.

FOAM exiting

Here are my U, Uprofile.csv, nuTilda and nuTildaProfile.csv:

U:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  4.x                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform (0 0 0);

boundaryField
{
    in
    {
        type            fixedProfile;
        profile        csvFile;

        profileCoeffs
        {
                nHeaderLine        0;          // number of header lines
                refColumn          0;          // reference column index
                componentColumns    (1 2 3);    // component column indices
                separator          ",";        // optional (defaults to ",")
                mergeSeparators    no;        // merge multiple separators
                fileName            "0/Uprofile.csv";  // name of csv data file
                outOfBounds        clamp;      // optional out-of-bounds handling
                interpolationScheme linear;    // optional interpolation scheme
        }
        direction        (0 0 1);
        origin          0;
    }

    out
    {
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
    }

    laterales
    {
        type            noSlip;
    }

    techo
    {
        type            noSlip;
    }

    suelo
    {
        type            noSlip;
    }

    bloque
    {
        type            noSlip;
    }
}

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

Uprofile.csv:
Code:

0,0,0,0
0.006,2.745,0,0
0.012,2.935,0,0
0.024,3.175,0,0
0.048,3.435,0,0
0.072,3.627,0,0
0.096,3.824,0,0
0.12,4.021,0,0
0.144,4.21,0,0
0.168,4.362,0,0
0.192,4.491,0,0
0.198,4.502,0,0
0.204,4.586,0,0
0.216,4.606,0,0
0.228,4.712,0,0
0.252,4.854,0,0
0.276,4.993,0,0
0.3,5.132,0,0
0.36,5.449,0,0
0.42,5.782,0,0
0.48,6.077,0,0
0.54,6.338,0,0
0.6,6.588,0,0
0.66,6.693,0,0
0.72,6.751,0,0
0.88,6.751,0,0

nuTilda:
Code:

*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  4.x                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 0.3;

boundaryField
{

    in
    {
        type            fixedProfile;
        profile        csvFile;

        profileCoeffs
        {
                nHeaderLine        0;          // number of header lines
                refColumn          0;          // reference column index
                componentColumns    (1 2 3);    // component column indices
                separator          ",";        // optional (defaults to ",")
                mergeSeparators    no;        // merge multiple separators
                fileName            "0/nuTildaProfile.csv";  // name of csv data file
                outOfBounds        clamp;      // optional out-of-bounds handling
                interpolationScheme linear;    // optional interpolation scheme
        }
        direction        (0 0 1);
        origin          0;
    }

    out
    {
        type            freestream;
        freestreamValue uniform 0.3;
    }

    laterales
    {
        type            fixedValue;
        value          uniform 0;
    }

    techo
    {
        type            fixedValue;
        value          uniform 0;
    }   
 
    suelo
    {
        type            fixedValue;
        value          uniform 0;
    }

    bloque
    {
        type            fixedValue;
        value          uniform 0;
    }

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

nuTildaProfile.csv:
Code:

0,0,0,0
0.006,0.334,0,0
0.012,0.346,0,0
0.024,0.362,0,0
0.048,0.384,0,0
0.072,0.401,0,0
0.096,0.414,0,0
0.12,0.4189,0,0
0.144,0.433,0,0
0.168,0.436,0,0
0.192,0.442,0,0
0.198,0.439,0,0
0.204,0.444,0,0
0.216,0.441,0,0
0.228,0.444,0,0
0.252,0.445,0,0
0.276,0.442,0,0
0.3,0.433,0,0
0.36,0.421,0,0
0.42,0.395,0,0
0.48,0.361,0,0
0.54,0.325,0,0
0.6,0.276,0,0
0.66,0.229,0,0
0.72,0.178,0,0
0.88,0.178,0,0

Thanks a lot and excuse my poor english.

Diego.

dferrando July 4, 2017 07:00

I have already fixed the problem. I was setting nuTilda as a vector, not as a scalar.

bingchuan December 4, 2017 22:19

Hi, Diego.

Could you please post the new nuTilda setting file along with the csv file? I think I have meet the same problem. And I am not sure about the meaning of the four columns in the csv file, the column one to four are related to the x, y, z, t direction? could you please give me more explain about it?
Many Thanks.

Bingchuan

Chris123 February 22, 2018 08:55

This would be also interested for me.
I'am looking for a BC for T which varies with height.
But I do not know how can i specify the height dependence like

Inlet

type fixedProfile;
profile table

(
0m 295K
50m 290K
...
...
);
But this of coure doesn't work, OF expectet just one Value for a scalar!

dferrando February 22, 2018 14:24

Hi!
The problem with my nuTilda BC is that the componentColums line must be (1) since nuTilda is a scalar parameter not a vector.

Chris, try using profile csvFile.
In the csvFile write the height in column 0 and temperature in column1 just like i did with velocity but just write 2 columns, not 4, because temperature it's a scalar parameter.

Sorry for replying so late bingchuan and for my bad english.

Chris123 February 23, 2018 05:57

Hi Diego, thank you it works.

Chris


All times are GMT -4. The time now is 03:11.