CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Turbulence intensity function object for OpenFOAM 2.4.x

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2019, 19:02
Default Turbulence intensity function object for OpenFOAM 2.4.x
  #1
New Member
 
Join Date: Mar 2019
Posts: 11
Rep Power: 3
mörli is on a distinguished road
Hi everyone,


I try to use the function object turbulence Intensity from the developers branch (see link below) in OpenFOAM 2.4.x as I am using SOWFA compiled with OF2.4.x.


https://github.com/OpenFOAM/OpenFOAM...lenceIntensity


Anyhow I am completely new to compiling and have some trouble adapting the files. Especially I don't now what to insert for fvMeshFunctionObject functions as it is not included in OF2.4.x. I guess I have to use functionObjectFile but what do I have to adapt in addition to the name?



Furthermore Uprime is given by calculation with help of averageFields.H within ABLSolver.C. But averageFields.H is included "directly" (it looks more like a .C file and has no header or similar and starts right away instead of "dividing" into .H and .C files). Moreover the .H files can not be found when including it to the turbuöenceIntensity files and also in Make options. Hence I thought for making sure to include all needed values I use the ABLSolver.H file but that one does not exist at all (only the .C file here). How can I handle with this different set up?


Thanks in advance

Last edited by mörli; July 26, 2019 at 04:01.
mörli is offline   Reply With Quote

Old   July 26, 2019, 08:42
Default
  #2
New Member
 
Join Date: Mar 2019
Posts: 11
Rep Power: 3
mörli is on a distinguished road
Hi again,


I tried to use the vorticity function object (and some others) included in OpenFOAM 2.4.x to adapt for my needs. I attaced the .H and .C files


With those i get the following error message:


Code:
TIABL/TIABL.C: In member function ‘virtual void Foam::TIABL::execute()’:
TIABL/TIABL.C:139:35: error: no match for call to ‘(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >) (Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >)’
  TIABL =  mag(U)(sqrt((2.0/3.0)*k));
                                   ^
In file included from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/tmp.H:143:0,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/PtrListI.H:29,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/PtrList.H:322,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/List.C:30,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/List.H:259,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/HashTable.C:30,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/Istream.H:184,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/ISstream.H:39,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/IOstreams.H:38,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/VectorSpace.C:27,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/VectorSpace.H:171,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/Vector.H:44,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/vector.H:39,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/fieldTypes.H:35,
                 from /home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/finiteVolume/lnInclude/volFieldsFwd.H:37,
                 from TIABL/TIABL.H:42,
                 from TIABL/TIABL.C:26:
/home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/tmpI.H:187:11: note: candidate: T& Foam::tmp<T>::operator()() [with T = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
 inline T& Foam::tmp<T>::operator()()
           ^
/home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/tmpI.H:187:11: note:   candidate expects 0 arguments, 1 provided
/home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/tmpI.H:216:17: note: candidate: const T& Foam::tmp<T>::operator()() const [with T = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
 inline const T& Foam::tmp<T>::operator()() const
                 ^
/home/ms-sowfa/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/tmpI.H:216:17: note:   candidate expects 0 arguments, 1 provided
TIABL/TIABL.dep:485: die Regel für Ziel „Make/linux64GccDPOpt/TIABL.o“ scheiterte
make: *** [Make/linux64GccDPOpt/TIABL.o] Fehler 1
As I am completely new to coding it is probably not that difficult but I don't understand the error message and thought I did everything as in the other function objects. Can anyone help?


Btw: So far I am calculating with U instead of Uprime which obviosly is wrong but I wanted to do it step by step and I don't have a clue how to include Uprime (calculated within the ABLSolver I use) yet.



Thanks in advance for any help.
Attached Files
File Type: c TIABL.C (4.1 KB, 3 views)
File Type: h TIABL.H (3.9 KB, 0 views)
mörli is offline   Reply With Quote

Old   July 26, 2019, 10:20
Default
  #3
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 342
Rep Power: 6
mAlletto is on a distinguished road
Maybe TIABL = mag(U)/(sqrt((2.0/3.0)*k))
mAlletto is online now   Reply With Quote

Old   July 26, 2019, 13:06
Default turbModel.U vs "standard" U; averaging LES/RANS
  #4
New Member
 
Join Date: Mar 2019
Posts: 11
Rep Power: 3
mörli is on a distinguished road
Thanks for the fast reply.


You are right I was so focused on the definitions I didn't check the equation itself.


Anyhow in OpenFOAM-dev turbModel.U is used for the calculation. Can you tell me what is the differents between turbModel.U and the "normal" U (f.exp. obr_.lookupObject<volVectorField>("U") ). Is it the same? If so wouldn't I have to adapt it for LES calculations (as it is averaged for RANS obviously already) for turbulence intensity calculation with averaged velocity?


Thanks a lot
mörli is offline   Reply With Quote

Old   July 26, 2019, 13:33
Default
  #5
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 342
Rep Power: 6
mAlletto is on a distinguished road
I think it is the same. This are all references to the U stored in the mesh database
mAlletto is online now   Reply With Quote

Old   July 27, 2019, 09:39
Default
  #6
New Member
 
Join Date: Mar 2019
Posts: 11
Rep Power: 3
mörli is on a distinguished road
Thanks once again.


I succesfully compiled my functionObject. But when I include it in my controldict I get the following error message:


Code:
--> FOAM FATAL ERROR: 
Unknown function type TIABL

Table of functionObjects is empty

In my controlDict I have:


Code:
  functions
  {
TIABL
{
        type            TIABL;
        functionObjectLibs ("libTI.so");
}
  }

I compiled my TIABL functionObject and AverageTI functionObject to the libTI with wmake libso. I got no error message.



Am I missing a step or do I have to include the function object in another way?


I attached the folder with my function objects files



Thanks a lot
Attached Files
File Type: gz turbulenceIntensity.tar.gz (5.4 KB, 8 views)
mörli is offline   Reply With Quote

Old   July 28, 2019, 14:56
Question
  #7
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 342
Rep Power: 6
mAlletto is on a distinguished road
Code:
.  namespace Foam
{
    defineTypeNameAndDebug(TIABL, 0);

    const word TIABL::modelName = "turbulenceModel";
}
I'M not sure but I think you should define your model name al tiabl
mAlletto is online now   Reply With Quote

Old   August 8, 2019, 18:05
Default Output file from function object
  #8
New Member
 
Join Date: Mar 2019
Posts: 11
Rep Power: 3
mörli is on a distinguished road
Hi once again,


and thanks a lot for your support.



The error above was caused as I defined the member function write() (and others), which I think I must, but didn't use them. I now included them (without doing anything) and the script works. I can write the results to the main output file with help of "info".


But I still can't get "file()" to work. Below you can see the part I use in the script:


Code:
forAll(hLevelsValues,hLevelsI)          
Info  << TImeanLevelsList[hLevelsI] << endl;

             // forAll(hLevelsValues,hLevelsI)
             // {
                //   file(0) << " " << TImeanLevelsList[hLevelsI];

             // }

             //file(0) << endl;

The uncommented lines don't work, the others don't. Can anyone help how to use the commands correctly?


I attached the whole code for the function object.



Thanks a lot in advance.
Attached Files
File Type: gz turbulenceIntensity.tar.gz (194.6 KB, 3 views)
mörli is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
interFoam and scalarTransport function object with fvOptions sources fusij OpenFOAM Running, Solving & CFD 3 June 16, 2020 14:53
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
Question on Turbulence Intensity Eric FLUENT 1 March 7, 2012 04:30
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 05:53.