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

How to access nuSgs from pisoFoam.C

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Lieven

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 25, 2013, 12:45
Default How to access nuSgs from pisoFoam.C
  #1
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Bremen
Posts: 35
Rep Power: 14
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, 18:01
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23
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, 10:44
Default
  #3
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Bremen
Posts: 35
Rep Power: 14
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, 11:50
Default
  #4
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23
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, 15:15
Default
  #5
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Bremen
Posts: 35
Rep Power: 14
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, 15:42
Default
  #6
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23
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:
http://www.cfd-online.com/Forums/ope...lent-flow.html

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


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
Getting access to mesh (fvMesh) via object registry Chris Lucas OpenFOAM Programming & Development 18 January 15, 2024 03:57
[DesignModeler] DesignModeler Scripting: How to get Full Command Access ANT ANSYS Meshing & Geometry 53 February 16, 2020 16:13
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18
Error: access: unbound variable,HELP sudhakar FLUENT 0 January 16, 2007 00:21
Access Density Allan Walsh FLUENT 3 October 4, 2005 08:55


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