Adding side force to forceCoeffs.C
I have edited forceCoeffs.C to include side forces by basically copying the dragDig, dragForce etc entries and adding an additional line with sfDir and sideForce. When I have recompiled forceCoeffs and added a sfDir option to my controlDict it gives no output for lift, drag nor side force.
An example of how I have edited the forceCoeffs.C: Code:
scalar liftForce = totForce & liftDir_; Any help is appreciated, Daniel. |
I made a typo in the .C file which I have corrected and now it works. Sorry about that.
For anyone interested, the new forceCoeffs.C is below and all you have to do is add a sfDir specification in the functions subdict of the controlDict file. Code:
/*---------------------------------------------------------------------------*\ |
Hi all,
I'm interested by the new forceCoeffs.C file. I try to test it but it don't works. I updated the forceCoeffs.C, then I added sfDir line in the forceCoeffs file. Finally, I recompile OpenFOAM. What is wrong with the method? Thanks for your explanation ;) |
No suggestion ?
|
1 Attachment(s)
Hi Rider,
Attached is the adapted code based on drrbradford's modifications. The main difference is only how the modifications were made:
Code:
wmake libso
Best regards, Bruno |
Thank you for this work and your time.
When I used "wmake" or "sudo bash ./Allmake" in the directory "functionObjects", I had this error message "wmake : command not found" What is the problem ? Thanks all. |
Hi Rider,
Unpack the package in a user folder of yours, not in OpenFOAM's source code folder! And use: Code:
wmake libso To get a better understanding of what I'm talking/writing about, perhaps you should study a bit this tutorial: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam Best regards, Bruno |
Hi Bruno,
I had misunderstood the structure of the modification ... It works. I will test it now ;) Thanks a lot ! |
Error in compiling utility
Quote:
First off all thanks for the utility, But i am not able to build it properly on my system i am following quoted steps you have provided but its giving me some error. given below. Code:
wmakeLnInclude: linking include files to ./lnInclude Code:
Making dependency list for source file forceDirCoeffs/forceDirCoeffs.C Thank you Regards Himanshu Sharma:confused: |
Hi himanshu28
I Know this error, in the terminal you go to this folder and type follow me: Quote:
and now you type: Quote:
Thien |
Thanks
Quote:
Regards Himanshu :) |
Hi Bruno,
I try to add the modification to the OF V222, but i don't succeed. I always have this error : "unknown function type force DirCoeffs". When I add the modification like the previous OF version, I don't have error message, but the modification seems to not be affect. Thank you in advance ! |
Hi Rider,
I won't have much time to look deeper into this before the weekend. But one question: did you also try in OpenFOAM 2.2.1? Either way, OpenFOAM 2.2 has been evolving on the function objects topic quite a bit, adding new features to them for 2.2.1, 2.2.2 and 2.2.x, so things have continued to change. So it really depends on what was the starting point you've used to make the code modifications. Best regards, Bruno |
Hi Bruno,
Thanks for your quick reply. Yes, I have tried with the OF V221. The problem is the same. I used your methode with the forceDirCoeff file. Best regards. |
Hi Rider,
OK, things did change considerably in OpenFOAM 2.2. It has got binning and all! This time I've gone through the somewhat correct steps in sharing modified code, which is provided here: https://github.com/wyldckat/forceDirCoeffs The instructions are provided there and make sure you replace all references to "21x" to "22x", when following the installation steps. Let me know if you have any problems following the steps or any problems using the modified library. Best regards, Bruno |
Good day Bruno,
I have followed your most recent directions in the github site. I am running simpleFoam and it seems that the program is not picking up my forceDirCoeffs directory I have compiled. In my controlDict file I have placed #include "forceDirCoeffs" into the functions. Below is found in my simpleFoam.log file. I think there must be a problem with the functionObject.C file in the OpenFOAM222 directory but do not know how to resolve it. Any help here would be much appreciated. Thanks, Geoff [6] --> FOAM FATAL ERROR: |
Greetings Geoff,
Quote:
The idea is that you should add the following line to the "controlDict" file: Code:
libs (libforceDirCoeffs.so); If you have this: Code:
libs ( Code:
libs ( Bruno |
Thanks again for the help. I am running OpenFOAM 2.2.2. I did have to do one additional thing to the files I cloned from your github. Before the wmake command, I had to add lforces to the Make/options file, as seen below.
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/postProcessing/functionObjects/forces/lnInclude LIB_LIBS = \ -lincompressibleTransportModels \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfluidThermophysicalModels \ -lspecie \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ -lmeshTools \ -lforces \ -lfileFormats Works great now, I actually added a few terms, to give coefficients in all three directions in global coordinates as well as all three directions of local coordinates to the body being analysed. |
Hi Geoff,
I've updated the repository, regarding the README file and the linking to "libforces" as you indicated. Do feel free to clone the repository and publish your modifications to it! Best regards, Bruno |
Let me finish my masters project first, then I will be more than happy to tidy up and post the updates. Just three more weeks!
|
All times are GMT -4. The time now is 02:22. |