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

Differences simpleFoam vs. pimpleFoam / RASModel.H vs turbulenceModel.H

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2012, 20:32
Default Differences simpleFoam vs. pimpleFoam / RASModel.H vs turbulenceModel.H
  #1
uli
New Member
 
Join Date: Jun 2012
Posts: 25
Rep Power: 14
uli is on a distinguished road
hi

I am trying to get a turbulence model (for heat flux) running that was implemented in simplefoam the following way:
  • introducing a volScalarField T (temperature) in createfields
  • introducing a TEqn.H file that includes the energy equation AND the turbulence model for the heat flux, which itself includes wallfunctions for some coefficients
  • adding "include TEqn.H" to mysimpleFoam.C
  • making other *.H files (like wallFvPatch.H and nearWallDist.H) available by adding "include <filename.H>"
After some minor changes due to the newer OF version I use (2.1.1) I am able to compile and run the modified simpleFoam solver.

But for pimpleFoam it does not work (I applied the above steps on pimpleFoam). Simplefoam uses RASModel.H whereas pimpleFoam uses turbulenceModel.H. What is the difference?

Without replacing
Code:
include "turbulenceModel.H"
by
Code:
include "RASModel.H"
in the mypimpleFoam.C file I get
Code:
/home/uli/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/nearWallDist.H: In function 'int main(int, char**)':
/home/uli/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/nearWallDist.H:44:1: error: 'namespace' definition is not allowed here
In file included from pimpleFoamT_YSC.C:75:0:
TEqn.H:50:77: error: 'nearWallDist' was not declared in this scope
when I try to compile the solver.

So I replaced turbulenceModel.H by RASModel.H and it compiled without error message, but running a case I get:
Code:
Starting time loop
Courant Number mean: 0.0219895 max: 0.686747
Time = 0.002059
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 8.15401e-07, No Iterations 4
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 5.46016e-07, No Iterations 4
 
--> FOAM FATAL ERROR: 
hanging pointer, cannot dereference
From function PtrList::operator[] const
in file /home/uli/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/PtrListI.H at line 134.
FOAM aborting
#0 Foam::error::printStack(Foam::Ostream&) in "/home/uli/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/uli/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 
at pimpleFoamT_YSC.C:0
#3 
in "/home/uli/OpenFOAM/uli-2.1.1/platforms/linux64GccDPOpt/bin/pimpleFoamT_YSC"
#4 __libc_start_main in "/lib64/libc.so.6"
#5 
at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:116
Any help is appreciated.

I use RAS and normally pisoFoam but since the model was implemented in simpleFoam I thought it might be easier to use pimpleFoam for this case.

Uli
uli is offline   Reply With Quote

Old   October 9, 2012, 10:08
Default
  #2
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Code:
include "turbulenceModel.H"
means, that the solver is using OpenFOAMs generic turbulence model. Consequently, you can use RAS or LES modelling.

When you find

Code:
include "RASModel.H"
in a solver, this solver only uses RAS modelling. So the only choice you have is whether to use RAS turbulence models or not.
GerhardHolzinger is offline   Reply With Quote

Old   October 11, 2012, 21:23
Default
  #3
uli
New Member
 
Join Date: Jun 2012
Posts: 25
Rep Power: 14
uli is on a distinguished road
hello Gerhard, thank you for you answer.

Your explanation is what I assumed. What I do not understand is why I get the error posted above ("error: 'namespace' definition is not allowed here") when compiling my modified solver,
but when I - instead of turbulencemodel.H - include RASModel.H, I can compile the solver. However, I get the 2nd error posted above when I run my case.

Uli
uli is offline   Reply With Quote

Old   October 13, 2012, 05:51
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Uli: I would suggest that you check the buoyant solvers located at "applications/solvers/heatTransfer" for more ideas.

As for RASModel vs turbulenceModel, (I think) the access to the wall functions is a bit different, which is why you're having problems.
If you could post/attach the "TEqn.H" file, it would make it a lot easier to diagnose the problem!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   October 22, 2012, 00:43
Default
  #5
uli
New Member
 
Join Date: Jun 2012
Posts: 25
Rep Power: 14
uli is on a distinguished road
hi, sorry for the delay

I checked the Heat transfer solvers but they don't include "nearWallDist.H", which seems to be the source of the problem.

Attached you find the TEqn.H file. Thanks for any kind of help.
Attached Files
File Type: h TEqn.H (6.5 KB, 66 views)
uli is offline   Reply With Quote

Old   November 4, 2012, 06:12
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Uli,

Now I don't know why you're having problems Attached is the code resulting from these steps:
  1. Working on OpenFOAM 2.1.x.
  2. Made a copy of the source code for pimpleFoam to my user folder:
    Code:
    cd $FOAM_RUN
    cd ..
    cp -r $FOAM_SOLVERS/incompressible/pimpleFoam .
    mv pimpleFoam pimpleFoam_WT
  3. Modified the last line in "Make/files", changing the target location and name.
  4. Removed the other two derived solvers (SRF and DyM), as well as "Allwmake".
  5. Added "TEqn.H" to the folder and included it after the "for" cycle of the "pimple.loop()".
  6. In "createFields.H", I cloned the creation of the "p" scalar field and renamed the clone as "T" field.
  7. Ran wmake. Loads of problems.
  8. Added:
    Code:
    #include "wallFvPatch.H"
    To the top inclusion list in "pimpleFoam.C".
  9. Edited "TEqn.H" and commented out everything below "Wall correction for C1", because I don't have a lot of the mentioned variables, since you only provided this file
  10. Ran wmake and it built without any problems!
I didn't need to include "wallDist" per-se. I based myself on the code "applications/test/nearWallDist-wave/Test-WallDist2.C", hence the inclusion of "wallFvPatch.H".


Best regards,
Bruno
Attached Files
File Type: gz pimpleFoam_WT.tar.gz (3.3 KB, 35 views)
__________________

Last edited by wyldckat; November 4, 2012 at 06:21. Reason: had a bad attachment...
wyldckat is offline   Reply With Quote

Old   January 24, 2013, 19:18
Default TEqn.H
  #7
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Hi Bruno,

I looked through files you have attached in the previous post. I don't understand why the part
fvScalarMatrix TEqn
// (
// fvm::div(phi, T)
// - fvm::laplacian(kappaEff, T)
// );
//
// TEqn.relax();

is commented since it meant to solve the temperature equation.

I am also trying to include TEqn in simpleFoam solver. And I used the TEqn.H as given below.
{
volScalarField kappaEff
(
"kappaEff",
turbulence->nu()/Pr + turbulence->nut()/Prt
);

fvScalarMatrix TEqn
(
//fvm::ddt(T)
fvm::div(phi, T)
- fvm::laplacian(kappaEff, T)
);

TEqn.relax();

TEqn.solve();

//rhok = 1.0 - beta*(T - TRef);
}

Is this wrong? or what is your opinion?

Thanks and best regards,
Suranga.
sdharmar is offline   Reply With Quote

Old   January 26, 2013, 16:01
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Suranga,

The previous posts should have given you the hint that I'm not experienced enough in OpenFOAM's source code in order to be able to guess the problems from loose code written on a post.

If you really want us (i.e. any one on the forum) to help you, please provide the source code that you can share. Or at least, describe the exact steps you've taken so that anyone can reach the same point you're in right now.

Best regards,
Bruno

edit: I've moved Suranga's answer to a new thread, in an attempt to gather the problem in a single thread: http://www.cfd-online.com/Forums/ope...implefoam.html
__________________

Last edited by wyldckat; January 27, 2013 at 17:28. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Reply


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
pimpleFoam vs simpleFoam vs pisoFoam vs icoFoam? phsieh2005 OpenFOAM Running, Solving & CFD 45 March 22, 2021 10:14
Laminar simpleFoam and inviscid simpleFoam herenger OpenFOAM Running, Solving & CFD 7 July 11, 2013 07:27
Trying to run a benchmark case with simpleFoam spsb OpenFOAM 3 February 24, 2012 10:07
Differences between simpleFoam an turbFoam francois OpenFOAM Running, Solving & CFD 3 November 15, 2005 15:03


All times are GMT -4. The time now is 09:04.