generalised_newtonian_constitutive_models.h
Go to the documentation of this file.
1// LIC// ====================================================================
2// LIC// This file forms part of oomph-lib, the object-oriented,
3// LIC// multi-physics finite-element library, available
4// LIC// at http://www.oomph-lib.org.
5// LIC//
6// LIC// Copyright (C) 2006-2025 Matthias Heil and Andrew Hazel
7// LIC//
8// LIC// This library is free software; you can redistribute it and/or
9// LIC// modify it under the terms of the GNU Lesser General Public
10// LIC// License as published by the Free Software Foundation; either
11// LIC// version 2.1 of the License, or (at your option) any later version.
12// LIC//
13// LIC// This library is distributed in the hope that it will be useful,
14// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// LIC// Lesser General Public License for more details.
17// LIC//
18// LIC// You should have received a copy of the GNU Lesser General Public
19// LIC// License along with this library; if not, write to the Free Software
20// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21// LIC// 02110-1301 USA.
22// LIC//
23// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24// LIC//
25// LIC//====================================================================
26
27
28#ifndef OOMPH_GENERALISED_NEWTONIAN_CONSTITUTIVE_MODELS_HEADER
29#define OOMPH_GENERALISED_NEWTONIAN_CONSTITUTIVE_MODELS_HEADER
30
31
32// Oomph-lib includes
33// #include "generic.h"
34
35namespace oomph
36{
37 //======================================================================
38 /// A Base class defining the generalise Newtonian constitutive relation
39 //======================================================================
40 template<unsigned DIM>
42 {
43 public:
44 /// Empty constructor
46
47
48 /// Empty virtual destructor
50
51 /// Function implementing the constitutive model
52 /// Input: second invariant of the rate of strain
53 /// Output: the viscosity
54 /// For Newtonian behaviour this returns 1
55 virtual double viscosity(
57
58 /// Function returning the derivative of the viscosity w.r.t.
59 /// the second invariant of the rate of strain tensor
60 /// For Newtonian behaviour this returns 0.0
61 virtual double dviscosity_dinvariant(
63 };
64
65 //===================================================================
66 /// A GeneralisedNewtonianConstitutiveEquation class
67 /// defining a Newtonian fluid
68 //===================================================================
69 template<unsigned DIM>
72 {
73 public:
74 /// Constructor: specify viscosity ratio (defaults to one)
75 NewtonianConstitutiveEquation(const double& viscosity_ratio = 1.0)
76 : Viscosity_ratio(viscosity_ratio)
77 {
78 }
79
80 /// in the Newtonian case the viscosity is constant
82 {
83 return Viscosity_ratio;
84 }
85
86 /// the derivative w.r.t. I2 is zero
89 {
90 return 0.0;
91 }
92
93 private:
94 /// Viscosity ratio
96 };
97
98
99 //===================================================================
100 /// A GeneralisedNewtonianConstitutiveEquation class defining a power-law
101 /// fluid regularised according to Bercovier and Engelman (1980) to allow for
102 /// n < 1
103 //==================================================================
104 template<unsigned DIM>
107 {
108 private:
109 /// power law index n
110 double* Power_pt;
111
112 /// regularisation parameter e << 1
114
115
116 public:
123
125 {
126 // Pre-multiply the second invariant with +/-1 depending on whether it's
127 // positive or not
128 double sign = -1.0;
130 {
131 sign = 1.0;
132 }
133
134 // Calculate the square root of the absolute value of the
135 // second invariant of the rate of strain tensor
138
139 return pow(
141 *Power_pt - 1.0);
142 }
143 };
144
145 //===================================================================
146 /// A GeneralisedNewtonianConstitutiveEquation class
147 /// defining a Herschel-Bulkley fluid
148 /// using Bercovier and Engelman's (1980) regularisation
149 //==================================================================
150 template<unsigned DIM>
153 {
154 private:
155 /// yield stress tau_y
157
158 /// power law index n
160
161 /// regularisation parameter e << 1
163
164
165 public:
176
178 {
179 // Pre-multiply the second invariant with +/-1 depending on whether it's
180 // positive or not
181 double sign = -1.0;
183 {
184 sign = 1.0;
185 }
186
187 // Calculate the square root of the absolute value of the
188 // second invariant of the rate of strain tensor
192
193 return (*Yield_stress_pt) / (2.0 * measure_of_rate_of_strain) +
195 }
196
197 // not implemented yet
200 {
201 // Pre-multiply the second invariant with +/-1 depending on whether it's
202 // positive or not
203 double sign = -1.0;
205 {
206 sign = 1.0;
207 }
208
209 // std::ostringstream error_stream;
210 // error_stream << "This has not been implemented yet!";
211 // throw OomphLibError(
212 // error_stream.str(),
213 // OOMPH_CURRENT_FUNCTION,
214 // OOMPH_EXCEPTION_LOCATION);
215
216 return sign * pow(2.0, (*Flow_index_pt) - 2.0) *
217 ((*Flow_index_pt) - 1.0) *
220 ((*Flow_index_pt) - 1.0) / 2.0 - 1.0) -
221 sign * (*Yield_stress_pt) /
224 3.0 / 2.0));
225 }
226 };
227
228 //===================================================================
229 /// A GeneralisedNewtonianConstitutiveEquation class
230 /// defining a Herschel-Bulkley fluid
231 /// using Tanner and Milthorpe's (1983) regularisation
232 //==================================================================
233 template<unsigned DIM>
236 {
237 private:
238 /// yield stress tau_y
240
241 /// power law index n
243
244 /// value of the second invariant below which we have
245 /// constant (Newtonian) viscosity -- assumed to be always positive
247
248 public:
249 /// "Cutoff regularised" Herschel Bulkley constitutive equation
251 double* yield_stress_pt,
252 double* flow_index_pt,
258 {
259 // Calculate the Newtonian cutoff viscosity from the constitutive
260 // equation and the cutoff value of the second invariant
262
263 oomph_info << "HerschelBulkleyTanMilRegConstitutiveEquation: "
264 << " cutoff viscosity = " << cut_off_viscosity << std::endl;
265
266 oomph_info << " "
267 << " cutoff invariant = " << *Critical_second_invariant_pt
268 << std::endl;
269 }
270
271 /// Function that calculates the cut off viscosity
273 {
274 return (*Yield_stress_pt) /
277 *Flow_index_pt - 1.0);
278 }
279
280 /// Report cutoff values
287
288
289 /// Viscosity ratio as a fct of strain rate invariant
291 {
292 // Pre-multiply the second invariant with +/-1 depending on whether it's
293 // positive or not
294 double sign = -1.0;
296 {
297 sign = 1.0;
298 }
299
300 // std::cout<<"I2 "<<second_invariant_of_rate_of_strain_tensor<<std::endl;
301
302 // if the second invariant is below the cutoff we have a constant,
303 // Newtonian viscosity
306 {
308 }
309 else
310 {
311 // Calculate the square root of the absolute value of the
312 // second invariant of the rate of strain tensor
315
316 return (*Yield_stress_pt) / (2.0 * measure_of_rate_of_strain) +
318 }
319 }
320
321 /// Deriv of viscosity w.r.t. strain rate invariant
324 {
325 // Pre-multiply the second invariant with +/-1 depending on whether it's
326 // positive or not
327 double sign = -1.0;
329 {
330 sign = 1.0;
331 }
332
335 {
336 return 0.0;
337 }
338 else
339 {
340 return sign * pow(2.0, (*Flow_index_pt) - 2.0) *
341 ((*Flow_index_pt) - 1.0) *
343 ((*Flow_index_pt) - 1.0) / 2.0 - 1.0) -
344 sign * (*Yield_stress_pt) /
346 3.0 / 2.0));
347 }
348 }
349 };
350
351 //===================================================================
352 /// A GeneralisedNewtonianConstitutiveEquation class
353 /// defining a Herschel-Bulkley fluid
354 /// using Tanner and Milthorpe's (1983) regularisation
355 /// with a smooth transition using a quadratic
356 //==================================================================
357 template<unsigned DIM>
360 {
361 private:
362 /// yield stress tau_y
364
365 /// power law index n
367
368 /// value of the second invariant below which we have
369 /// constant (Newtonian) viscosity -- assumed to be always positive
371
372 /// We use a quadratic function to smoothly blend from the Herschel Bulkley
373 /// model at the cut-off to a constant viscosity as the strain rate
374 /// /approaches zero; this way we avoid the
375 /// discontinuity of the gradient at the cut-off, which is present in the
376 /// classic Tanner Milthorpe regularisation
377 double a;
378 double b;
379 double c;
380
381 /// Fraction of the cut-off strain rate below which the viscosity is
382 /// constant 0 <= alpha < 1
383 double alpha;
384
385
386 public:
387 /// "Cutoff regularised" Herschel Bulkley constitutive equation
389 double* yield_stress_pt,
390 double* flow_index_pt,
396 a(0.0),
397 b(0.0),
398 c(0.0)
399 {
400 /// Blend over one order of magnitude
401 alpha = 0.1;
402
403 /// Calculate the coefficients of the quadratic equation
405 {
406 a = (pow(2.0, *Flow_index_pt - 3.0) * (*Flow_index_pt - 1.0) *
408 (*Flow_index_pt - 1.0) / 2.0 - 2.0) -
409 (*Yield_stress_pt) /
410 (8.0 * pow(fabs(*Critical_second_invariant_pt), 5.0 / 2.0))) /
411 (1.0 - alpha);
413 c = (*Yield_stress_pt) /
416 *Flow_index_pt - 1.0) -
419 }
420
421 /// get the cutoff viscosity
423
424 /// get the zero shear viscosity
426
427 oomph_info << "HerschelBulkleyTanMilRegWithBlendingConstitutiveEquation: "
428 << " zero shear viscosity = " << zero_shear_viscosity
429 << std::endl;
430
431 oomph_info << "HerschelBulkleyTanMilRegWithBlendingConstitutiveEquation: "
432 << " cut off viscosity = " << cut_off_viscosity << std::endl;
433
434 oomph_info << " "
435 << " cutoff invariant = " << *Critical_second_invariant_pt
436 << std::endl;
437 }
438
439 /// Function that calculates the viscosity at the cutoff invariant
440 /// Note: this is NOT the viscosity at zero I2
442 {
443 // Calculate the Newtonian cutoff viscosity from the constitutive
444 // equation and the cutoff value of the second invariant
445 return (*Yield_stress_pt) /
446 (2.0 * sqrt(std::max(fabs(*Critical_second_invariant_pt),
447 DBL_EPSILON))) +
448 pow((2.0 * sqrt(std::max(fabs(*Critical_second_invariant_pt),
449 DBL_EPSILON))),
450 *Flow_index_pt - 1.0);
451 }
452
453 /// Function that calculates the viscosity at zero I2
455 {
456 // The maximum of either the viscosity at alpha*cut-off or the cut-off
457 // viscosity for a cut-off of zero
458 return std::max(a * pow(alpha, 2.0) *
462 }
463
464 /// Report cutoff values
473
474 /// Viscosity ratio as a fct of strain rate invariant
494
495 /// Deriv of viscosity w.r.t. strain rate invariant
498 {
501 {
502 return 0.0;
503 }
506 {
508 }
509
510 return pow(2.0, *Flow_index_pt - 2.0) * (*Flow_index_pt - 1.0) *
512 (*Flow_index_pt - 1.0) / 2.0 - 1.0) -
513 (*Yield_stress_pt) /
515 3.0 / 2.0));
516 }
517 };
518
519
520 //===================================================================
521 /// A GeneralisedNewtonianConstitutiveEquation class
522 /// defining a Herschel-Bulkley fluid
523 /// using Papanastasiou's (1987) regularisation
524 //==================================================================
525 template<unsigned DIM>
528 {
529 private:
530 /// Yield stress tau_y
532
533 /// Power law index n
535
536 /// Regularisation parameter m >> 1
538
539
540 public:
550
552 {
553 // Calculate magnitude of the rate of strain tensor
556
557 return (1.0 - exp(-2.0 * (*Exponential_parameter_pt) *
560 (1.0 - exp(-2.0 * (*Exponential_parameter_pt) *
564 }
565 };
566
567 //===================================================================
568 /// A GeneralisedNewtonianConstitutiveEquation class
569 /// defining a Herschel-Bulkley fluid
570 /// using Mendes and Dutra's (2004) regularisation
571 //==================================================================
572 template<unsigned DIM>
575 {
576 private:
577 /// yield stress tau_y
579
580 /// power law index n
582
583 /// the viscosity at zero shear rate
585
586 public:
587 /// "Exponentially regularised" Herschel Bulkley constitutive equation
598
599 /// Viscosity ratio as a fct of strain rate invariant
601 {
602 // Pre-multiply the second invariant with +/-1 depending on whether it's
603 // positive or not
604 // Also, because the viscosity is exactly zero at zero invariant,
605 // we have to add a small value to it
606 double sign = -1.0;
607 double eps = 0.0;
609 {
610 eps = 1.0e-30;
611 sign = 1.0;
612 }
614 {
615 sign = 1.0;
616 }
617
618 // Calculate the square root of the absolute value of the
619 // second invariant of the rate of strain tensor
622
623 return (1.0 - exp(-(*Zero_shear_viscosity_pt) * 2.0 *
625 ((*Yield_stress_pt) / (2.0 * measure_of_rate_of_strain) +
627 }
628
629 /// Deriv of viscosity w.r.t. strain rate invariant
632 {
633 // Pre-multiply the second invariant with +/-1 depending on whether it's
634 // positive or not
635 // Also, because the viscosity is exactly zero at zero invariant,
636 // we have to add a small value to it
637 double sign = -1.0;
638 double eps = 0.0;
640 {
641 eps = 1.0e-30;
642 sign = 1.0;
643 }
645 {
646 sign = 1.0;
647 }
648
649 // Calculate the square root of the absolute value of the
650 // second invariant of the rate of strain tensor
653
654 return (1.0 - exp(-(*Zero_shear_viscosity_pt) * 2.0 *
656 (sign * pow(2.0, (*Flow_index_pt) - 2.0) *
657 ((*Flow_index_pt) - 1.0) *
659 ((*Flow_index_pt) - 1.0) / 2.0 - 1.0) -
660 sign * (*Yield_stress_pt) /
661 (4.0 *
663 3.0 / 2.0))) +
664 sign *
665 (((*Zero_shear_viscosity_pt) *
666 exp(-(*Zero_shear_viscosity_pt) * 2.0 *
669 (pow(2.0, (*Flow_index_pt) - 1.0) *
671 ((*Flow_index_pt) - 1.0) / 2.0) +
672 (*Yield_stress_pt) / (2.0 * measure_of_rate_of_strain));
673 }
674 };
675
676 //===================================================================
677 /// A GeneralisedNewtonianConstitutiveEquation class
678 /// defining a Sisko fluid
679 /// using Tanner and Milthorpe's (1983) regularisation
680 /// with a smooth transition using a cubic (for n < 1)
681 //==================================================================
682 template<unsigned DIM>
685 {
686 private:
687 /// pre-factor alpha
688 double* Alpha_pt;
689
690 /// power law index n
692
693 /// value of the second invariant below which we have
694 /// constant (Newtonian) viscosity -- assumed to be always positive
696
697
698 public:
699 /// "Cutoff regularised" Sisko constitutive equation
701 double* alpha_pt,
702 double* flow_index_pt,
705 Alpha_pt(alpha_pt),
708 {
709 /// get the cutoff viscosity
711
712 /// get the zero shear viscosity
714
715 oomph_info << "SiskoTanMilRegWithBlendingConstitutiveEquation: "
716 << " zero shear viscosity = " << zero_shear_viscosity
717 << std::endl;
718
719 oomph_info << "SiskoTanMilRegWithBlendingConstitutiveEquation: "
720 << " cut off viscosity = " << cut_off_viscosity << std::endl;
721
722 oomph_info << " "
723 << " cutoff invariant = " << *Critical_second_invariant_pt
724 << std::endl;
725 }
726
727 /// Function that calculates the viscosity at the cutoff invariant
728 /// Note: this is NOT the viscosity at zero I2
730 {
731 // Calculate the Newtonian cutoff viscosity from the constitutive
732 // equation and the cutoff value of the second invariant
733 return 1.0 +
734 (*Alpha_pt) * pow((2.0 * sqrt((*Critical_second_invariant_pt))),
735 *Flow_index_pt - 1.0);
736 }
737
738 /// Offset by how much the zero shear rate viscosity lies
739 /// above the viscosity at I2_cutoff
740 /// Hard-coded to a value that ensures a smooth transition
745
746 /// Function that calculates the viscosity at zero I2
748 {
749 // get the viscosity at the cutoff point
751
752 /// Offset by how much the zero shear rate viscosity lies
753 /// above the viscosity at I2_cutoff
754 double epsilon =
756
757 return cut_off_viscosity + epsilon;
758 }
759
760 /// Report cutoff values
769
770 // Calculate the fitting parameters for the cubic blending
771 void calculate_fitting_parameters_of_cubic(double& a, double& b)
772 {
773 // get the viscosity at the cutoff invariant
775
776 // calculate the offset at zero shear
777 double epsilon =
779
780 a =
781 1.0 /
782 (4.0 * pow((*Critical_second_invariant_pt), 3.0) *
783 pow((*Critical_second_invariant_pt), 5.0 / 2.0)) *
784 (8.0 * (Cut_off_viscosity + epsilon - 1.0) *
785 pow((*Critical_second_invariant_pt), 5.0 / 2.0) +
786 pow(2.0, (*Flow_index_pt)) * ((*Flow_index_pt) - 1.0) * (*Alpha_pt) *
789 pow(2.0, (*Flow_index_pt) + 2.0) * (*Alpha_pt) *
791
792 b =
793 1.0 /
794 (4.0 * pow((*Critical_second_invariant_pt), 2.0) *
795 pow((*Critical_second_invariant_pt), 5.0 / 2.0)) *
796 (-12.0 * (Cut_off_viscosity + epsilon - 1.0) *
797 pow((*Critical_second_invariant_pt), 5.0 / 2.0) -
798 pow(2.0, (*Flow_index_pt)) * ((*Flow_index_pt) - 1.0) * (*Alpha_pt) *
801 3.0 * pow(2.0, (*Flow_index_pt) + 1.0) * (*Alpha_pt) *
803 }
804
805
806 /// Viscosity ratio as a fct of strain rate invariant
808 {
809 // Get the parameters of the cubic
810 double a;
811 double b;
812
814
816
817 // Pre-multiply the second invariant with +/-1 depending on whether it's
818 // positive or not
819 double sign = -1.0;
821 {
822 sign = 1.0;
823 }
824
825 // if the second invariant is below the cutoff we have a constant,
826 // Newtonian viscosity
829 {
833 }
834 else
835 {
836 // Calculate the square root of the absolute value of the
837 // second invariant of the rate of strain tensor
840
841 return 1.0 + (*Alpha_pt) * pow((2.0 * measure_of_rate_of_strain),
842 *Flow_index_pt - 1.0);
843 }
844 }
845
846 /// Deriv of viscosity w.r.t. strain rate invariant
849 {
850 // Get the parameters of the cubic
851 double a;
852 double b;
853
855
856 // Pre-multiply the second invariant with +/-1 depending on whether it's
857 // positive or not
858 double sign = -1.0;
860 {
861 sign = 1.0;
862 }
863
866 {
867 return sign * 3.0 * a *
870 }
871 else
872 {
873 return (*Alpha_pt) * pow(2.0, (*Flow_index_pt) - 2.0) *
874 ((*Flow_index_pt) - 1.0) *
877 ((*Flow_index_pt) - 1.0) / 2.0 - 2.0);
878 }
879 }
880 };
881
882 //===================================================================
883 /// A GeneralisedNewtonianConstitutiveEquation class
884 /// defining a Casson model fluid
885 /// using Tanner and Milthorpe's (1983) regularisation
886 /// with a smooth transition using a cubic
887 //==================================================================
888 template<unsigned DIM>
891 {
892 private:
893 /// Yield stress
895
896 /// value of the second invariant below which we have
897 /// constant (Newtonian) viscosity -- assumed to be always positive
899
900
901 public:
902 /// "Cutoff regularised" Casson constitutive equation
908 {
909 /// get the cutoff viscosity
911
912 /// get the zero shear viscosity
914
915 oomph_info << "CassonTanMilRegWithBlendingConstitutiveEquation: "
916 << " zero shear viscosity = " << zero_shear_viscosity
917 << std::endl;
918
919 oomph_info << "CassonTanMilRegWithBlendingConstitutiveEquation: "
920 << " cut off viscosity = " << cut_off_viscosity << std::endl;
921
922 oomph_info << " "
923 << " cutoff invariant = " << *Critical_second_invariant_pt
924 << std::endl;
925 }
926
927 /// Function that calculates the viscosity at the cutoff invariant
928 /// Note: this is NOT the viscosity at zero I2
930 {
931 // Calculate the Newtonian cutoff viscosity from the constitutive
932 // equation and the cutoff value of the second invariant
934 2.0 * sqrt(*Yield_stress_pt /
936 1.0;
937 }
938
939 /// Offset by how much the zero shear rate viscosity lies
940 /// above the viscosity at I2_cutoff
941 /// Hard-coded to a value that ensures a smooth transition
946
947 /// Function that calculates the viscosity at zero I2
949 {
950 // get the viscosity at the cutoff point
952
953 /// Offset by how much the zero shear rate viscosity lies
954 /// above the viscosity at I2_cutoff
955 double epsilon =
957
958 return cut_off_viscosity + epsilon;
959 }
960
961 /// Report cutoff values
970
971 // Calculate the fitting parameters for the cubic blending
972 void calculate_fitting_parameters_of_cubic(double& a, double& b)
973 {
974 // get the viscosity at the cutoff invariant
976
977 // calculate the offset at zero shear
978 double epsilon =
980
981 a = 1.0 / pow(*Critical_second_invariant_pt, 39.0 / 4.0) *
982 (pow(*Critical_second_invariant_pt, 27.0 / 4.0) *
983 (2.0 * (Cut_off_viscosity + epsilon) -
984 2.0 * sqrt(2.0) *
986 2.0) -
987 5.0 / 4.0 * (*Yield_stress_pt) *
988 pow(*Critical_second_invariant_pt, 25.0 / 4.0) -
989 1.0 / (2.0 * sqrt(2.0)) * sqrt(*Yield_stress_pt) *
990 pow(*Critical_second_invariant_pt, 13.0 / 2.0));
991
992 b = 1.0 / pow(*Critical_second_invariant_pt, 27.0 / 4.0) *
993 (pow(*Critical_second_invariant_pt, 19.0 / 4.0) *
994 (-3.0 * (Cut_off_viscosity + epsilon) +
995 3.0 * sqrt(2.0) *
997 3.0) +
998 7.0 / 4.0 * (*Yield_stress_pt) *
999 pow(*Critical_second_invariant_pt, 17.0 / 4.0) +
1000 1.0 / (2.0 * sqrt(2.0)) * sqrt(*Yield_stress_pt) *
1001 pow(*Critical_second_invariant_pt, 9.0 / 2.0));
1002 }
1003
1004
1005 /// Viscosity ratio as a fct of strain rate invariant
1007 {
1008 // Get the parameters of the cubic
1009 double a;
1010 double b;
1011
1013
1015
1016 // Pre-multiply the second invariant with +/-1 depending on whether it's
1017 // positive or not
1018 double sign = -1.0;
1020 {
1021 sign = 1.0;
1022 }
1023
1024 // if the second invariant is below the cutoff we have a constant,
1025 // Newtonian viscosity
1028 {
1032 }
1033 else
1034 {
1035 // Calculate the square root of the absolute value of the
1036 // second invariant of the rate of strain tensor
1039
1040 return *Yield_stress_pt / (2.0 * measure_of_rate_of_strain) +
1041 2.0 *
1043 1.0;
1044 }
1045 }
1046
1047 /// Deriv of viscosity w.r.t. strain rate invariant
1050 {
1051 // Get the parameters of the cubic
1052 double a;
1053 double b;
1054
1056
1057 // Pre-multiply the second invariant with +/-1 depending on whether it's
1058 // positive or not
1059 double sign = -1.0;
1061 {
1062 sign = 1.0;
1063 }
1064
1067 {
1068 return sign * 3.0 * a *
1071 }
1072 else
1073 {
1074 return -sqrt(*Yield_stress_pt) *
1076 (2.0 * sqrt(2.0) *
1078 9.0 / 4.0)) -
1081 5.0 / 2.0));
1082 }
1083 }
1084 };
1085
1086 //===================================================================
1087 /// A GeneralisedNewtonianConstitutiveEquation class
1088 /// defining an arbitrary shear-thinning fluid
1089 //==================================================================
1090 template<unsigned DIM>
1093 {
1094 private:
1095 /// high shear rate viscosity
1096 double* Mu_inf_pt;
1097
1098 /// zero shear rate viscosity
1099 double* Mu_0_pt;
1100
1101 /// parameter that controls the steepness of the curve
1102 double* Alpha_pt;
1103
1104
1105 public:
1107 double* mu_0_pt,
1108 double* alpha_pt)
1112 Alpha_pt(alpha_pt)
1113 {
1114 }
1115
1117 {
1118 return (*Mu_inf_pt) +
1119 ((*Mu_0_pt) - (*Mu_inf_pt)) *
1121 }
1122
1125 {
1126 // std::ostringstream error_stream;
1127 // error_stream << "This has not been implemented yet!";
1128 // throw OomphLibError(
1129 // error_stream.str(),
1130 // OOMPH_CURRENT_FUNCTION,
1131 // OOMPH_EXCEPTION_LOCATION);
1132
1133 // return 0.0;
1134
1135 return (*Alpha_pt) * ((*Mu_inf_pt) - (*Mu_0_pt)) *
1137 }
1138 };
1139
1140 //===================================================================
1141 /// A GeneralisedNewtonianConstitutiveEquation class
1142 /// defining a fluid following a tanh-profile
1143 //==================================================================
1144 template<unsigned DIM>
1147 {
1148 private:
1149 /// high shear rate viscosity
1150 double* Mu_inf_pt;
1151
1152 /// zero shear rate viscosity
1153 double* Mu_0_pt;
1154
1155 /// parameter controlling the steepness of the step
1156 /// nb -- I used 10.0/(*Critical_second_invariant_pt)
1157 double* Alpha_pt;
1158
1159 /// parameter that controls the location of the step -- assumed
1160 /// to be always positive
1162
1163 public:
1175
1177 {
1178 // Pre-multiply the second invariant with +/-1 depending on whether it's
1179 // positive or not
1180 double sign = -1.0;
1182 {
1183 sign = 1.0;
1184 }
1185
1186 return ((*Mu_0_pt) - (*Mu_inf_pt)) / 2.0 *
1189 (*Alpha_pt)) -
1190 ((*Mu_0_pt) - (*Mu_inf_pt)) / 2.0 + (*Mu_0_pt);
1191 }
1192
1195 {
1196 // Pre-multiply the second invariant with +/-1 depending on whether it's
1197 // positive or not
1198 double sign = -1.0;
1200 {
1201 sign = 1.0;
1202 }
1203
1204 return -sign * ((*Mu_0_pt) - (*Mu_inf_pt)) * 10.0 /
1205 (2.0 * (*Critical_second_invariant_pt)) * 1.0 /
1208 (*Alpha_pt)) *
1209 1.0 /
1212 (*Alpha_pt));
1213 }
1214 };
1215
1216
1217 /////////////////////////////////////////////////////////////////////
1218 /////////////////////////////////////////////////////////////////////
1219 /////////////////////////////////////////////////////////////////////
1220
1221} // namespace oomph
1222
1223
1224#endif
A GeneralisedNewtonianConstitutiveEquation class defining a Casson model fluid using Tanner and Milth...
double calculate_cutoff_viscosity()
Function that calculates the viscosity at the cutoff invariant Note: this is NOT the viscosity at zer...
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Viscosity ratio as a fct of strain rate invariant.
CassonTanMilRegWithBlendingConstitutiveEquation(double *yield_stress_pt, double *critical_second_invariant_pt)
"Cutoff regularised" Casson constitutive equation
void report_cut_off_values(double &cut_off_invariant, double &cut_off_viscosity, double &zero_shear_viscosity)
Report cutoff values.
double * Critical_second_invariant_pt
value of the second invariant below which we have constant (Newtonian) viscosity – assumed to be alwa...
double calculate_zero_shear_viscosity()
Function that calculates the viscosity at zero I2.
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Deriv of viscosity w.r.t. strain rate invariant.
double calculate_viscosity_offset_at_zero_shear(double &cut_off_viscosity)
Offset by how much the zero shear rate viscosity lies above the viscosity at I2_cutoff Hard-coded to ...
A Base class defining the generalise Newtonian constitutive relation.
virtual double viscosity(const double &second_invariant_of_rate_of_strain_tensor)=0
Function implementing the constitutive model Input: second invariant of the rate of strain Output: th...
virtual double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)=0
Function returning the derivative of the viscosity w.r.t. the second invariant of the rate of strain ...
A GeneralisedNewtonianConstitutiveEquation class defining a Herschel-Bulkley fluid using Bercovier an...
HerschelBulkleyBerEngRegConstitutiveEquation(double *yield_stress_pt, double *flow_index_pt, double *regularisation_parameter_pt)
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Function implementing the constitutive model Input: second invariant of the rate of strain Output: th...
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Function returning the derivative of the viscosity w.r.t. the second invariant of the rate of strain ...
A GeneralisedNewtonianConstitutiveEquation class defining a Herschel-Bulkley fluid using Mendes and D...
HerschelBulkleyMenDutRegConstitutiveEquation(double *yield_stress_pt, double *flow_index_pt, double *zero_shear_viscosity_pt)
"Exponentially regularised" Herschel Bulkley constitutive equation
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Deriv of viscosity w.r.t. strain rate invariant.
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Viscosity ratio as a fct of strain rate invariant.
A GeneralisedNewtonianConstitutiveEquation class defining a Herschel-Bulkley fluid using Papanastasio...
HerschelBulkleyPapRegConstitutiveEquation(double *yield_stress_pt, double *flow_index_pt, double *exponential_parameter_pt)
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Function implementing the constitutive model Input: second invariant of the rate of strain Output: th...
A GeneralisedNewtonianConstitutiveEquation class defining a Herschel-Bulkley fluid using Tanner and M...
void report_cut_off_values(double &cut_off_invariant, double &cut_off_viscosity)
Report cutoff values.
double calculate_cut_off_viscosity()
Function that calculates the cut off viscosity.
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Deriv of viscosity w.r.t. strain rate invariant.
HerschelBulkleyTanMilRegConstitutiveEquation(double *yield_stress_pt, double *flow_index_pt, double *critical_second_invariant_pt)
"Cutoff regularised" Herschel Bulkley constitutive equation
double * Critical_second_invariant_pt
value of the second invariant below which we have constant (Newtonian) viscosity – assumed to be alwa...
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Viscosity ratio as a fct of strain rate invariant.
A GeneralisedNewtonianConstitutiveEquation class defining a Herschel-Bulkley fluid using Tanner and M...
HerschelBulkleyTanMilRegWithBlendingConstitutiveEquation(double *yield_stress_pt, double *flow_index_pt, double *critical_second_invariant_pt)
"Cutoff regularised" Herschel Bulkley constitutive equation
double * Critical_second_invariant_pt
value of the second invariant below which we have constant (Newtonian) viscosity – assumed to be alwa...
double calculate_cutoff_viscosity()
Function that calculates the viscosity at the cutoff invariant Note: this is NOT the viscosity at zer...
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Deriv of viscosity w.r.t. strain rate invariant.
double a
We use a quadratic function to smoothly blend from the Herschel Bulkley model at the cut-off to a con...
double alpha
Fraction of the cut-off strain rate below which the viscosity is constant 0 <= alpha < 1.
void report_cut_off_values(double &cut_off_invariant, double &cut_off_viscosity, double &zero_shear_viscosity)
Report cutoff values.
double calculate_zero_shear_viscosity()
Function that calculates the viscosity at zero I2.
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Viscosity ratio as a fct of strain rate invariant.
A GeneralisedNewtonianConstitutiveEquation class defining a Newtonian fluid.
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
in the Newtonian case the viscosity is constant
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
the derivative w.r.t. I2 is zero
NewtonianConstitutiveEquation(const double &viscosity_ratio=1.0)
Constructor: specify viscosity ratio (defaults to one)
A GeneralisedNewtonianConstitutiveEquation class defining an arbitrary shear-thinning fluid.
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Function returning the derivative of the viscosity w.r.t. the second invariant of the rate of strain ...
NicosConstitutiveEquation(double *mu_inf_pt, double *mu_0_pt, double *alpha_pt)
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Function implementing the constitutive model Input: second invariant of the rate of strain Output: th...
double * Alpha_pt
parameter that controls the steepness of the curve
A GeneralisedNewtonianConstitutiveEquation class defining a power-law fluid regularised according to ...
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Function implementing the constitutive model Input: second invariant of the rate of strain Output: th...
A GeneralisedNewtonianConstitutiveEquation class defining a Sisko fluid using Tanner and Milthorpe's ...
SiskoTanMilRegWithBlendingConstitutiveEquation(double *alpha_pt, double *flow_index_pt, double *critical_second_invariant_pt)
"Cutoff regularised" Sisko constitutive equation
double calculate_viscosity_offset_at_zero_shear(double &cut_off_viscosity)
Offset by how much the zero shear rate viscosity lies above the viscosity at I2_cutoff Hard-coded to ...
double calculate_zero_shear_viscosity()
Function that calculates the viscosity at zero I2.
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Deriv of viscosity w.r.t. strain rate invariant.
double * Critical_second_invariant_pt
value of the second invariant below which we have constant (Newtonian) viscosity – assumed to be alwa...
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Viscosity ratio as a fct of strain rate invariant.
void report_cut_off_values(double &cut_off_invariant, double &cut_off_viscosity, double &zero_shear_viscosity)
Report cutoff values.
double calculate_cutoff_viscosity()
Function that calculates the viscosity at the cutoff invariant Note: this is NOT the viscosity at zer...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
A GeneralisedNewtonianConstitutiveEquation class defining a fluid following a tanh-profile.
TanhProfileConstitutiveEquation(double *mu_inf_pt, double *mu_0_pt, double *alpha_pt, double *critical_second_invariant_pt)
double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)
Function returning the derivative of the viscosity w.r.t. the second invariant of the rate of strain ...
double * Alpha_pt
parameter controlling the steepness of the step nb – I used 10.0/(*Critical_second_invariant_pt)
double viscosity(const double &second_invariant_of_rate_of_strain_tensor)
Function implementing the constitutive model Input: second invariant of the rate of strain Output: th...
double * Critical_second_invariant_pt
parameter that controls the location of the step – assumed to be always positive
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...