|
[Sponsors] |
Problem creating a new Wallfunction on OF 2.2 ! |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 24, 2013, 05:17 |
Problem creating a new Wallfunction on OF 2.2 !
|
#1 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
Dear all,
I'm trying to implement a new wall Function into OF 2.2 but I keep having bugs at compiling. Here is what I did: 1) I copied the wall compressible turbulence model to my desktop: opt/openfoam220/src/turbulenceModels/compressible/RAS 2) I made a copy of mutkRoughWallFunction and called it MYmutkRoughWallFunction I've opened the MYmutkRoughWallFunction.C and MYmutkRoughWallFunction.H and I have replaced all "mutkRoughWallFunction" by "MYmutkRoughWallFunction" with a case matching. 3) I made a copy of alphaWallFunctions and called it MYalphaWallFunctions I've opened the MYalphaWallFunctions.C and MYalphaWallFunctions.H and I have replaced all "alphaWallFunctions" by "MYalphaWallFunctions" with a case matching. 4) I went to the Make folder and I've changed the files to Code:
/* Wall functions */ wallFunctions = derivedFvPatchFields/wallFunctions alphatWallFunctions = $(wallFunctions)/alphatWallFunctions $(alphatWallFunctions)/MYalphatWallFunction/MYalphatWallFunctionFvPatchScalarField.C mutWallFunctions = $(wallFunctions)/mutWallFunctions $(mutWallFunctions)/MYmutkRoughWallFunction/MYmutkRoughWallFunctionFvPatchScalarField.C LIB = $(FOAM_USER_LIBBIN)/MyRoughlibcompressibleRASModels See enclosed for the bug report 6) To solve my problem, I tried to include a maximum of library into the options file: Code:
EXE_INC = \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/genericPatchFields/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/derivedFvPatchFields/lnInclude \ -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/OpenFOAM/lnInclude \ LIB_LIBS = \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ -ldynamicMesh \ -lfluidThermophysicalModels \ -lspecie \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ -lmeshTools \ -lsampling \ -lfvOptions Does anybody know how to compile a new wall function on OpenFoam 2.2 ? You can find enclosed my custom RAS model. |
|
May 26, 2013, 12:31 |
|
#2 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
Small up
|
|
May 28, 2013, 08:58 |
|
#3 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
Second up
|
|
May 29, 2013, 14:53 |
Error while compiling a custom wall function (OF 2.2)
|
#4 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
Dear all,
I'm trying to implement a new wall Function into OF 2.2 but I keep having bugs at compiling. I guess I'm doing something wrong but I don't know where. PART 1 I tried to create a Custom library Here is what I did: 1) I copied the wall compressible turbulence model to my desktop: opt/openfoam220/src/turbulenceModels/compressible/RAS 2) I made a copy of mutkRoughWallFunction folder and called it MYmutkRoughWallFunction I've opened the MYmutkRoughWallFunction.C and MYmutkRoughWallFunction.H and I have replaced all "mutkRoughWallFunction" by "MYmutkRoughWallFunction" with a case matching. 3) I made a copy of alphaWallFunctions and called it MYalphaWallFunctions I've opened the MYalphaWallFunctions.C and MYalphaWallFunctions.H and I have replaced all "alphaWallFunctions" by "MYalphaWallFunctions" with a case matching. 4) I went to the Make folder and I've changed the files to Code:
/* Wall functions */ wallFunctions = derivedFvPatchFields/wallFunctions alphatWallFunctions = $(wallFunctions)/alphatWallFunctions $(alphatWallFunctions)/MYalphatWallFunction/MYalphatWallFunctionFvPatchScalarField.C mutWallFunctions = $(wallFunctions)/mutWallFunctions $(mutWallFunctions)/MYmutkRoughWallFunction/MYmutkRoughWallFunctionFvPatchScalarField.C LIB = $(FOAM_USER_LIBBIN)/MyRoughlibcompressibleRASModels I thought the problem might come from a missing library but even adding all the possible OpenFoam library to the option file doesn't solve the problem. PART 2 I tried to edit OpenFoam library Then I tried to edit the actual OpenFoam compressible library by editing the source files in opt/openfoam220/src/turbulenceModels/compressible/RAS and recompiling all OpenFoam but I still cannot use the new wall function. I did the same things as described above but this time for the libcompressibleRASModels. I didn't change any code, I have simply copied the wall function code and replaced the names by adding "MY". I wonder, is there any special "link" that is hard coded ? Also, how does the list of the possible wall function is generated when a solver settings are wrong ? Is it dynamic or hard coded ? Thx in advance, Fred |
|
May 29, 2013, 17:29 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Fred,
I've merged your latest thread into this one, since it's on the same topic. As for the problem you're having, it's as simple as running wmake like this: Code:
wmake libso Ironically, 8 days ago this was fixed in OpenFOAM 2.2.x: https://github.com/OpenFOAM/OpenFOAM...4c48941c9f1981 - so, if you had the latest OpenFOAM 2.2.x, you wouldn't have had this problem By the way, I saw that you had forgotten the "libso" option, because of this line: Code:
-lOpenFOAM -ldl -lm -o OpenFOAM.out One last thing is that OpenFOAM commands usually respond to "-help": Code:
wmake -help Bruno
__________________
|
|
May 30, 2013, 04:12 |
|
#6 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
My mistake then
I have also found another mistake. I forgot to change the wall function name in the .H file. I had a bug of "double declaration"... Now the code works. Code:
TypeName("MYmutkRoughWallFunction"); Thx again |
|
July 14, 2014, 17:10 |
compile custom wall function in v 2.3.x
|
#7 |
Member
Kevin Maki
Join Date: Mar 2009
Location: Ann Arbor, MI, USA
Posts: 43
Rep Power: 17 |
I am trying to compile a custom rough-wall function in version 2.3.x. I have tried starting with the nutkRoughWallFunction by renaming it and compiling it into its own library. when I try to include the library (in system/controlDict) it isn't loaded by the solver.
I tried a second way, by copying nutkRoughWallFunction to say nutk2RoughWallFunction, changing the file names and all occurences in the .H and .C files, and then re-compiling libturbulenceModels with the new .C file. The library compiles, but then when I try to access the new boundary condtion the solver cannot find it. Does any one have a suggestion? |
|
July 15, 2014, 09:31 |
|
#8 |
Member
Kevin Maki
Join Date: Mar 2009
Location: Ann Arbor, MI, USA
Posts: 43
Rep Power: 17 |
I thought I might add more details to entice comments from the community. If I copy $FOAM_SRC/TurbulenceModels/turbulenceModels to my work space and change only the last line in Make/files from
LIB = $(FOAM_LIBBIN)/libturbulenceModels to LIB = $(FOAM_USER_LIBBIN)/libmyTurbulenceModels I can compile the library with wmake libso. When I run a case and include the line libs( "libmyTurbulenceModels.so" ); in my system/controlDict, and the solver produces a long stream of information complaining about things such as Duplicate entry atmBoundaryLayerInletVelocity in runtime selection table fvPatchField I understand that there are duplicate entries. So, I try to modify an existing wall function by just changing its name. Such as converting nutkRough to nutk2Rough. I update the Make/files file to reflect the new wallFunction, and the library compiles. When I run simpleFoam on a case that uses the new wall function, I get an error that says: Create mesh for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting RAS turbulence model kOmegaSST --> FOAM FATAL ERROR: request for turbulenceModel turbulenceProperties from objectRegistry region0 failed available objects of type turbulenceModel are 0() From function objectRegistry::lookupObject<Type>(const word&) const in file /l/kjmaki/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 198. FOAM aborting |
|
July 22, 2014, 06:16 |
|
#9 | |
New Member
Weiwen Zhao
Join Date: Dec 2013
Posts: 19
Rep Power: 13 |
Hi, Kevin.
You should copy source code from $FOAM_SRC/turbulenceModels (lower case "t"), as the simpleFoam solver is linking to the libincompressibleTurbulenceModel.so generated by $FOAM_SRC/turbulenceModels [1]. One more thing, you should only keep the wall-function code which you want to modify, other code should be removed from your working directory otherwise it will complain duplicated entries . FYI: A new turbulence modelling framework is introduced in OpenFOAM 2.3.0 [2]. Quote:
Weiwen [1] https://github.com/OpenFOAM/OpenFOAM...m/Make/options [2] http://www.openfoam.org/version2.3.0/multiphase.php |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Problem in creating different zones in ICEM-CFD | samurai_01 | ANSYS Meshing & Geometry | 2 | November 28, 2012 13:41 |
2D axisymmetric Mesh problem in OpenFoam | Javed | OpenFOAM | 3 | September 22, 2011 03:23 |
[Commercial meshers] Handling cyclic BC from gambit to openfoam for a cascade airfoil problem - OF 1.6 | maverick | OpenFOAM Meshing & Mesh Conversion | 2 | June 18, 2011 05:36 |
Velocity profiles problem behind the elbow (3D problem) | kabat73 | FLUENT | 8 | May 9, 2010 05:26 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |