CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding side force to forceCoeffs.C (https://www.cfd-online.com/Forums/openfoam-programming-development/92884-adding-side-force-forcecoeffs-c.html)

ashisha August 26, 2015 10:27

Error while adding side force Coef.
 
Quote:

Originally Posted by wyldckat (Post 390138)
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 :D


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.

sukratu August 26, 2015 11:13

Error persists
 
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 (Post 454429)
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


hk318i August 26, 2015 11:44

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

sukratu August 26, 2015 11:58

I will check if that README file has been followed. I do not think it has been.

Swapnilmali1988 October 15, 2017 15:50

side forces in of versions 4.1, 5.1.
 
1 Attachment(s)
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.

Swapnilmali1988 October 17, 2017 03:12

compiled side force directory for OF5
 
1 Attachment(s)
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. Attachment 59004


All times are GMT -4. The time now is 20:41.