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

Custom wall function problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2015, 09:12
Default Custom wall function problem
  #1
New Member
 
Kairzhan
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, 12:15
Default
  #2
New Member
 
Patrick Grover
Join Date: May 2015
Posts: 1
Rep Power: 0
Patrick Grover is on a distinguished road
Hi

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:

<code>
libs
(
"libmyIncompressibleRASModels.so"
);
</code>

Cheers,
Patrick
Patrick Grover is offline   Reply With Quote

Old   June 2, 2015, 06:45
Default Solved
  #3
New Member
 
Kairzhan
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:
Code:
tmp<volSymmTensorField> kEpsilon::R() const
{
    return tmp<volSymmTensorField>
    (
        new volSymmTensorField
        (
            IOobject
            (
                "R",
                runTime_.timeName(),
                mesh_,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
            k_.boundaryField().types()
        )
    );
}
It seems that k_.boundaryField().types() somehow affects the visibility of custom WF.
kairzhan is offline   Reply With Quote

Reply

Tags
openfoam, turbulence, wall functions


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 18:22
[mesh manipulation] mergeMeshes problem Attesz OpenFOAM Meshing & Mesh Conversion 3 July 29, 2015 05:15
Problem creating a new Wallfunction on OF 2.2 ! fredo490 OpenFOAM Programming & Development 8 July 22, 2014 06:16
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
Wall function in adverse pressure gradients stephane baralon Main CFD Forum 11 September 2, 1999 05:05


All times are GMT -4. The time now is 14:50.