CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Custom wall function problem

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

LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2015, 08:12
Default Custom wall function problem
New Member
Join Date: Jan 2011
Posts: 2
Rep Power: 0
kairzhan is on a distinguished road
Hi Foamers !

I'm trying to implement my turbulence model, and stuck with wall-function for k. I need to specify a value for k on the boundary which is calculated from other variables. So to do this I copied the standard wall-funcion definition from epsilon (epsilonWallFunction) which does the needed functionality but for different variable (epsilon). So I renamed class and all it's methods from epsilon to k. Everything compiled normally. But when I tried to specify new wall-funcions for k I got runtime error message:

Unknown pathField type kBuoyantWallFunction for patch type wall...

And my wall function is not listed in valid patch field types.

However, if I try to specify this same wall-function name ( kBuoyantWallFunction) for epsilon it finds it, as valid wall-function but for wrong variable.

So it seems that my wall function is registered in the wrong selection table..

How can I specify where the wall function should be registered ?

The code is in attachments.
Attached Files
File Type: h kBuoyantWallFunctionFvPatchScalarField.H (8.1 KB, 7 views)
File Type: c kBuoyantWallFunctionFvPatchScalarField.C (15.0 KB, 8 views)
kairzhan is offline   Reply With Quote

Old   June 1, 2015, 11:15
New Member
Patrick Grover
Join Date: May 2015
Posts: 1
Rep Power: 0
Patrick Grover is on a distinguished road

I am also working on custom wall functions for OpenFoam.

I your controlDict file do you link to your custom library? This is what I have added at the bottom of my controlDict file:


Patrick Grover is offline   Reply With Quote

Old   June 2, 2015, 05:45
Default Solved
New Member
Join Date: Jan 2011
Posts: 2
Rep Power: 0
kairzhan is on a distinguished road
Hi Patrick,

Thank you for the reply, but I've finally managed applying custom WF. The problem was in that I didn't commented k_.boundaryField().types() from the kEpsilon.C file:
tmp<volSymmTensorField> kEpsilon::R() const
    return tmp<volSymmTensorField>
        new volSymmTensorField
            ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
It seems that k_.boundaryField().types() somehow affects the visibility of custom WF.
kairzhan is offline   Reply With Quote


openfoam, turbulence, wall functions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
[mesh manipulation] mergeMeshes problem Attesz OpenFOAM Meshing & Mesh Conversion 3 July 29, 2015 04:15
Problem creating a new Wallfunction on OF 2.2 ! fredo490 OpenFOAM Programming & Development 8 July 22, 2014 05:16
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
Wall function in adverse pressure gradients stephane baralon Main CFD Forum 11 September 2, 1999 04:05

All times are GMT -4. The time now is 00:05.