CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Problem running perturbUCyl (http://www.cfd-online.com/Forums/openfoam/98337-problem-running-perturbucyl.html)

sen.1986 March 8, 2012 10:59

Problem running perturbUCyl
 
The question might seem trivial to some, but I am only a beginner with OpenFoam, just 2 weeks into it.

I am trying to simulate pipe flow using LES. I generated the mesh using ICEM CFD and then imported it as Fluent Mesh (.msh file) and then converted it using fluentMeshtoFoam.

I then try to generate turbulence quickly, and hence I try using PerturbCylinder. When I try to run PerturbUcyl on the terminal, the following error message is generated. Any idea, as to how it can be fixed. I am modifying the ChannelFoam inbuilt solver to set up my code.


Quote:

| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.1.0-0bc225064152
Exec : perturbUCyl
Date : Mar 08 2012
Time : 12:44:01
Host : "fwss116"
PID : 13356
Case : /home/sen04/OpenFOAM/sen04-2.1.0/testMesh
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Time = 0
Reading U


--> FOAM FATAL IO ERROR:
size 60000 is not equal to the given value of 180297

file: /home/sen04/OpenFOAM/sen04-2.1.0/testMesh/0/U from line 18 to line 60068.

From function Field<Type>::Field(const word& keyword, const dictionary&, const label)
in file /opt/openfoam210/src/OpenFOAM/lnInclude/Field.C at line 236.

FOAM exiting
Many thanks.

dhruv March 12, 2012 05:46

PeturbU
 
Hi sen,

I am also a newie in OpenFOAM, and I am also simulating the channel flow in OF using LES. I am also trying to use this utility PeturbU, to generate turbulence in the initial field, but did not get a correct version of it, that can run on my machine. Can you tell me the link?

Quote:

Originally Posted by sen.1986 (Post 348384)
The question might seem trivial to some, but I am only a beginner with OpenFoam, just 2 weeks into it.

I am trying to simulate pipe flow using LES. I generated the mesh using ICEM CFD and then imported it as Fluent Mesh (.msh file) and then converted it using fluentMeshtoFoam.

I then try to generate turbulence quickly, and hence I try using PerturbCylinder. When I try to run PerturbUcyl on the terminal, the following error message is generated. Any idea, as to how it can be fixed. I am modifying the ChannelFoam inbuilt solver to set up my code.




Many thanks.


sen.1986 March 12, 2012 06:58

Quote:

Originally Posted by dhruv (Post 348889)
Hi sen,

I am also a newie in OpenFOAM, and I am also simulating the channel flow in OF using LES. I am also trying to use this utility PeturbU, to generate turbulence in the initial field, but did not get a correct version of it, that can run on my machine. Can you tell me the link?

You can download it from here,

http://http://www.cfd-online.com/Forums/openfoam-solving/58905-les-turbulent-pipe-flow.html

It seems ok to me.

Though I have solved the problem that I had stated previously, which was caused due to wrong initialisations in the 0 directory, I am still trying to find my way. As it stands now, I have extremely high Courant numbers. The time step that I deduced from the experimental data is 2d-5. Does someone have a suggestion as to how one might go about it, or maybe, what one might try?

dhruv March 12, 2012 07:56

Courant number
 
Hi,

Thanks for the reply. Regarding the Courant no, did you fix the maxCo in controlDict? It happened in my case too, when I ran the calculation, but then I had fixed it, and it was stable.

Regards,
dhruv.

Quote:

Originally Posted by sen.1986 (Post 348906)
You can download it from here,

http://http://www.cfd-online.com/Forums/openfoam-solving/58905-les-turbulent-pipe-flow.html

It seems ok to me.

Though I have solved the problem that I had stated previously, which was caused due to wrong initialisations in the 0 directory, I am still trying to find my way. As it stands now, I have extremely high Courant numbers. The time step that I deduced from the experimental data is 2d-5. Does someone have a suggestion as to how one might go about it, or maybe, what one might try?


dhruv March 12, 2012 08:27

PerturbU
 
Hi,

Can you tell me how did you compile it. I am using wmake perturbU, and it gives in the following error.

Quote:

Making dependency list for source file perturbU.C
could not open file fvCFD.H for source file perturbU.C
g++ perturbU.C -o perturbU
perturbU.C:43:19: error: fvCFD.H: No such file or directory
perturbU.C:44:20: error: Random.H: No such file or directory
perturbU.C:50:28: error: setRootCase.H: No such file or directory
perturbU.C:52:27: error: createTime.H: No such file or directory
perturbU.C:53:27: error: createMesh.H: No such file or directory
perturbU.C: In function ‘int main(int, char**)’:
perturbU.C:62: error: ‘IOdictionary’ was not declared in this scope
perturbU.C:62: error: expected ‘;’ before ‘perturbDict’
perturbU.C:73: error: ‘scalar’ does not name a type
perturbU.C:74: error: ‘scalar’ does not name a type
perturbU.C:75: error: ‘perturbDict’ was not declared in this scope
perturbU.C:75: error: ‘readBool’ was not declared in this scope
perturbU.C:77: error: ‘direction’ does not name a type
perturbU.C:78: error: ‘direction’ does not name a type
perturbU.C:80: error: ‘Info’ was not declared in this scope
perturbU.C:80: error: ‘h’ was not declared in this scope
perturbU.C:80: error: ‘nl’ was not declared in this scope
perturbU.C:81: error: ‘Retau’ was not declared in this scope
perturbU.C:82: error: ‘Switch’ was not declared in this scope
perturbU.C:84: error: ‘streamDir’ was not declared in this scope
perturbU.C:85: error: ‘spanDir’ was not declared in this scope
perturbU.C:86: error: ‘endl’ was not declared in this scope
perturbU.C:91: error: ‘args’ was not declared in this scope
perturbU.C:91: error: ‘FatalErrorIn’ was not declared in this scope
perturbU.C:94: error: ‘FatalError’ was not declared in this scope
perturbU.C:94: error: ‘exit’ was not declared in this scope
perturbU.C:99: error: ‘args’ was not declared in this scope
perturbU.C:99: error: ‘FatalErrorIn’ was not declared in this scope
perturbU.C:104: error: ‘FatalError’ was not declared in this scope
perturbU.C:104: error: ‘exit’ was not declared in this scope
perturbU.C:109: error: ‘direction’ was not declared in this scope
perturbU.C:109: error: expected ‘;’ before ‘heightDir’
perturbU.C:110: error: ‘heightDir’ was not declared in this scope
perturbU.C:114: error: ‘heightDir’ was not declared in this scope
perturbU.C:120: error: ‘IOobject’ was not declared in this scope
perturbU.C:120: error: expected ‘;’ before ‘Uheader’
perturbU.C:128: error: ‘volVectorField’ was not declared in this scope
perturbU.C:128: error: expected ‘;’ before ‘U’
perturbU.C:130: error: expected ‘;’ before ‘transportProperties’
perturbU.C:142: error: ‘dimensionedScalar’ was not declared in this scope
perturbU.C:142: error: expected ‘;’ before ‘nu’
perturbU.C:146: error: ‘dimensionedVector’ was not declared in this scope
perturbU.C:146: error: expected ‘;’ before ‘Ubar’
perturbU.C:152: error: ‘nu’ was not declared in this scope
perturbU.C:153: error: ‘Ubar’ was not declared in this scope
perturbU.C:155: error: ‘scalar’ does not name a type
perturbU.C:156: error: ‘utau’ was not declared in this scope
perturbU.C:160: error: ‘scalar’ does not name a type
perturbU.C:162: error: ‘scalar’ does not name a type
perturbU.C:163: error: ‘scalar’ does not name a type
perturbU.C:165: error: ‘scalar’ does not name a type
perturbU.C:166: error: ‘scalar’ does not name a type
perturbU.C:169: error: ‘Random’ was not declared in this scope
perturbU.C:169: error: expected ‘;’ before ‘perturbation’
perturbU.C:171: error: expected initializer before ‘&’ token
perturbU.C:173: error: ‘centres’ was not declared in this scope
perturbU.C:173: error: ‘celli’ was not declared in this scope
perturbU.C:173: error: ‘forAll’ was not declared in this scope
perturbU.C:174: error: expected ‘;’ before ‘{’ token
perturbU.C:218: error: expected ‘}’ at end of input
make: *** [perturbU] Error 1
Regards,
Dhruv





Quote:

Originally Posted by sen.1986 (Post 348906)
You can download it from here,

http://http://www.cfd-online.com/Forums/openfoam-solving/58905-les-turbulent-pipe-flow.html

It seems ok to me.

Though I have solved the problem that I had stated previously, which was caused due to wrong initialisations in the 0 directory, I am still trying to find my way. As it stands now, I have extremely high Courant numbers. The time step that I deduced from the experimental data is 2d-5. Does someone have a suggestion as to how one might go about it, or maybe, what one might try?


sen.1986 March 13, 2012 05:20

Quote:

Originally Posted by dhruv (Post 348920)
Hi,

Can you tell me how did you compile it. I am using wmake perturbU, and it gives in the following error.

Regards,
Dhruv

What do you write on the terminal? 'wmake perturbU'? I did the same, and it flashed me the same error.

What you can or rather should do is write 'wmake' only on the terminal. Make sure you are in the 'perturbU' folder, while doing that. It should work, I guess. After that, come out of the perturbU folder and write 'perturbU' on the terminal. The turbulence will be generated I guess.

sen.1986 March 13, 2012 05:54

I found the source of my problem, somewhat though. The modified 'U' field, after I run perturbUCyl is quite unreasonable. Before running perturbUCyl, my internal field is defined uniformly as (1,0,0). After running perturbUCyl, the non uniform internal field varies somewhere in the range of (10e6 - 10e7, 0, 0). Apart from the unusually high Ux, the 0 field for Uz is not expected. Uy is not altered, that is fine, but why Uz?

Anyone with any suggestions?

dhruv March 13, 2012 07:00

PerturbU Compilation error
 
Hi sen.1986

Thanks for the input. i tried to compile it. However it again throws up this error.
Quote:

SOURCE=perturbU.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/soft/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -I/soft/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/soft/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/soft/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/perturbU.o
perturbU.C: In function ‘int main(int, char**)’:
perturbU.C:162: error: ‘physicalConstant’ has not been declared
perturbU.C:165: error: ‘physicalConstant’ has not been declared
make: *** [Make/linux64GccDPOpt/perturbU.o] Error 1
I took a look in the perturbU.C file, where there is a mention of physical constant. How can we specify this constant? What is the significance?

Regards,
Dhruv.

Quote:

Originally Posted by sen.1986 (Post 349091)
What do you write on the terminal? 'wmake perturbU'? I did the same, and it flashed me the same error.

What you can or rather should do is write 'wmake' only on the terminal. Make sure you are in the 'perturbU' folder, while doing that. It should work, I guess. After that, come out of the perturbU folder and write 'perturbU' on the terminal. The turbulence will be generated I guess.


sen.1986 March 13, 2012 08:57

Quote:

Originally Posted by dhruv (Post 349124)
Hi sen.1986

I took a look in the perturbU.C file, where there is a mention of physical constant. How can we specify this constant? What is the significance?

Regards,
Dhruv.

No idea. Check the perturU.c file and your initialisations. (0 directory). Sorry for not being of much help.

sen.1986 March 13, 2012 09:33

Ok, so I found this. The perturbUCyl is functional when I keep the inlet values at zeroGradient. But when I try to put them as cyclic (which is what I need), the following error message is flashed.

Quote:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.1.0-0bc225064152
Exec : perturbUCyl
Date : Mar 13 2012
Time : 14:32:25
Host : "fwss116"
PID : 6645
Case : /home/sen04/OpenFOAM/sen04-2.1.0/testMesh
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0



--> FOAM FATAL ERROR:
face 0 area does not match neighbour by 23.4543% -- possible face ordering problem.
patch:INLET_half0 my area:2.35009 neighbour area:2.97451 matching tolerance:0.0001
Mesh face:534768 fc:(0 -16.2802 18.383)
Neighbour fc:(0 24.4505 1.86661e-05)
If you are certain your matching is correct you can increase the 'matchTolerance' setting in the patch dictionary in the boundary file.
Rerun with cyclic debug flag set for more information.

From function cyclicPolyPatch::calcTransforms()
in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 220.

FOAM exiting
What could have been causing this? All ideas are welcome.

dhruv March 13, 2012 09:38

perturbU compilation
 
Hi

I got the correct answer from this link. Now it works.

http://www.cfd-online.com/Forums/ope...m-2-0-0-a.html

Quote:

Originally Posted by sen.1986 (Post 349149)
No idea. Check the perturU.c file and your initialisations. (0 directory). Sorry for not being of much help.


sen.1986 March 13, 2012 09:44

Quote:

Originally Posted by dhruv (Post 349162)
Hi

I got the correct answer from this link. Now it works.

http://www.cfd-online.com/Forums/ope...m-2-0-0-a.html

Nice! So if you don't mind telling, what conditions are you using for 'inlet' and 'outlet' in the, /0/U file, Boundary field?

dhruv March 13, 2012 09:49

Hi sen,

I was a little late in posting, but the above post is related to the compilation and the problem I was facing with physicalConstant. The link given in my post addresses that.

Secondly, I am using cyclic condition for my inlet and outlet. I ran perturbU but did not encounter these errors. However, I did have error like this, when I tried to run my case having cyclic patches in parallel. The only thing I can recommend you is to try to use createPatch to generate your cyclic patches. I hope it helps.

Quote:

Originally Posted by sen.1986 (Post 349164)
Nice! So if you don't mind telling, what conditions are you using for 'inlet' and 'outlet' in the, /0/U file, Boundary field?


sen.1986 March 15, 2012 06:13

Hello Dhruv,

I got rid of the previous problem. I redid my meshing and modeling, this time using blockmeshdict. The reported problems are mainly caused due to orientation problem of faces.

Anyway, my problem with perturbU is far from being over. The 'U' field that perturbU generates, is very unreasonable. The Ux are in the range of ~4000, Uy is 0 (understandably so), Uz is also 0 (Why?).

Do you have any idea, what might be causing this? Also, it would be helpful if you could attach three files, your 'transportproperties', 'U' after you run perturbU and the script, perturbU.c. Sorry for sounding too demanding.

dhruv March 23, 2012 05:12

PerturbU
 
5 Attachment(s)
Hi Sen,

Sorry for the late reply. Can you tell me the following:

1. What is the velocity that you impose at the beginning of the channel?
2. How did you calculate the expected U_tau and Re_tau?

I am also having the problems with perturbU, that it does not generate the fields in my whole geometry. I am pretty sure, that I am not wrong in giving the dimensions for the channel case, that I have. I am attaching the pictures of the fields getting generated. As you can see, Uz is being generated only in a part of the channel, and the whole thing.

My transport properties are
Code:

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

Ubar            Ubar [ 0 1 -1 0 0 0 0 ] ( 0.8 0 0 );

Retau          Retau [ 0 0 0 0 0 0 0 ] 5;

transportModel  Newtonian;

nu              nu [ 0 2 -1 0 0 0 0 ] 1.52e-06;

//Retau          Retau [ 0 0 0 0 0 0 0 ] 500;

CrossPowerLawCoeffs
{
    nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
    nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
    m              m [ 0 0 1 0 0 0 0 ] 1;
    n              n [ 0 0 0 0 0 0 0 ] 1;
}

BirdCarreauCoeffs
{
    nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
    nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
    k              k [ 0 0 1 0 0 0 0 ] 0;
    n              n [ 0 0 0 0 0 0 0 ] 1;
}


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

My perturbUDict file is

Code:

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

FoamFile
{
    version        2.0;
    format          ascii;

    root            "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
    case            "cavity";
    instance        "system";
    local          "";

    class          dictionary;
    object          perturbUDict;
}

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


// Expected turbulent Re(tau) Reynolds number with respect to utau
Retau 395;

// Streamwise component of flow. 0=x, 1=y, 2=z
streamwise 0;

// Spanwise component of flow. 0=x, 1=y, 2=z
spanwise 2;

// Halfheight of channel. This is the direction normal to both streamwise and
// spanwise directions.
h 0.0024;

// Set (overwrite) velocity to laminar profile
setBulk false;

// Perturb velocity with some cosine like perturbations
perturb true;

// Perturbation properties
//wall normal circulation as a fraction of Ubar/utau
duplus 0.25;
//spanwise perturbation spacing in wall units
betaPlus 200;
//streamwise perturbation spacing in wall units
alphaPlus 500;
//transverse decay
sigma 0.00055;
//linear perturbation amplitude as a fraction of Ubar
epsilon 0.005;


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

Quote:

Originally Posted by sen.1986 (Post 349568)
Hello Dhruv,

I got rid of the previous problem. I redid my meshing and modeling, this time using blockmeshdict. The reported problems are mainly caused due to orientation problem of faces.

Anyway, my problem with perturbU is far from being over. The 'U' field that perturbU generates, is very unreasonable. The Ux are in the range of ~4000, Uy is 0 (understandably so), Uz is also 0 (Why?).

Do you have any idea, what might be causing this? Also, it would be helpful if you could attach three files, your 'transportproperties', 'U' after you run perturbU and the script, perturbU.c. Sorry for sounding too demanding.



All times are GMT -4. The time now is 01:21.