New models, non-Newtonian formulations and multiphase flows

GEORGIOS FOURTAKAS THE UNIVERSITY OF MANCHESTER [email protected]

5th Dualsphysics Users Workshop 1 5 t h – 17th March 2021 Outline

• Motivation • Mathematical description of non-Newtonian flows • Implementation • Input configuration (xml file) • Examples • Work in progress • Conclusions

5th Dualsphysics Users Workshop 2 1 5 t h – 17th March 2021 Motivation

• Not all fluids are Newtonian • Industrial applications use fluids that exhibit non-Newtonian characteristics • These are usually multi-phase flows of complex fluids Corn starch at 30Hz • Two or more phases with: • different densities • different (at rest) • varying under stress • exhibit a yield strength

Credit: www.youtube.com by bendhoward

5th Dualsphysics Users Workshop 3 1 5 t h – 17th March 2021 Description of non-Newtonian flows

• A non- viscosity is depended on /rate/history • Usually, non-Newtonian fluids do not exhibit linear shear stress-rate behaviour • In DualSPHysics v5.0 we have implemented time independent fluids • A number of combinations and options are possible Bingham- pseudoplastic Bingham pseudoplastic

Newtonian Viscoelastic Bingham-

behaviour dilatant Shear stress Shear

Time dependant non- Newtonian pseudoplastic Dilatant behaviour Yield strength Fluid Time independent Newtonian dilatant behaviour

Bingham type

Shear rate

5th Dualsphysics Users Workshop 4 1 5 t h – 17th March 2021 Mathematical description of non-Newtonian flows

• The governing equations read d 휌 = −휌∇ ⋅ 퐮 d 푡 and d 퐮 1 1 = − ∇푝 + ∇ ∙ 흉 + 퐅 d 푡 휌 휌 • In SPH formalism we obtain our usual classical form d 휌 푚푗 = 휌푖 ෍ 퐮푖 − 퐮푗 ⋅ ∇푖푊푖푗 + 훿ℎ푐0퐷푖 d 푡 휌푗 푗 and d 퐮 푝푗 + 푝푖 흉푖 + 흉푗 = − ෍ 푚푗 ∇푖푊푖푗 + ෍ 푚푗 ∙ ∇푖푊푖푗 d 푡 휌푗휌푖 휌푖휌푗 푗 푗 • We will be using a constitutive equation for the shear stresses (second term on the right-hand side of the momentum equation)

5th Dualsphysics Users Workshop 5 1 5 t h – 17th March 2021 Mathematical description of non-Newtonian flows

• For a Newtonian fluid, the constitutive equation reads 흉 = 2휂휸ሶ with 1 1 휸ሶ = 훻퐮 + 훻푇퐮 − ∇ ∙ 퐮 푰 2 3 • For a non-Newtonian fluid, the viscosity is related to the shear rate

흉 = 2휂푎푝푝휸ሶ , and 휂푎푝푝 = 푓(휸ሶ , 휏푦, … ) • In DualSPHysics v5.0 we use the so-called Herschel-Bulkley-Papanastasiou constitutive equation which reads

휏푦 휂 = 휂 훾ሶ 푛퐻퐵−1 + 1 − 푒−푚푃 훾ሶ 푎푝푝 훾ሶ ሶ where, 훾 is the magnitude of the symmetric tensor (invariant), 휏푦is the yield strength of the material,

and parameters 푛퐻퐵 and 푚푃 are the power law index and exponential shear rate growth parameter, respectively.

5th Dualsphysics Users Workshop 6 1 5 t h – 17th March 2021 Mathematical description of non-Newtonian flows

• The Herschel-Bulkley-Papanastasiou (HBP) constitutive equation is a general viscoplastic model which can represent a variety of time independent non-Newtonian fluids

• Newtonian • • Bingham thinning • Shear thickening • Bingham thickening • As 푚 → ∞ the HBP model approximates the original Bingham model model and when 푛 ≠ 1 the model reduces to a Herschel-Bulkley (shear thinning or thickening)

• For 푛 = 1 and 푚 = 0 the model reduces to a Newtonian fluid

• Most importantly, it does not exhibit a discontinuity at 휏 = 휏푦

5th Dualsphysics Users Workshop 7 1 5 t h – 17th March 2021 Mathematical description of non-Newtonian flows

1 There are two options for 1 − ∇ ∙ 퐮 푰 = 0 − ∇ ∙ 퐮 푰 ≠ 0 3 the viscous term 3 • Assume incompressible flow • Assume (weakly) compressible flow • Isotropic material (isotropic stress tensor) • Discretise the shear stress tensor without any additions/modifications • Divergence-free (∇ ∙ 퐮 = 0)

1 휏푖 + 휏푗 1 휂푎푝푝 2 ∇ ∙ 흉 = ෍ 푚푗 ∙ ∇푖푊푖푗 ∇ ∙ 흉 = 훻 퐮 휌 휌푖휌푗 휌 휌 푗 • SPH Laplacian operator by Morris et. al., 1997 with 흉 = 2휂푎푝푝휸ሶ 푚 (휂 + 휂 ) 휂푎푝푝 2 1 푗 푎푝푝,푗 푎푝푝,푖 훻 퐮 = ෍ 2 퐱푖푗 ⋅ ∇푊푖푗 퐮푖푗 휌 휌푖 휌푗 푥푖푗 푗

5th Dualsphysics Users Workshop 8 1 5 t h – 17th March 2021 Mathematical description of non-Newtonian flows

Velocity gradients : there are again two options • To obtain the apparent viscosity we use the HBP constitutive equation 휏푦 휂 = 휂 훾ሶ 푛퐻퐵−1 + 1 − 푒−푚푃 훾ሶ 푎푝푝 훾ሶ • We need the velocity gradients 1 휸ሶ = 훻퐮 + 훻푇퐮 2

• Using a finite differences approach (FDA) • Use the SPH gradient approach (SPH)

퐮푖푗퐱푖푗 훻퐮푖푗 = 2 훻퐮 = ෍ 푉 퐮 − 퐮 ∇ 푊 푥푖푗 푖 푗 푗 푖 푖 푖푗 푗 • Fast, but over dissipative (first order gradient) • Slow, but as accurate as your SPH scheme • Calculate on the fly • Pre-particle loop required

5th Dualsphysics Users Workshop 9 1 5 t h – 17th March 2021 Mathematical description of non-Newtonian flows

• Summarizing:

Two shear stress operators: Velocity gradients: • Morris operator for the Laplacian • Finite differences approach • SPH form of the shear stress • SPH gradient approach

Any possible combination implemented in DualSPHysics v5.0

Multi-phase non-Newtonian solver capabilities: • Newtonian • Non-Newtonian (dilatant-pseudoplastic) • Bingham (dilatant-pseudoplastic) • Bi-viscosity fluids • And any combination of the above

5th Dualsphysics Users Workshop 10 1 5 t h – 17th March 2021 Implementation

• The computational implementation is split below in the CPU and GPU variants: CPU files: GPU files:

• All code changes in the main (excluding non-Newtonian specific) files are marked with the comment: // • The name of the functions in CPU and GPU are identical

5th Dualsphysics Users Workshop 11 1 5 t h – 17th March 2021 Implementation

CPU version flow chart JSphCpu_NN_FDA/SPH::

Interaction_ForcesCpuT_NN_SPH void JSphCpuSingle::Run JSph:: InitMultiPhase InteractionForcesFluid_NN_SPH or FDA JSphCpu:: Interaction_Forces_ct GetStrainRateTensor_tsym GetStressTensor_sym

Template: Timestepping if(TVisco==VISCO_Artificial) if(TVisco==VISCO_LaminarSPS) if(TVisco==VISCO_ConstEq) Template: if(TVelGrad==VELGRAD_FDA) if(TVelGrad==VELGRAD_SPH)

5th Dualsphysics Users Workshop 12 1 5 t h – 17th March 2021 Implementation

GPU version flow chart JSphGpu_NN_ker::

Interaction_ForcesGpuT_NN_SPH void JSphGpuSingle::Run JSph:: InitMultiPhase InteractionForcesFluid_NN_SPH or FDA JSphGpu:: Interaction_Forces_ct GetStrainRateTensor_tsym GetStressTensor_sym

Template: Timestepping if(TVisco==VISCO_Artificial) if(TVisco==VISCO_LaminarSPS) if(TVisco==VISCO_ConstEq) Template: if(TVelGrad==VELGRAD_FDA) if(TVelGrad==VELGRAD_SPH)

5th Dualsphysics Users Workshop 13 1 5 t h – 17th March 2021 Implementation

• A compromise between computational efficiency and ease of development/modifications

• Hence, calculate many quantities which are not used but might be helpful to developers

• Main invariants and principal invariants are an example (for share rates and shear stress)

• Auxiliary arrays (aux) either for outputting directly from the code or store extra variables i.e., for outputting 휂푎푝푝

• CUDA kernels are split into two or more parts (for efficiency) to make the code readable/easy to change (see Interaction_Forces_NN_XX functions)

5th Dualsphysics Users Workshop 14 1 5 t h – 17th March 2021 Implementation

• Herschel-Bulkley-Papanastasiou constitutive equation

5th Dualsphysics Users Workshop 15 1 5 t h – 17th March 2021 Input configuration (xml file)

• “Special-nnphases” tag

5th Dualsphysics Users Workshop 16 1 5 t h – 17th March 2021 Input configuration (xml file)

• “Special-nnphases” phase tag

: The tag defines the density of the phase of the specific Mk (not recommended for density ratios higher than two).

: The tag defines the speed of sound for the phase to be used in the computation. Note that, the maximum speed of sound of all phases with be used in the time step CFL restriction whereas the phase specific speed of sound will be used in the equation of state (obtaining the pressure). Thus, the model is bounded by the maximum phase speed of sound. This parameter is optional, in this absence of this tag the speed of sound calculated by gencase will be used.

: The tag defines the polytropic index for the equation of state. This parameter is optional, in the absence of this tag the default polytropic index defined in tag will be used.

5th Dualsphysics Users Workshop 17 1 5 t h – 17th March 2021 Input configuration (xml file)

• “Special-nnphases” phase tag

: The tag defines the kinematic viscosity (or consistency index) of the phase. : The tag defines the specific yield stress of the material (τ/ρ) the fluid may experience before yielding. : The tag defines the Papanastasiou exponential stress growth of the fluid. A value of zero reduces the yield stress to zero (Newtonian), a value of the order of ten to pseudo-Bingham and order of 100 to Bingham. : The tag defines the Herschel-Buckley flow index. A value of one reduces the model to linear whereas a value smaller than one to shear thinning and greater that one to shear thickening fluid.

5th Dualsphysics Users Workshop 18 1 5 t h – 17th March 2021 Input configuration (xml file)

• “Special-nnphases” phase tag

: The tag defines the Bingham specific yield stress of the material (τ/ρ) the fluid may experience before yielding. : The tag defines the viscosity multiplier of a bi-viscosity model. This value multiplies the tau_max in the yielded region to avoid the singularity of the Bingham model.

Note, these two values are optional and should be used only if a Bingham model (or bi-visocity) is required, both tags must be present. Further, these two tags override the Papanastasiou value (HBP_m = 0).

5th Dualsphysics Users Workshop 19 1 5 t h – 17th March 2021 Examples

• Parameters

: The tag defines the rheology treatment is used. In the v5.0 version only option 1-2 Single and multi-phase is allowed.

: The tag defines which gradient formulation is used when calculating the velocity gradients.

: The tag defines which formulation is used when calculating the viscous forces. Three choices are available, artificial viscosity (Newtonian only), laminar viscous operator by Morris (1997) and the SPH constitutive equation.

: This tag defines a relaxation parameter for the viscous forces time step restriction in the form of 1 휆 = . 푅푒푙푎푥푎푡푖표푛퐷푡

5th Dualsphysics Users Workshop 20 1 5 t h – 17th March 2021 Examples

• Lock gate test case

5th Dualsphysics Users Workshop 21 1 5 t h – 17th March 2021 Examples

• Lock gate test case

5th Dualsphysics Users Workshop 22 1 5 t h – 17th March 2021 Examples • Impellers in a container

5th Dualsphysics Users Workshop 23 1 5 t h – 17th March 2021 Examples • Impellers in a container

5th Dualsphysics Users Workshop 24 1 5 t h – 17th March 2021 Examples

• Poiseuille flow

5th Dualsphysics Users Workshop 25 1 5 t h – 17th March 2021 Work in progress

DualSPHysics v 5.xx • Merging of the single and non-Newtonian solvers • Sediment phase with a yield criterion (see Fourtakas and Rogers, 2016, AWR)

DualSPHysics v 6.++ • Time dependant non-Newtonian models (watch this space) • Advanced multi-phase interface treatment (coming to your favourite SPH solver soon) • Semi-implicit time integration (if interested in co-development, contact me )

• Many other improvements for viscous terms, stability and accuracy of multi-phase flows

5th Dualsphysics Users Workshop 26 1 5 t h – 17th March 2021 Conclusions

• A general single and multi-phase solver ➢ Variety of choices and formulations • Applicable to a wide range of non-Newtonian fluids ➢ From Newtonian to bi-viscosity and dilatant fluids • CPU and GPU implementation • Balance between efficiency ➢ Usability for beginners/intermediate users ➢ Tools/customisation for developers • More developments on their way

5th Dualsphysics Users Workshop 27 1 5 t h – 17th March 2021 Acknowledgements

• Multi-phase branch developers

@SPH_Manchester @GFourtakas George Fourtakas Ben Rogers @benedictdrogers University of Manchester University of Manchester @DualSPHysics georgios.fourtakas-at- • Contributors manchester.ac.uk • Industrial contributors

Brendan Perry Jose Dominguez Renato Vacondio National Nuclear Laboratory University of Vigo University of Parma

5th Dualsphysics Users Workshop 28 1 5 t h – 17th March 2021