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

Adding side force to forceCoeffs.C

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2015, 10:27
Default Error while adding side force Coef.
  #21
New Member
 
ASHISH
Join Date: Mar 2015
Posts: 3
Rep Power: 11
ashisha is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Rider,

Attached is the adapted code based on drrbradford's modifications. The main difference is only how the modifications were made:
  1. I first made a copy of the library "$FOAM_SRC/postProcessing/functionObjects/forces" onto my personal user folder:
    Code:
    cd $FOAM_RUN
    cd ..
    cp -r $FOAM_SRC/postProcessing/functionObjects/forces forceDirCoeffs
  2. Removed the excess folders in this new folder "forceDirCoeffs" and renamed "forceCoeffs" folder inside it, leaving this way only two folders:
    Code:
    forceDirCoeffs
    Make
  3. Edited "Make/files" and this is what's inside it now:
    Code:
    forceDirCoeffs/forceDirCoeffs.C
    forceDirCoeffs/forceDirCoeffsFunctionObject.C
    
    LIB = $(FOAM_USER_LIBBIN)/libforceDirCoeffs
  4. Edited "Make/options" and made it depend/include the original function object library, since there are things we need from it (I think...):
    Code:
    EXE_INC = \
        -I$(LIB_SRC)/finiteVolume/lnInclude \
        -I$(LIB_SRC)/meshTools/lnInclude \
        -I$(LIB_SRC)/sampling/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 \
        -lbasicThermophysicalModels \
        -lspecie \
        -lcompressibleRASModels \
        -lcompressibleLESModels \
        -lfiniteVolume \
        -lmeshTools \
        -lsampling \
        -lforces
  5. Renamed all files inside the sub-folder "forceDirCoeffs", adding "Dir" after "force".
  6. Edited all of the renamed files and did the same search and replace of "forceCoeffs" to "forceDirCoeffs".
  7. Finally added the modifications described in the first two posts.
To build it:
Code:
wmake libso
To use it:
  1. Instead of referring to the library "libforces.so", you now refer to "libforceDirCoeffs.so".
  2. Instead of "forceCoeffs" in the case's "controlDict" file, you now use "forceDirCoeffs". Keep in mind that you now also have a vector entry named "sfDir".
I haven't tested this, so I can only assume that it works


Best regards,
Bruno


Hi

With ref to your post regarding error in side force Coef I am sending this mail.

Following is the error that occur after wmake libso

************************************************** **********

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file forceDirCoeffs/forceDirCoeffs.C
could not open file writer.H for source file forceDirCoeffs/forceDirCoeffs.C due to No such file or directory
Making dependency list for source file forceDirCoeffs/forceDirCoeffsFunctionObject.C
could not open file writer.H for source file forceDirCoeffs/forceDirCoeffsFunctionObject.C due to No such file or directory
SOURCE=forceDirCoeffs/forceDirCoeffs.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/finiteVolume/lnInclude -I/opt/openfoam230/src/meshTools/lnInclude -I/opt/openfoam230/src/sampling/lnInclude -I/opt/openfoam230/src/transportModels -I/opt/openfoam230/src/turbulenceModels -I/opt/openfoam230/src/turbulenceModels/LES/LESdeltas/lnInclude -I/opt/openfoam230/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam230/src/postProcessing/functionObjects/forces/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/forceDirCoeffs.o
In file included from forceDirCoeffs/forceDirCoeffs.H:96:0,
from forceDirCoeffs/forceDirCoeffs.C:26:
/opt/openfoam230/src/postProcessing/functionObjects/forces/lnInclude/forces.H:125:20: fatal error: writer.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/forceDirCoeffs.o] Error 1

************************************************** ***************
we have also tried wclean and removed all dep files still same error occurs.
Our version No is 2.3.0

Kindly help for the same.
ashisha is offline   Reply With Quote

Old   August 26, 2015, 11:13
Unhappy Error persists
  #22
New Member
 
Sukratu Barve
Join Date: Mar 2009
Posts: 16
Rep Power: 17
sukratu is on a distinguished road
We get the same error. Unfortunately,, it persists even after doing wclean and
after removing all the .dep files (our wclean does not seem to remove those; only
a directory ends up getting removed)

Sincerely,
S



Quote:
Originally Posted by luuhoangthien View Post
Hi himanshu28

I Know this error, in the terminal you go to this folder and type follow me:

it will delete deb file
and now you type:

don't miss libso :P

Thien
sukratu is offline   Reply With Quote

Old   August 26, 2015, 11:44
Default
  #23
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17
hk318i is on a distinguished road
I just tried to compile it using OpenFOAM-2.2.x and OpenFOAM-2.3.x and it works without any error.
Here are the steps based on the README file which I followed:

Code:
git clone git://github.com/wyldckat/forceDirCoeffs.git
cd forceDirCoeffs
git checkout of22x
wmake libso forceDirCoeffs
It appears that you are compiling OpenFOAM-2.1 version
hk318i is offline   Reply With Quote

Old   August 26, 2015, 11:58
Default
  #24
New Member
 
Sukratu Barve
Join Date: Mar 2009
Posts: 16
Rep Power: 17
sukratu is on a distinguished road
I will check if that README file has been followed. I do not think it has been.
sukratu is offline   Reply With Quote

Old   October 15, 2017, 15:50
Default side forces in of versions 4.1, 5.1.
  #25
New Member
 
Swapnil Mali
Join Date: Aug 2016
Posts: 2
Rep Power: 0
Swapnilmali1988 is on a distinguished road
Hi people,

I am trying to add side forces patch on Openfoam versions 3.1, 4.1 and 5.1, however following the earlier steps to verbatim have not solved my problem.
any suggestions?

I am attaching a image for reference.

regards,
Swapnil.
Attached Images
File Type: jpg sideforces_error.jpg (189.4 KB, 19 views)
Swapnilmali1988 is offline   Reply With Quote

Old   October 17, 2017, 03:12
Default compiled side force directory for OF5
  #26
New Member
 
Swapnil Mali
Join Date: Aug 2016
Posts: 2
Rep Power: 0
Swapnilmali1988 is on a distinguished road
I have compiled force dir files for version 5 of openfoam, however these have given me some errors while compling using wmake. I am guessing it is more of a white space or tab issue. I tried fixing it, but no luck. If anybody here can take a loog at these files and let me know the issues. that would be a great help.
regards,
Swapnil Mali
Savitribai Phule Pune University. forceDirCoeffs(of5.1).tar.gz

Last edited by Swapnilmali1988; October 18, 2017 at 12:12.
Swapnilmali1988 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
Force can not converge colopolo CFX 13 October 4, 2011 22:03
How to measure side force and yawing moment firda FLUENT 0 November 3, 2010 02:33
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
CFX Solver Memory Error mike CFX 1 March 19, 2008 07:22
[Commercial meshers] Converting meshes that includes interfaces ham OpenFOAM Meshing & Mesh Conversion 29 January 8, 2007 08:58


All times are GMT -4. The time now is 04:18.