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

How to access nuSgs from pisoFoam.C

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

Like Tree1Likes
  • 1 Post By Lieven

Reply
 
LinkBack Thread Tools Display Modes
Old   January 25, 2013, 11:45
Default How to access nuSgs from pisoFoam.C
  #1
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Karlsruhe
Posts: 35
Rep Power: 3
letzel is on a distinguished road
Dear Foamers,

my task is to add a passive scalar transport equation to pisoFoam.C. Since this is to be run as LES, the subgrid-scale scalar flux is also required, for which I need nuSgs. I would like to know how to access nuSgs from the modified pisoFoam.C.

Compilation of pisoModified.C
Code:
...
        turbulence->correct();

        solve
        (
            fvm::ddt(s)
          + fvm::div(phi, s)
          - fvm::laplacian(nuSgs(), s)
          ==
          sSource
        );

        runTime.write();
...
gives the error message
Code:
pisoModified.C:135: error: ´nuSgs´ was not declared in this scope
I have tried a recommendation from 2009,
Code:
sgsModel->nuSgs()
but the error message then simply changes to
Code:
pisoModified.C:135: error: ´sgsModel´ was not declared in this scope
I would be grateful for any suggestions.

Marcus
letzel is offline   Reply With Quote

Old   January 25, 2013, 17:01
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 293
Rep Power: 11
Lieven will become famous soon enough
Use
Code:
turbulence->nuSgs()
Have a look at createFields.H and try to understand why this works.

If I were you, I would also include a Schmidt-number in the laplacian...

Cheers,

Lieven
Lieven is offline   Reply With Quote

Old   January 26, 2013, 09:44
Default
  #3
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Karlsruhe
Posts: 35
Rep Power: 3
letzel is on a distinguished road
Thank you for your advice, Lieven.

Changing
Code:
nuSgs()
to
Code:
turbulence->nuSgs()
yields the compilation error
Code:
pisoModified.C:135: error: ‘class Foam::incompressible::turbulenceModel’ has no member named ‘nuSgs’
I have then checked the list of class members, and as far as I understand, it should be fine if I reference nuSgs() from the class LESModel as
Code:
LESModel->nuSgs()
so that my code works with any LESModel. This, however, yields the old error message again:
Code:
pisoModified.C:135: error: ´LESModel´ was not declared in this scope
Where is my mistake?
letzel is offline   Reply With Quote

Old   January 26, 2013, 10:50
Default
  #4
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 293
Rep Power: 11
Lieven will become famous soon enough
Sorry, my mistake. U should use
Code:
turbulence->nut()
which will return nuSgs() in case of an LESModel.

Cheers,


Lieven
sdharmar likes this.
Lieven is offline   Reply With Quote

Old   January 27, 2013, 14:15
Default
  #5
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Karlsruhe
Posts: 35
Rep Power: 3
letzel is on a distinguished road
This works, thank you, Lieven.

Now, probably my final question in this thread, I would like to know how I could have deduced this information by myself. If you are aware of a relevant post or documentation that teaches users how to proceed themselves in such cases, please kindly let me know. Of course, in the end it is a matter of personal OpenFOAM experience.
letzel is offline   Reply With Quote

Old   January 27, 2013, 14:42
Default
  #6
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 293
Rep Power: 11
Lieven will become famous soon enough
Well... it's probably a combination of experience and a lot of reading on this forum/pages found via Google/tutorials/...
e.g. I just saw for example that there is a similar discussion going on here:
add a pssive scalar in turbulent flow

It will probably also help to read a bit about the principles of object oriented programming, and in particular about inheritance and it's implementation in C++ cause OF is simply filled with this.

The C++ Source Guide created by Doxygen (http://www.openfoam.org/docs/cpp/) is also a huge aid in understanding the OF source code structure so I advise you to try to familiarize yourself with it (e.g. try to find the solution I gave you using Doxygen).

Of course, if you still end up stuck, there is certainly no shame in posting something on this forum .

Cheers,

Lieven
Lieven is offline   Reply With Quote

Reply

Tags
large eddy simulation, nusgs, pisofoam, scalar transport

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[DesignModeler] DesignModeler Scripting: How to get Full Command Access ANT ANSYS Meshing & Geometry 3 June 6, 2014 04:35
Getting access to mesh (fvMesh) via object registry Chris Lucas OpenFOAM Programming & Development 14 June 4, 2014 05:52
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 17:18
Error: access: unbound variable,HELP sudhakar FLUENT 0 January 15, 2007 23:21
Access Density Allan Walsh FLUENT 3 October 4, 2005 07:55


All times are GMT -4. The time now is 07:51.