A newbie question

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

 January 7, 2008, 16:00 Dear all: Any advice on the #1 New Member   Janusz Goldasz Join Date: Mar 2009 Posts: 2 Rep Power: 0 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

 January 7, 2008, 16:17 Welcome. First, have a look a #2 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,783 Rep Power: 22 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 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

 January 7, 2008, 16:19 P.S. A more descriptive thread #3 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,783 Rep Power: 22 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

 April 16, 2008, 04:44 On the Bingham model: non-newt #4 New Member   Annika Gram Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 7 Rep Power: 9 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!

 April 16, 2008, 05:08 We are in the process of imple #5 Senior Member   Eugene de Villiers Join Date: Mar 2009 Posts: 725 Rep Power: 13 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.

 April 16, 2008, 05:12 The subject was discussed here #6 New Member   Janusz Goldasz Join Date: Mar 2009 Posts: 2 Rep Power: 0 The subject was discussed here: http://www.cfd-online.com/cgi-bin/Op...how.cgi?1/6333 Janusz Goldasz

 April 16, 2008, 05:34 Dear Eugene, sounds great! #7 New Member   Annika Gram Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 7 Rep Power: 9 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!

 April 16, 2008, 05:37 Dear Janusz, thank you. Did #8 New Member   Annika Gram Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 7 Rep Power: 9 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

 April 16, 2008, 06:08 I'm not sure what it is for. P #9 Senior Member   Eugene de Villiers Join Date: Mar 2009 Posts: 725 Rep Power: 13 I'm not sure what it is for. Please mail me directly at the end of May for an update, otherwise I will forget.

 April 16, 2008, 06:44 Dear Eugene, what e-mail ad #10 New Member   Annika Gram Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 7 Rep Power: 9 Dear Eugene, what e-mail address do you have? Thanx Annika

 April 17, 2008, 02:48 Hi, Please find attached a #11 Member   Andrew King Join Date: Mar 2009 Location: Perth, Western Australia, Australia Posts: 82 Rep Power: 9 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

 April 17, 2008, 02:51 PS. sorry, \nbsp should be \ #12 Member   Andrew King Join Date: Mar 2009 Location: Perth, Western Australia, Australia Posts: 82 Rep Power: 9 PS. sorry, \nbsp should be \ ch { nbsp } __________________ Dr Andrew King Fluid Dynamics Research Group Curtin University

 April 17, 2008, 02:55 PPS. I just noticed that I hav #13 Member   Andrew King Join Date: Mar 2009 Location: Perth, Western Australia, Australia Posts: 82 Rep Power: 9 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

 June 25, 2008, 07:53 Hello, Has any one succeede #14 New Member   Vinay Ramohalli Gopala Join Date: Mar 2009 Location: Netherlands Posts: 13 Rep Power: 9 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?

 November 30, 2008, 19:14 Hello OpenFOAM experts I am #15 New Member   Raghuveer Sesha Vajapeyayajula Join Date: Mar 2009 Posts: 4 Rep Power: 9 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....

 November 30, 2008, 19:24 Hello OpenFOAM experts I am #16 New Member   Raghuveer Sesha Vajapeyayajula Join Date: Mar 2009 Posts: 4 Rep Power: 9 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

 December 1, 2008, 16:24 Hello OpenFOAM experts I ha #17 New Member   Raghuveer Sesha Vajapeyayajula Join Date: Mar 2009 Posts: 4 Rep Power: 9 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

 January 19, 2009, 22:15 Hello, I am trying to imple #18 New Member   Peter Johnston Join Date: Mar 2009 Location: Brisbane, Queensland, Australia Posts: 23 Rep Power: 9 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::viscosityModels::GeneralisedPowerLaw::calcNu () const { tmp 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::pow(const Foam::GeometricField&, const Foam::tmp >&) [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::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::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::dimensioned(const Foam::word&, Foam::Istream&) [with Type = double] /home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:85: note: Foam::dimensioned::dimensioned(Foam::Istream &) [with Type = double] /home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.H:95: note: Foam::dimensioned::dimensioned(const Type&) [with Type = double] /home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:73: note: Foam::dimensioned::dimensioned(const Foam::word&, const Foam::dimensioned&) [with Type = double] /home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:60: note: Foam::dimensioned::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::dimensioned(const Foam::dimensioned&) 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.

 January 21, 2009, 10:11 Hello everybody, I am very #19 New Member   Peter Weinhaus Join Date: Mar 2009 Posts: 5 Rep Power: 9 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

 January 21, 2009, 10:38 Hi Peter, I think the dimen #20 Senior Member   Gijsbert Wierink Join Date: Mar 2009 Posts: 383 Rep Power: 10 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

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post unoder OpenFOAM Running, Solving & CFD 0 September 3, 2006 21:17 Vedran CFX 1 June 12, 2006 06:50 Caroline FLUENT 2 September 7, 2005 09:38 derick FLUENT 5 August 24, 2005 11:37 Roger CD-adapco 2 December 11, 2002 09:20

All times are GMT -4. The time now is 16:18.