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

Set different viscosities for different areas

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 22, 2009, 07:19
Default Hello everybody. I would li
  #1
New Member
 
Peter Weinhaus
Join Date: Mar 2009
Posts: 5
Rep Power: 17
eldudereeno is on a distinguished road
Hello everybody.

I would like to know weather it is possible in openFOAM to define different viscosities for different areas?

I would like to simulate the flow of magnetorheological fluids which change there viscosities passing a magnetic field.

I am using the HerschelBulkely model, where i have a tau0.
In the areas with magnetic field it would be great if i could increase the tau0 regarding to my field.

Any ideas?

Thanks for possible answers

Best Regards
eldudereeno is offline   Reply With Quote

Old   January 22, 2009, 08:31
Default Should be fine - make tau0 a v
  #2
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
Should be fine - make tau0 a volScalarField and increase it where necessary. Should work.

Gavin
grtabor is offline   Reply With Quote

Old   January 22, 2009, 09:56
Default Sounds good! Thanks a lot,
  #3
New Member
 
Peter Weinhaus
Join Date: Mar 2009
Posts: 5
Rep Power: 17
eldudereeno is on a distinguished road
Sounds good!

Thanks a lot, Gavin!

But could you please explain it for me?
I am very new in OF.

Where shall i do it ? In the transport model (HerschelBulkley) or in the transportProperties ?
eldudereeno is offline   Reply With Quote

Old   January 26, 2009, 04:36
Default Ouch. Having had a chance to h
  #4
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
Ouch. Having had a chance to have a look at it it is a little more complicated. HerschelBulkley is a class derived from viscosityModel making it run-time selectable (which is nice, of course). To change it you would need to create your own class; probably copy the header and class files across to a new directory, rename it, and then alter it appropriately. Having done this you would need to recompile viscosityModels. The alternative would be to start from scratch and implement your own viscosity law into icoFoam (you could probably extract quite a lot of the appropriate code from HerschelBulkley). How is your C++ coding??

Either way, you need to change tau0 to a volScalarField. Instead of declaring it as a dimensionedScalar and reading it from the transportProperties dictionary you would need to create it as a volScalarField and read it in from a file in the timestep directory via an IOobject. To see how to do this, look at the declaration of the field "p" in createFields.H

Gavin
grtabor is offline   Reply With Quote

Old   February 10, 2009, 11:27
Default Thank you Gavin! I made tau
  #5
New Member
 
Peter Weinhaus
Join Date: Mar 2009
Posts: 5
Rep Power: 17
eldudereeno is on a distinguished road
Thank you Gavin!

I made tau0 a colScalarField (which indeed took a long time, hehe)
Via setFields i was able to declare at in the neccesary places.

But the transport modell is of course still using the tau0 of my transportProperties.

My C++ Coding is pretty poor.
I copied the HerschelBulkely class and renamed it.
Than i was even able to compile it and make it usable for my calculation.

But i have absolutely no idea how to change:
read tau0 not as a fixed variable but as a field.

Peter
eldudereeno 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
SIMPLE: instability at low viscosities Lionel S. Main CFD Forum 7 August 7, 2014 18:01
Setting viscosities in Interior zones philip FLUENT 8 September 16, 2005 14:07
face areas UDF Andrew Garrard FLUENT 0 October 19, 2004 09:55
emerging areas in cfd? Red Main CFD Forum 5 January 25, 2003 09:58
areas of no flow Eve Chapper CFX 1 December 16, 1999 07:02


All times are GMT -4. The time now is 03:28.