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

absolute value of strain rate

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 4, 2010, 15:00
Default absolute value of strain rate
  #1
New Member
 
Muhammad reza hassani
Join Date: Apr 2010
Posts: 29
Rep Power: 7
mhassani is on a distinguished road
hi
I am creating a user defined viscosity model in OF1.7; The problem is that I have to use absolute value of the strainRate as an argument for the "sqrt" command. when I use abs for this purpose, an error occurs:

Making dependency list for source file viscosityModels/ExtendedCasson/ExtendedCasson.C
SOURCE=viscosityModels/ExtendedCasson/ExtendedCasson.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I.. -I/opt/openfoam170/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam170/src/OpenFOAM/lnInclude -I/opt/openfoam170/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/ExtendedCasson.o
viscosityModels/ExtendedCasson/ExtendedCasson.C: In member function ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::viscosityModels::ExtendedCasson::calcNu() const’:
viscosityModels/ExtendedCasson/ExtendedCasson.C:54: error: no matching function for call to ‘abs(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >)’
/usr/include/stdlib.h:766: note: candidates are: int abs(int)
/usr/include/c++/4.4/cmath:102: note: long double std::abs(long double)
/usr/include/c++/4.4/cmath:98: note: float std::abs(float)
/usr/include/c++/4.4/cmath:94: note: double std::abs(double)
/usr/include/c++/4.4/cstdlib:170: note: long long int __gnu_cxx::abs(long long int)
/usr/include/c++/4.4/cstdlib:139: note: long int std::abs(long int)
viscosityModels/ExtendedCasson/ExtendedCasson.C:54: error: no matching function for call to ‘abs(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >)’
/usr/include/stdlib.h:766: note: candidates are: int abs(int)
/usr/include/c++/4.4/cmath:102: note: long double std::abs(long double)
/usr/include/c++/4.4/cmath:98: note: float std::abs(float)
/usr/include/c++/4.4/cmath:94: note: double std::abs(double)
/usr/include/c++/4.4/cstdlib:170: note: long long int __gnu_cxx::abs(long long int)
/usr/include/c++/4.4/cstdlib:139: note: long int std::abs(long int)
make: *** [Make/linuxGccDPOpt/ExtendedCasson.o] Error 1
******
shall I include any library in the .C file of my viscosity model?
mhassani is offline   Reply With Quote

Old   August 4, 2010, 15:09
Default
  #2
New Member
 
Muhammad reza hassani
Join Date: Apr 2010
Posts: 29
Rep Power: 7
mhassani is on a distinguished road
it seems that there is mag() in OF instead of abs(). problem solved
thanks
mhassani is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
strain rate in UDF Paulina FLUENT 11 November 20, 2014 04:06
strain rate magnitude ahmadbakri STAR-CCM+ 1 June 3, 2010 13:03
About "Shear strain rate" leo1985 CFX 0 April 26, 2008 04:48
Strain rate. MM? Main CFD Forum 1 February 15, 2006 09:55
strain rate at arbitrary position in a cell K. Kevala FLUENT 0 February 4, 2004 18:14


All times are GMT -4. The time now is 01:08.