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

Source in k-equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2012, 04:07
Default Source in k-equation
  #1
New Member
 
Join Date: Feb 2012
Posts: 4
Rep Power: 14
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: 15
Andreas.Herwig is on a distinguished road
please have a look here

http://www.cfd-online.com/Forums/ope...t-2-1-1-a.html

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: 14
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: 153
Rep Power: 17
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

Old   October 7, 2015, 22:56
Default
  #5
Member
 
Lianhua Zhu
Join Date: Aug 2011
Location: Wuhan, China
Posts: 35
Rep Power: 14
zhulianhua is on a distinguished road
Hi, I faced the same problem on OF 2.4.0.

I developed a new dsmcFoam wall interaction submodel ($FOAM_SRC/lagrangian/dsmc/submodels/WallInterationModel).
Then I compiled it to a new self-defined lib called 'libVarDsmc.so"
The serial dsmcFoam run works. But if I use decomposePar, each process issues a Warning like:

Code:
 From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/lhzhu/OpenFOAM/lhzhu-2.4.0/platforms/linux64IccDPOpt/lib/libVarDsmc.so: undefined symbol: _ZN4Foam20WallInteractionModelINS_9DsmcCloudINS_10DsmcParcelINS_8particleEEEEEE30dictionaryConstructorTablePtr_E
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libVarDsmc.so"
Quote:
Originally Posted by be_inspired View Post
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?
zhulianhua 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
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 10:03
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
error message cuteapathy CFX 14 March 20, 2012 06:45
Large source term in species equation MACFD FLUENT 4 January 4, 2011 14: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 19:38.