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

Source in k-equation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 27, 2012, 04:07
Default Source in k-equation
  #1
New Member
 
Join Date: Feb 2012
Posts: 4
Rep Power: 5
paalj is on a distinguished road
Dear all,

I want to include a temperature dependent source term in the k-equation of the kOmegaSST turbulence model. There is a tutorial how to copy and compile the keps model and I was able to do the mentioned steps for the kOmegaSST model too. It works. Now the modification of the k-equation has to be performed. I tried to access field values of T via

const volScalarField& T = mesh().objectRegistry::lookupObject<volScalarField >("T");

but I got the error that "mesh" was not declared in this scope.
I really read a lot about accessing field values but was not able to succeed. Furthermore I am not shure where exactly I have to add this few commands (e.g. right before k-equation or somewhere else...). I am quite new to OF and my knowledge about C++ is very bad.

Best regards!
paalj is offline   Reply With Quote

Old   July 2, 2012, 06:33
Default
  #2
New Member
 
Andreas Herwig
Join Date: Jan 2011
Posts: 6
Rep Power: 6
Andreas.Herwig is on a distinguished road
please have a look here

Compile error kEpsilonViollet for OF 2.1.1

You need something like

Code:
const volScalarField& T_ = U_.db().lookupObject<volScalarField>(TName_);
where TName_ is the name of your temperature field like "T" and U_ a field which is accessible because the objectRegistry you access by db() seems to be attached to a field (or somehow like this).

greetings

andreas
Andreas.Herwig is offline   Reply With Quote

Old   July 2, 2012, 09:23
Default
  #3
New Member
 
Join Date: Feb 2012
Posts: 4
Rep Power: 5
paalj is on a distinguished road
Thx a lot - the compiler showed no error and the solver runs with reasonable results in serial mode. But I face a problem in parallel computing. When executing "decomposePar" I receive following error message:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / 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 : decomposePar
Date : Jul 02 2012
Time : 15:01:40
Host : "paalj-openfoam"
PID : 3811
Case : /home/paalj/OpenFOAM/paalj-2.1.0/run/cavity
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

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : /home/paalj/OpenFOAM/paalj-2.1.0/platforms/linuxGccDPOpt/lib/libccRASModel.so: undefined symbol: _ZN4Foam14incompressible8RASModel11printCoeffsEv
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libccRASModel.so"
Time = 0
Create mesh

Calculating distribution of cells
Selecting decompositionMethod simple

Finished decomposition in 0.07 s

Calculating original mesh data

Distributing cells to processors

Distributing faces to processors

Distributing points to processors

Constructing processor meshes
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : /home/paalj/OpenFOAM/paalj-2.1.0/platforms/linuxGccDPOpt/lib/libccRASModel.so: undefined symbol: _ZN4Foam14incompressible8RASModel11printCoeffsEv
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libccRASModel.so"

Processor 0
Number of cells = 3335
Number of faces shared with processor 1 = 44
Number of processor patches = 1
Number of processor faces = 44
Number of boundary faces = 6934
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : /home/paalj/OpenFOAM/paalj-2.1.0/platforms/linuxGccDPOpt/lib/libccRASModel.so: undefined symbol: _ZN4Foam14incompressible8RASModel11printCoeffsEv
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libccRASModel.so"

Processor 1
Number of cells = 3334
Number of faces shared with processor 0 = 44
Number of faces shared with processor 2 = 44
Number of processor patches = 2
Number of processor faces = 88
Number of boundary faces = 6824
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : /home/paalj/OpenFOAM/paalj-2.1.0/platforms/linuxGccDPOpt/lib/libccRASModel.so: undefined symbol: _ZN4Foam14incompressible8RASModel11printCoeffsEv
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libccRASModel.so"

Processor 2
Number of cells = 3334
Number of faces shared with processor 1 = 44
Number of processor patches = 1
Number of processor faces = 44
Number of boundary faces = 6866

Number of processor faces = 88
Max number of cells = 3335 (0.019994% above average 3334.33)
Max number of processor patches = 2 (50% above average 1.33333)
Max number of faces between processors = 88 (50% above average 58.6667)


Processor 0: field transfer
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : /home/paalj/OpenFOAM/paalj-2.1.0/platforms/linuxGccDPOpt/lib/libccRASModel.so: undefined symbol: _ZN4Foam14incompressible8RASModel11printCoeffsEv
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libccRASModel.so"
Processor 1: field transfer
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : /home/paalj/OpenFOAM/paalj-2.1.0/platforms/linuxGccDPOpt/lib/libccRASModel.so: undefined symbol: _ZN4Foam14incompressible8RASModel11printCoeffsEv
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libccRASModel.so"
Processor 2: field transfer
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : /home/paalj/OpenFOAM/paalj-2.1.0/platforms/linuxGccDPOpt/lib/libccRASModel.so: undefined symbol: _ZN4Foam14incompressible8RASModel11printCoeffsEv
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load "libccRASModel.so"

End.
__________________________________________________ __________________________________



In Make/files directory I included:
_____________________________________
cckOmegaSST.C

LIB = $(FOAM_USER_LIBBIN)/libccRASModel
_____________________________________

and in system/controlDict

libs ("libccRASModel.so");



Any ideas?
paalj is offline   Reply With Quote

Old   May 23, 2013, 04:32
Default
  #4
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 112
Rep Power: 8
be_inspired is on a distinguished road
Hi,

I have the same problem. I have modified the standard k-epsilon model with extra terms in the k and epsilon equations.
It compiles with no error and the simulations runs, converges and the results seems correct. I can run in serial or in parallel but I always receive the same warning as you.

Could you detect where was the problem?
be_inspired is offline   Reply With Quote

Reply

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
groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM 23 July 10, 2015 09:44
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
error message cuteapathy CFX 14 March 20, 2012 07:45
Large source term in species equation MACFD FLUENT 4 January 4, 2011 15:16
Reaction Source Term in Steady Species transport equation cfdvenkatesh Main CFD Forum 0 August 19, 2010 09:28


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