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

nonNewtonian viscosity model

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2010, 16:59
Default nonNewtonian viscosity model
  #1
New Member
 
Muhammad reza hassani
Join Date: Apr 2010
Posts: 29
Rep Power: 15
mhassani is on a distinguished road
Hi, I want to use a non-Newtonian viscosity model other than those predefined in the source directory; the modification can be done by changing the formulation in CrossPowerLaw.C.
The question here is: Do I need to compile the file after modification?
Do I have to copy it somewhere else (e.g. user directory) make the changes, create a "Make" folder compile it using wmake or something else can be done more straight forward?
mhassani is offline   Reply With Quote

Old   July 15, 2010, 17:23
Default
  #2
New Member
 
Muhammad reza hassani
Join Date: Apr 2010
Posts: 29
Rep Power: 15
mhassani is on a distinguished road
after making the changes, I create a make file in user directory trying to compile it several errors occurred; any idea what the problem can be? the error is:
Making dependency list for source file GenPowerLaw.C
could not open file volFieldsFwd.H for source file GenPowerLaw.C
could not open file surfaceFieldsFwd.H for source file GenPowerLaw.C
could not open file volFields.H for source file GenPowerLaw.C
could not open file surfaceFields.H for source file GenPowerLaw.C
SOURCE=GenPowerLaw.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam170/src/transportModels/incompressible/lnInclude -IlnInclude -I. -I/opt/openfoam170/src/OpenFOAM/lnInclude -I/opt/openfoam170/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/GenPowerLaw.o
In file included from GenPowerLaw.H:38,
from GenPowerLaw.C:26:
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:48:26: error: volFieldsFwd.H: No such file or directory
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:49:30: error: surfaceFieldsFwd.H: No such file or directory
In file included from GenPowerLaw.C:26:
GenPowerLaw.H:40:23: error: volFields.H: No such file or directory
GenPowerLaw.C:28:27: error: surfaceFields.H: No such file or directory
In file included from GenPowerLaw.H:38,
from GenPowerLaw.C:26:
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:73: error: ISO C++ forbids declaration of ‘volVectorField’ with no type
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:73: error: expected ‘;’ before ‘&’ token
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:74: error: ISO C++ forbids declaration of ‘surfaceScalarField’ with no type
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:74: error: expected ‘;’ before ‘&’ token
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:94: error: ISO C++ forbids declaration of ‘volVectorField’ with no type
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:94: error: expected ‘,’ or ‘...’ before ‘&’ token
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:94: error: ISO C++ forbids declaration of ‘volVectorField’ with no type
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:94: error: expected ‘,’ or ‘...’ before ‘&’ token
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:116: error: ISO C++ forbids declaration of ‘volVectorField’ with no type
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:116: error: expected ‘,’ or ‘...’ before ‘&’ token
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:128: error: ISO C++ forbids declaration of ‘volVectorField’ with no type
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:128: error: expected ‘,’ or ‘...’ before ‘&’ token
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:148: error: ‘volScalarField’ was not declared in this scope
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:148: error: template argument 1 is invalid
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:151: error: ‘volScalarField’ was not declared in this scope
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:151: error: template argument 1 is invalid
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H: In static member function ‘static Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::adddictionaryConstructorToTa ble<viscosityModelType>::New(const Foam::word&, const Foam::dictionary&, int)’:
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:94: error: ‘U’ was not declared in this scope
/opt/openfoam170/src/transportModels/incompressible/lnInclude/viscosityModel.H:94: error: ‘phi’ was not declared in this scope
In file included from GenPowerLaw.C:26:
GenPowerLaw.H: At global scope:
GenPowerLaw.H:70: error: ‘volScalarField’ does not name a type
GenPowerLaw.H:75: error: ‘volScalarField’ was not declared in this scope
GenPowerLaw.H:75: error: template argument 1 is invalid
GenPowerLaw.H:91: error: ISO C++ forbids declaration of ‘volVectorField’ with no type
GenPowerLaw.H:91: error: expected ‘,’ or ‘...’ before ‘&’ token
GenPowerLaw.H:105: error: ‘volScalarField’ was not declared in this scope
GenPowerLaw.H:105: error: template argument 1 is invalid
GenPowerLaw.H: In member function ‘virtual int Foam::viscosityModels::GenPowerLaw::nu() const’:
GenPowerLaw.H:107: error: ‘nu_’ was not declared in this scope
GenPowerLaw.H: In member function ‘virtual void Foam::viscosityModels::GenPowerLaw::correct()’:
GenPowerLaw.H:113: error: ‘nu_’ was not declared in this scope
GenPowerLaw.C: At global scope:
GenPowerLaw.C:50: error: ‘volScalarField’ is not a member of ‘Foam’
GenPowerLaw.C:50: error: ‘volScalarField’ is not a member of ‘Foam’
GenPowerLaw.C:50: error: template argument 1 is invalid
GenPowerLaw.C: In member function ‘int Foam::viscosityModels::GenPowerLaw::calcNu() const’:
GenPowerLaw.C:53: error: argument of type ‘int (Foam::viscosityModel:()const’ does not match ‘int’
GenPowerLaw.C:53: error: ‘nuInf’ was not declared in this scope
GenPowerLaw.C:53: error: ‘deltaNu’ was not declared in this scope
GenPowerLaw.C: At global scope:
GenPowerLaw.C:63: error: ISO C++ forbids declaration of ‘volVectorField’ with no type
GenPowerLaw.C:63: error: expected ‘,’ or ‘...’ before ‘&’ token
GenPowerLaw.C: In constructor ‘Foam::viscosityModels::GenPowerLaw::GenPowerLaw(c onst Foam::word&, const Foam::dictionary&, int)’:
GenPowerLaw.C:67: error: ‘U’ was not declared in this scope
GenPowerLaw.C:67: error: ‘phi’ was not declared in this scope
GenPowerLaw.C:77: error: class ‘Foam::viscosityModels::GenPowerLaw’ does not have any field named ‘nu_’
GenPowerLaw.C:82: error: ‘U_’ was not declared in this scope
make: *** [Make/linuxGccDPOpt/GenPowerLaw.o] Error 1
mhassani is offline   Reply With Quote

Old   July 15, 2010, 17:27
Default
  #3
New Member
 
Muhammad reza hassani
Join Date: Apr 2010
Posts: 29
Rep Power: 15
mhassani is on a distinguished road
the files in Make directory contains:
GenPowerLaw.C

EXE = $(FOAM_LIBBIN)/libViscosityMod
and in options:
EXE_INC = \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude

EXE_LIBS = \
-ltransportModel
the problems are still unsolved!
mhassani is offline   Reply With Quote

Old   July 16, 2010, 07:25
Default
  #4
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Muhammad,

the "options" file must have the line
-I$(LIB_SRC)/finiteVolume/lnInclude \
as well.

My recommendation is: create your own viscosity model in the OpenFOAM's source directory... just make your new "GenPowerLaw" folder next to OpenFOAM's "powerLaw" folder. Edit "/opt/openfoam170/src/transportModels/incompressible/Make/files" by adding the line:
"viscosityModels/GenPowerLaw/GenPowerLaw.C"

Navigate in your shell to
"/opt/openfoam170/src/transportModels/incompressible/"
and call "wclean"
Then navigate to
"/opt/openfoam170/src/transportModels/"
and call "./Allwmake"

Hope it helps

Martin
MartinB is offline   Reply With Quote

Old   January 7, 2013, 09:10
Default
  #5
New Member
 
Ehsan
Join Date: Mar 2011
Posts: 4
Rep Power: 15
Ehsan Khalili is on a distinguished road
Dear Martin, I want to create a folder in the viscosity model directory but it fails, I cannot create a folder? may you help me?
Ehsan Khalili is offline   Reply With Quote

Old   January 7, 2013, 09:27
Default
  #6
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Ehsan,

you need write access to the directory where you want to create the new viscosity model. It is better to use your user directory instead of the OpenFOAM's source directory.

In this post you can find an example how to do it:
http://www.cfd-online.com/Forums/ope...tml#post375899

Martin
MartinB is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Implementing new viscosity model prjohnston OpenFOAM Running, Solving & CFD 6 July 3, 2015 04:26
Yielding viscosity for Herschel Bulkley model Godwin FLUENT 1 December 12, 2011 05:42
Power Law Viscosity Model cpplabs OpenFOAM Running, Solving & CFD 1 February 13, 2008 08:09
Casson Viscosity model as one user define function Zahra Rahmdel FLUENT 0 November 6, 2004 05:53


All times are GMT -4. The time now is 02:11.