CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Question about finding force in OF 1.7.1 using interFoam (https://www.cfd-online.com/Forums/openfoam/81549-question-about-finding-force-1-7-1-using-interfoam.html)

Angela Wang October 29, 2010 17:00

Question about finding force in OF 1.7.1 using interFoam
 
I added the following to the controlDict file.
functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so");
outputControl timeStep;
outputInterval 1;
patches (hydrofoil);
pName p_rgh;
UName U;
log true;
rhoName rhoInf;
rhoInf 1000;
CofR (0.249048674523 -1.034 0);

forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
outputControl timeStep;
outputInterval 1;
patches (hydrofoil);
pName p_rgh;
UName U;
log true;
rhoName rhoInf;
rhoInf 1000;
CofR (0.249048674523 -1.034 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0.249048674523 -1.034 0);
magUInf 1.77653;
lRef 1;
Aref 1;
}
);

Angela Wang October 29, 2010 17:02

And the code responded as:
--> FOAM FATAL IO ERROR:
keyword nu is undefined in dictionary "/handel3/lwangk/OpenFOAM/lwangk-1.7.1/run/selfcase/naca0012_oct28_nodamping/constant/transportProperties"

file: /handel3/lwangk/OpenFOAM/lwangk-1.7.1/run/selfcase/naca0012_oct28_nodamping/constant/transportProperties from line 20 to line 62.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 395.

FOAM exiting


I googled for the solution and recompiled the libforces.so according to

http://www.cfd-online.com/Forums/ope...es-of15-8.html

#111

I copied /OpenFOAM/OpenFOAM-1.7.1/src/postProcessing/functionObjects/forces to a
"forcesInter" folder under
/OpenFOAM/OpenFOAM-1.7.1/src/postProcessing/functionObjects/.
And I modified
everything (filename and contents in all files) from "forces" to
"forcesInter" and modified in the file "forcesInter.C"

line 106 to nu(transportProperties.lookupEntry("phase1",false, false).dict().lookup("nu"));
//modified for finding the main nu

But the compilation failed. Any one can help??

Angela Wang October 29, 2010 17:05

My error is :
Make/linux64GccDPOpt/forces.o: In function `Foam::tmp < Foam::GeometricField < Foam::SymmTensor < double >, Foam::fvPatchField, Foam::volMesh > > Foam::dev < Foam::fvPatchField, Foam::volMesh >(Foam::tmp < Foam::GeometricField < Foam::SymmTensor<double >, Foam::fvPatchField, Foam::volMesh > > const&)':
forces.C:(.text._ZN4Foam3devINS_12fvPatchFieldENS_ 7volMeshEEENS_3tmpINS_14GeometricFieldINS_10SymmTe nsorIdEET_T0_EEEERKSA_[Foam::tmp < Foam::GeometricField < Foam::SymmTensor<double >, Foam::fvPatchField, Foam::volMesh > > Foam::dev < Foam::fvPatchField, Foam::volMesh >(Foam::tmp < Foam::GeometricField < Foam::SymmTensor < double >, Foam::fvPatchField, Foam::volMesh > > const&)]+0x45a): undefined reference to `Foam::calculatedFvPatchField < Foam::SymmTensor < double > >::typeName'
Make/linux64GccDPOpt/forcesInter.o: In function `Foam::forcesInter::rho() const':
forcesInter.C: (.text+0xedd): undefined reference to `typeinfo for Foam::fvMesh'
forcesInter.C: (.text+0x101c): undefined reference to `Foam::calculatedFvPatchField<double>::typeName'
forcesInter.C: (.text+0x11c5): undefined reference to `Foam::fvMesh::typeName'
Make/linux64GccDPOpt/forcesInter.o: In function `Foam::forcesInter::devRhoReff() const':
forcesInter.C:(.text+0x1374): undefined reference to `typeinfo for Foam::compressible::RASModel'
forcesInter.C: (.text+0x14bc): undefined reference to `typeinfo for Foam::incompressible::RASModel'
forcesInter.C: (.text+0x1678): undefined reference to `typeinfo for Foam::compressible::LESModel'
forcesInter.C: (.text+0x17ac): undefined reference to `typeinfo for Foam::incompressible::LESModel'
forcesInter.C:(.text+0x191c): undefined reference to `typeinfo for Foam::basicThermo'
forcesInter.C: (.text+0x1afc): undefined reference to `typeinfo for Foam::singlePhaseTransportModel'
Make/linux64GccDPOpt/forcesInter.o: In function `Foam::forcesInter::calcForcesMoment() const':
forcesInter.C: (.text+0x2285): undefined reference to `Foam::fvMesh::Sf() const'
forcesInter.C: (.text+0x23ee): undefined reference to `Foam::fvMesh::C() const'
forcesInter.C: (.text+0x2c5f): undefined reference to `Foam::fvMesh::Sf() const'
forcesInter.C:(.text+0x2e26): undefined reference to `Foam::fvMesh::C() const'
Make/linux64GccDPOpt/forcesInter.o: In function `Foam::forcesInter::read(Foam::dictionary const&)':
forcesInter.C: (.text+0x453c): undefined reference to `typeinfo for Foam::fvMesh'
forcesInter.C: (.text+0x4fe1): undefined reference to `Foam::fvMesh::typeName'
Make/linux64GccDPOpt/forcesInter.o: In function `Foam::forcesInter::forcesInter(Foam::word const&, Foam::objectRegistry const&, Foam::dictionary const&, bool)':
forcesInter.C: (.text+0x51f1): undefined reference to `typeinfo for Foam::fvMesh'
Make/linux64GccDPOpt/forcesInter.o: In function `Foam::forcesInter::forcesInter(Foam::word const&, Foam::objectRegistry const&, Foam::dictionary const&, bool)':
forcesInter.C: (.text+0x5481): undefined reference to `typeinfo for Foam::fvMesh'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

sleepdeprivation October 30, 2010 07:28

Yea I'm having the same problem. It seems forces library doesn't have a way to compensate for multiple fluids. I haven't, however, look deep enough into the functions to know if the RAS and LES formulations take into account multiple fluids.

colinB November 2, 2010 02:49

Hi
I have the same version of OF like you (171) and I get everything running
in interFoam with the ras turbulence model.
Actually the message stated quite clear that you however did not specify
nu in the transportProperties file.

so for example in one of my files after the header there are the following
lines:
Code:


transportModel      Newtonian;
nu                      nu [0 2 -1 0 0 0 0]  1e-06;

and now the same for each phase with some other specifications.
I guess this you checked already, as it was a hint from the error message.

Anyway, I compared my forces attachment in the controlDict File and could
indeed identify some differences. So here my attachment so you can
check:

Code:

functions
(
            forces
            {
                  type forces;
                  functionObjectLibs ("libforces.so");
                  outputControl        timestep;
                  outputInterval 1;
                  patches (here_could_be_your_patch);
                  rhoInf  1000;
                  nuInf 1e-06;
                  CofR (0 0 0);
            }
            forceCoeffs
            {
                  type forceCoeffs;
                  functionObjectLibs ("libforces.so");
                  outputControl timestep;
                  outputInterval 1;
                  patches (here_could_be_your_patch);
                  rhoInf 1000;
                  nuInf 1e-06;
                  CofR (0 0 0);
                  liftDir (0 0 1);
                  dragDir (-1 0 0);
                  pitchAxis (0 1 0);
                  magUInf -8.0;
                  lRef 1;
                  Aref 1;
              }
);

I hope that helps
regards
Colin


All times are GMT -4. The time now is 13:38.