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

A newbie question

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2008, 16:00
Default Dear all: Any advice on the
  #1
New Member
 
Janusz Goldasz
Join Date: Mar 2009
Posts: 2
Rep Power: 0
janusz is on a distinguished road
Dear all:

Any advice on the topic would be greatly appreciated especially since I am new to OpenFoam.

The problem I am trying to solve is to model the behavior of a visco-plastic material (e.g. a toothpaste) using a variation of a Bingham model, where typically:

shear_stress = yield_stress + nu*shear_rate

In the past I used to approach such tasks in FLUENT coding an appropriate UDF for apparent viscocity.

In the problem yield stress is spatially dependent (x,y,z), therefore this information needs to be acquired by the model .

A question then:

How can I add a new material model to OpenFoam?
What solver would be best suited for this task? This is a relatively low Re task (>3000).

Best regards & appreciate any response,
Janusz Goldasz
janusz is offline   Reply With Quote

Old   January 7, 2008, 16:17
Default Welcome. First, have a look a
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Welcome. First, have a look at simpleFoam to see how it picks the viscosity model - it is called transportModel. Then, go to:

OpenFOAM-1.4.1-dev/src/transportModels/incompressible/viscosityModels and you will see a family of viscosity models like the one you need. Start from the most similar one, e.g. BirdCarreau, copy it, change all instances of "BirdCarreau" in the file and in the business bit calculate your viscosity. Thus (I'm looking at the existing Bird-Carreau):

//- Calculate and return the laminar viscosity
tmp<volscalarfield> BirdCarreau::calcNu() const
{
return
nuInf_
+ (nu0_ - nuInf_)
*pow(scalar(1) + sqr(k_*strainRate()), (n_ - 1.0)/2.0);

}

This should be clear...

Enjoy OpenFOAM,

Hrv
dawnrain likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 7, 2008, 16:19
Default P.S. A more descriptive thread
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
P.S. A more descriptive thread name in the future please - people need to be able to search for this. Thus:

How to implement own viscosity model?

or

visco-plastic material, Bingham model

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   April 16, 2008, 05:44
Default On the Bingham model: non-newt
  #4
New Member
 
Annika Gram
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 7
Rep Power: 17
annikagram is on a distinguished road
On the Bingham model: non-newtonian flow

Has anyone succeeded in implementing the Bingham model shear_stress = yield_stress + nu*shear_rate or maybe Hershel-bulkley at src/transportModels/incompressible/viscosityModels? It is a visco plastic material model including yield stress, which I am not quite sure how to implement into existing models, where no shear stress is present. Thank you!
annikagram is offline   Reply With Quote

Old   April 16, 2008, 06:08
Default We are in the process of imple
  #5
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
We are in the process of implementing a Hershel-Bulkley model. If you are willing to wait a few months I can send you a copy when when the job is done.
eugene is offline   Reply With Quote

Old   April 16, 2008, 06:12
Default The subject was discussed here
  #6
New Member
 
Janusz Goldasz
Join Date: Mar 2009
Posts: 2
Rep Power: 0
janusz is on a distinguished road
The subject was discussed here:

http://www.cfd-online.com/cgi-bin/Op...how.cgi?1/6333

Janusz Goldasz
janusz is offline   Reply With Quote

Old   April 16, 2008, 06:34
Default Dear Eugene, sounds great!
  #7
New Member
 
Annika Gram
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 7
Rep Power: 17
annikagram is on a distinguished road
Dear Eugene,

sounds great! Where and for what use are you implementing the Hershel-Bulkley model? I am currently modelling fresh concrete flow, so Hershel-Bulkley would fit rather nicely. My e-mail address is: annika.gram@cbi.se
Thanx!
annikagram is offline   Reply With Quote

Old   April 16, 2008, 06:37
Default Dear Janusz, thank you. Did
  #8
New Member
 
Annika Gram
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 7
Rep Power: 17
annikagram is on a distinguished road
Dear Janusz,

thank you. Did you succeed with the Bingham model? I am rather curious how you introduced the yield stress into the existing Coss or BirdCarreau model. I was thinking they are not stress based, but viscosity based material models?
Annika
annikagram is offline   Reply With Quote

Old   April 16, 2008, 07:08
Default I'm not sure what it is for. P
  #9
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
I'm not sure what it is for. Please mail me directly at the end of May for an update, otherwise I will forget.
eugene is offline   Reply With Quote

Old   April 16, 2008, 07:44
Default Dear Eugene, what e-mail ad
  #10
New Member
 
Annika Gram
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 7
Rep Power: 17
annikagram is on a distinguished road
Dear Eugene,

what e-mail address do you have?
Thanx
Annika
annikagram is offline   Reply With Quote

Old   April 17, 2008, 03:48
Default Hi, Please find attached a
  #11
Member
 
Andrew King
Join Date: Mar 2009
Location: Perth, Western Australia, Australia
Posts: 82
Rep Power: 17
andersking is on a distinguished road
Hi,

Please find attached a Herschel-Bulkley model, and test case. I wrote this for OF-1.3, but never got around to using it/validating it. I've updated it for OF-1.4, but probably still needs to be validated (and checked for errors).

The implementation is based on the one described in the fluent user manual, ie

nu = (tau0 + k * (pow(strainRate(),n) - pow(tau0/nu0,n)))/strainRate();

the parameters are
\nbsp \nbsp tau0 - yield stress
\nbsp \nbsp nu0 - pre-yield viscosity
\nbsp \nbsp k - consistency index
\nbsp \nbsp n - power index

To imitate a bingham plastic, k becomes the viscosity after yield, n=1 and nu0 should be set to a very high value.

I've attached a diff against the OF-extend version of OF (should work on the standard I think), or alternatively just the required source files.

to use the source files HerschelBulkley.tgz needs to be extracted in the src/transportModels/incompressible/viscosityModels directory.
ie.

cd OF-1.4.1/src/transportModels/incompressible/viscosityModels
tar -zxvf HerschelBulkley.tgz


and then the file src/transportModels/incompressible/Make/files needs to be modified to add the model by adding
viscosityModels/HerschelBulkley/HerschelBulkley.C after the line
viscosityModels/BirdCarreau/BirdCarreau.C


then you will need to rebuild libincompressibleTransportModels, ie.

cd OF-1.4.1/src/transportModels/incompressible
wmake libso .


I have also attached an example case (pipe flow)

Cheers,
Andrew

HerschelBulkley.tgz
HerschelBulkley.diff
HerschelBulkleyCase.tgz
__________________
Dr Andrew King
Fluid Dynamics Research Group
Curtin University
andersking is offline   Reply With Quote

Old   April 17, 2008, 03:51
Default PS. sorry, \nbsp should be \
  #12
Member
 
Andrew King
Join Date: Mar 2009
Location: Perth, Western Australia, Australia
Posts: 82
Rep Power: 17
andersking is on a distinguished road
PS. sorry, \nbsp should be \ ch { nbsp }
__________________
Dr Andrew King
Fluid Dynamics Research Group
Curtin University
andersking is offline   Reply With Quote

Old   April 17, 2008, 03:55
Default PPS. I just noticed that I hav
  #13
Member
 
Andrew King
Join Date: Mar 2009
Location: Perth, Western Australia, Australia
Posts: 82
Rep Power: 17
andersking is on a distinguished road
PPS. I just noticed that I have nu0 as mu0 in the code. the case should work as is though.
__________________
Dr Andrew King
Fluid Dynamics Research Group
Curtin University
andersking is offline   Reply With Quote

Old   June 25, 2008, 08:53
Default Hello, Has any one succeede
  #14
New Member
 
Vinay Ramohalli Gopala
Join Date: Mar 2009
Location: Netherlands
Posts: 13
Rep Power: 17
gopala is on a distinguished road
Hello,

Has any one succeeded in validating the HerschelBulkley model of Andrew?

I implemented the Bingham model in OpenFOAM-1.4 and while validating I see a strong dependence on the time step size. For a simple channel flow case, I get different pressure fields for different values of time step size. Any suggestions?
gopala is offline   Reply With Quote

Old   November 30, 2008, 19:14
Default Hello OpenFOAM experts I am
  #15
New Member
 
Raghuveer Sesha Vajapeyayajula
Join Date: Mar 2009
Posts: 4
Rep Power: 17
rvajapey is on a distinguished road
Hello OpenFOAM experts

I am a beginner and have been trying to implement these models into OpenFOAM-1.4.1-dev version. I have a few questions about these models. I can see the implementation of Herschel Bulkley in OpenFOAM-1.5, what happens when the strainRate() becomes zero? Does the model have an artificial cap on the maximum value of nu so that it does not blow up?

Sorry if the question sounds stupid.

Thank you very much for your time....
rvajapey is offline   Reply With Quote

Old   November 30, 2008, 19:24
Default Hello OpenFOAM experts I am
  #16
New Member
 
Raghuveer Sesha Vajapeyayajula
Join Date: Mar 2009
Posts: 4
Rep Power: 17
rvajapey is on a distinguished road
Hello OpenFOAM experts

I am also trying to implement the Giesekus model. The expression for the model is given:

(taup_+lambda_*(fvm::ddt(taup_)+fvm::div(phi_,taup _)
-((gradU_.T()&taup_)+(taup_&gradU_)))+ (alpha_*lambda_*(taup_&taup_)/etap_)) == 2*etap_*gradU_);

All my tensors here are symmetric. I have noticed that the term ((gradU_.T()&taup_)+(taup_&gradU_))+(alpha_*lambda _*(taup_&taup_)/etap_));
is blowing up and I do not understand the reason. I have tried the linear Maxwell model which is the same as above without the ((gradU_.T()&taup_)+(taup_&gradU_))+(alpha_*lambda _*(taup_&taup_)/etap_));
term and that seems to work fine. I cannot use Sp, SuSp because they cannot work on symmetric tensors.

I would be really happy if anyone could suggest what is wrong with the equation.

Thank you very much for your time....

Raghu
rvajapey is offline   Reply With Quote

Old   December 1, 2008, 16:24
Default Hello OpenFOAM experts I ha
  #17
New Member
 
Raghuveer Sesha Vajapeyayajula
Join Date: Mar 2009
Posts: 4
Rep Power: 17
rvajapey is on a distinguished road
Hello OpenFOAM experts

I have been trying to model the Extended form of Herschel Bulkley equation. The equation has the form as given

nu = min(nu0, (tau0 + k * (pow(strainRate(),n)+nuInf)/strainRate())

The term pow(tau0/nu0,n) (present in the FOAM-1.5 version) is missing here. Can anybody explain to me the significance of this term?

Thank you very much for your time.

Raghu
rvajapey is offline   Reply With Quote

Old   January 19, 2009, 22:15
Default Hello, I am trying to imple
  #18
New Member
 
Peter Johnston
Join Date: Mar 2009
Location: Brisbane, Queensland, Australia
Posts: 25
Rep Power: 17
prjohnston is on a distinguished road
Hello,

I am trying to implement a generalised power law model for blood viscosity (Ballyk et al, Biorheology, 31 (5), pp 565-586 (1994). In this model the exponent in the power law is a function of the local strain rate. My implemented calcNu() funciton is:

// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

Foam::tmp<foam::volscalarfield>
Foam::viscosityModels::GeneralisedPowerLaw::calcNu () const
{
tmp<volscalarfield> sr(strainRate());
return ((nu0_*exp(-(scalar(1)+(sr())/a_)*exp(-b_/(sr())))+nuInf_)*pow(sr(),(nInf_-n0_*e xp(-(scalar(1)+sr()/c_)*exp(-d_/sr()))-scalar(1))));
}

Unfortunately, this fails to compile giving the following error messages:
wmake
Making dependency list for source file viscosityModels/GeneralisedPowerLaw/GeneralisedPowerLaw.C
SOURCE=viscosityModels/GeneralisedPowerLaw/GeneralisedPowerLaw.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I.. -I/home/peter/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/GeneralisedPowerLaw.o
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricScalarField.C: In function 'Foam::tmp<foam::geometricfield<double,> > Foam::pow(const Foam::GeometricField<double,>&, const Foam::tmp<foam::geometricfield<double,> >&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]':
viscosityModels/GeneralisedPowerLaw/GeneralisedPowerLaw.C:61: instantiated from here
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricScalarField.C: 220: error: no matching function for call to 'Foam::dimensioned<double>::dimensioned(const char [2], double, const Foam::dimensionSet&)'
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:112: note: candidates are: Foam::dimensioned<type>::dimensioned(const Foam::word&, const Foam::dimensionSet&, Foam::Istream&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:98: note: Foam::dimensioned<type>::dimensioned(const Foam::word&, Foam::Istream&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:85: note: Foam::dimensioned<type>::dimensioned(Foam::Istream &) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.H:95: note: Foam::dimensioned<type>::dimensioned(const Type&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:73: note: Foam::dimensioned<type>::dimensioned(const Foam::word&, const Foam::dimensioned<type>&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:60: note: Foam::dimensioned<type>::dimensioned(const Foam::word&, const Foam::dimensionSet&, Type) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedScalarFwd.H: 42: note: Foam::dimensioned<double>::dimensioned(const Foam::dimensioned<double>&)
make: *** [Make/linuxGccDPOpt/GeneralisedPowerLaw.o] Error 1


I believe the error is due to the fact that in the function pow(a,b), b must be a scalar. In my model b would be a volScalarField (I think).

Is there some way to overcome this problem? Perhaps I have misinterpreted the error messages and there is something else wrong. Any insights would be appreciated.

Thanks,

Peter.
prjohnston is offline   Reply With Quote

Old   January 21, 2009, 10:11
Default Hello everybody, I am very
  #19
New Member
 
Peter Weinhaus
Join Date: Mar 2009
Posts: 5
Rep Power: 17
eldudereeno is on a distinguished road
Hello everybody,

I am very new with OpenFOAM and having loosy beginners questions :-)
My questions are about the HerschelBuckley viscosity model.

I always get errors with my dimensions.
Could anybody explain me what i have to insert for "nu0,tau0,k,n"

At the moment i have:
0 2 -1 0 0 0 0 for nu0
0 2 -1 0 0 for tau0
0 2 -1 0 0 0 0 for k
0 0 0 0 0 0 0 for n

which actually does not make sence but its the combination with the least errors.

Thanks a lot
eldudereeno is offline   Reply With Quote

Old   January 21, 2009, 10:38
Default Hi Peter, I think the dimen
  #20
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Peter,

I think the dimensions should be:

[0 2 -1 0 0 0 0] for nu0
[0 2 -2 0 0 0 0] for tau0
[0 2 -2 0 0 0 0] for k
[0 0 0 0 0 0 0] for n

What solver are you using?

Rgds, Gijsbert
__________________
Regards, Gijs
gwierink 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
Gdb newbie question about printing strings out and confusion about Word bs unoder OpenFOAM Running, Solving & CFD 0 September 3, 2006 22:17
Newbie CFX Question Vedran CFX 1 June 12, 2006 07:50
Newbie question on Yplus and some Caroline FLUENT 2 September 7, 2005 10:38
Newbie qn derick FLUENT 5 August 24, 2005 12:37
newbie question Roger Siemens 2 December 11, 2002 09:20


All times are GMT -4. The time now is 06:26.