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

Temperature dependent incompressible viscosity model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2015, 12:11
Default Temperature dependent incompressible viscosity model
  #1
New Member
 
Nikolai Tauber
Join Date: Sep 2015
Location: Aarhus, Denmark
Posts: 14
Rep Power: 10
niko0807 is on a distinguished road
Dear Foamers,

I am currently working on a temperature dependent viscosity model for a modified solver based on simpleFoam and buoyantBuossinesqSimpleFoam.

I am planning on using the powerLaw viscosity as base for modification. Therefore, I have made a copy of it to:

Code:
OpenFOAM/user-2.3.x/src/transportModels/incompressible/viscosityModels/nuTemperature
I have changed the filenames to

Code:
nuTemperature.C
and

Code:
nuTemperature.H
Furthermore in Make/file I have

Code:
nuTemperature.C

LIB = $(FOAM_USER_LIBBIN)/libusernuTemperature
and in Make/options

Code:
EXE_INC = \
	-I$(LIB_SRC)/transportModels/incompressible/lnInclude/ \
	-I$(LIB_SRC)/finiteVolume/lnInclude 


LIB_LIBS = 
	-lfiniteVolume
Then I have run wmake and added

Code:
libs 			("libusernuTemperature.so");
to my test case controlDict, but when I run my solver I get the error

Code:
Build  : 2.3.x-6b18d98df2bc
Exec   : nuTemperatureSimpleFoam
Date   : Oct 14 2015
Time   : 18:05:36
Host   : "hulk2.iha.dk"
PID    : 34454
Case   : /home/dan/run/151009singleCylinder_tvsf_testCase
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Duplicate entry powerLaw in runtime selection table viscosityModel
#0	/usr/local/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x27) [0x7f076e59a207]
#1	/usr/local/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libincompressibleTransportModels.so(_ZN4Foam14viscosityModel31adddictionaryConstructorToTableINS_15viscosityModels8powerLawEEC1ERKNS_4wordE+0xce) [0x7f076e91ce1e]
#2	/home/dan/OpenFOAM/dan-2.3.x/platforms/linux64GccDPOpt/lib/libusernuTemperature.so(+0x15ee9) [0x7f0769871ee9]
#3	/home/dan/OpenFOAM/dan-2.3.x/platforms/linux64GccDPOpt/lib/libusernuTemperature.so(+0x18d66) [0x7f0769874d66]
Create mesh for time = 0

Reading thermophysical properties

Reading field T

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model nuTemperature


--> FOAM FATAL ERROR: 
Unknown viscosityModel type nuTemperature

Valid viscosityModels are : 

5
(
BirdCarreau
CrossPowerLaw
HerschelBulkley
Newtonian
powerLaw
)


    From function viscosityModel::New(const volVectorField&, const surfaceScalarField&)
    in file viscosityModels/viscosityModel/viscosityModelNew.C at line 53.

FOAM exiting

^Z
[10]+  Stopped                 nuTemperatureSimpleFoam
Can someone please see where the problem is?
niko0807 is offline   Reply With Quote

Old   October 14, 2015, 12:41
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

It is not enough just to rename file, you have to correct this piece of code:

Code:
...
public:

    //- Runtime type information
    TypeName("powerLaw");
...
in .H file (nuTemperature.H in your case). Put nuTemperature instead of powerLaw there.

UPD. And surely you have to rename class.

Last edited by alexeym; October 14, 2015 at 15:03.
alexeym is offline   Reply With Quote

Old   March 2, 2017, 09:08
Default
  #3
Member
 
Emery
Join Date: Feb 2017
Location: France.
Posts: 33
Rep Power: 9
TemC is on a distinguished road
Hi foamers,

I'am working with simpleFoam, and I have implemented a new viscosity model based on the Herschel-Bulkley model.

Through the forum I found several disussions (and documents) about the implementation of a new viscosity model in OpenFOAM.

I followed all the tips and steps that are suggested there, but I still don't manage to run a case with my new viscosity model. I always got the error message posted by "niko08/07", suggesting that my new viscosity model is not valid.

Can somebody give a step by step workflow to handle this issue? Any help would be well appreciated.

Thanks in advance, and have a nice week.

Regards.

Last edited by TemC; March 3, 2017 at 03:33.
TemC 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
Temperature dependent Viscosity using Power-Law shikamaru OpenFOAM Running, Solving & CFD 3 January 6, 2015 01:47
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 14:32
icoUncoupledKinematicParcelFoam: temperature dependent viscosity 90nash OpenFOAM Running, Solving & CFD 5 March 26, 2014 23:43
Temperature dependent now-newtonian viscosity mozafarie FLUENT 2 March 22, 2014 00:19
Temperature dependent Cp: JANAF tables vs Debye model antb OpenFOAM Running, Solving & CFD 1 August 26, 2013 16:57


All times are GMT -4. The time now is 12:19.