FluidViscousStress[vars,pars,velocity]
yields fluid viscous stress with variables vars, parameters pars and fluid velocity velocity.
FluidViscousStress
FluidViscousStress[vars,pars,velocity]
yields fluid viscous stress with variables vars, parameters pars and fluid velocity velocity.
Details
- FluidViscousStress returns the viscous stress of a fluid.
- FluidViscousStress is an analysis function and typically used to compute the total stress a fluid exerts on its surroundings.
- Viscous stress is a measure of stress due to the fluid's viscosity.
- The momentum equation with fluid velocity
, pressure
, identity matrix
, density
, time
, external force
and viscous stress
is given by: - The viscous stress
is the sum of the total stress
and pressure
multiplied by the identity matrix
: - The viscous stress
with viscosity
and strain rate tensor
is given by: - FluidViscousStress effectively uses FluidViscosity to compute the viscosity
. - FluidViscousStress is similar to the elastic SolidMechanicsStress. Elastic stress is due to strain, and viscous stress is due to a strain rate, the rate of change of deformation.
- FluidViscousStress returns the viscous stress
from a velocity vector velocity with variables of
,
and
in units of [
], independent variables
in units of
and possibly time variable
in units of
. - Viscous stress has the unit of [
]. - FluidViscousStress uses the same variables vars specification as FluidFlowPDEComponent.
- FluidViscousStress uses the same parameter pars specification as FluidFlowPDEComponent.
- For dependent variables
,
and
given in vars, velocity components
,
and
need to be specified in velocity. - Typically, velocity is the result of solving a partial differential equation generated with FluidFlowPDEComponent.
- FluidViscousStress returns a SymmetrizedArray.
- FluidViscousStress supports non-Newtonian and custom viscous stress models. »
Examples
open all close allBasic Examples (2)
FluidViscousStress computes the viscous stress of a fluid velocity field:
FluidViscousStress[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"DynamicViscosity" -> μ|>, {𝒰[x, y], 𝒱[x, y]}]Normal[%]FluidViscousStress computes the viscous stress of a fluid specified through the Reynolds number
:
FluidViscousStress[{{u[x, y, z], v[x, y, z], w[x, y, z], p[x, y, z]}, {x, y, z}}, <|"ReynoldsNumber" -> ℛℯ|>, {𝒰[x, y, z], 𝒱[x, y, z], 𝒲[x, y, z]}]%//Normal//MatrixFormScope (7)
FluidViscousStress computes the viscous stress of a time-dependent fluid velocity field:
FluidViscousStress[{{u[t, x, y], v[t, x, y], p[t, x, y]}, t, {x, y}}, <|"MassDensity" -> ρ, "DynamicViscosity" -> μ|>, {𝒰[t, x, y], 𝒱[t, x, y]}]Normal[%]FluidViscousStress supports axisymmetric flow:
FluidViscousStress[{{r[r, z], 0, z[r, z], p[r, z]}, {r, θ, z}}, <|"ReynoldsNumber" -> ℛℯ, "RegionSymmetry" -> "Axisymmetric"|>, {ℛ[r, z], 0, 𝒵[r, z]}]%//Normal//MatrixFormFluidViscousStress computes the viscous stress of a 3D velocity field:
FluidViscousStress[{{u[x, y, z], v[x, y, z], w[x, y, z], p[x, y, z]}, {x, y, z}}, <|"MassDensity" -> ρ, "DynamicViscosity" -> μ|>, {𝒰[x, y, z], 𝒱[x, y, z], 𝒲[x, y, z]}]%//Normal//MatrixFormFluidViscousStress supports cylindrical coordinates:
FluidViscousStress[{{u[r, θ, z], v[r, θ, z], w[r, θ, z], p[r, θ, z]}, {r, θ, z}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ, "CoordinateChart" -> "Cylindrical"|>, {𝒰[r, θ, z], 𝒱[r, θ, z], 𝒲[r, θ, z]}]%//Normal//MatrixFormFind the viscous stress of a non-Newtonian fluid:
FluidViscousStress[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"MassDensity" -> ρ, "FluidDynamicsMaterialModel" -> <|"PowerLaw" -> <|"Exponent" -> n, "MinimalShearRate" -> Subscript[Overscript[γ, .], min], "ReferenceShearRate" -> Subscript[Overscript[γ, .], ref], "PowerLawViscosity" -> m|>|>|>, {𝒰[t, x, y], 𝒱[t, x, y]}]%//Normal//MatrixFormPressure may be an element of the velocity list but is not considered:
FluidViscousStress[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"ReynoldsNumber" -> ℛℯ|>, {𝒰[x, y], 𝒱[x, y], 𝒫[x, y]}]Check that the viscous stress is free of the pressure:
FreeQ[%, 𝒫[x, y]]%%//NormalHaving the pressure in the velocity list is convenient such that the result of a FluidFlowPDEComponent simulation can directly be used. Set up the variables and parameters:
vars = {{u[x, y], v[x, y], p[x, y]}, {x, y}};
pars = <|"ReynoldsNumber" -> 1000|>;Solve the fluid flow equations:
fluidFlowSolution = NDSolveValue[{FluidFlowPDEComponent[vars, pars] == {0, 0, 0}, DirichletCondition[{u[x, y] == 1, v[x, y] == 0}, y == 1], DirichletCondition[{u[x, y] == 0, v[x, y] == 0}, y < 1], DirichletCondition[p[x, y] == 0, x == 0 && y == 0]}, {u[x, y], v[x, y], p[x, y]}, {x, y}∈Rectangle[{0, 0}, {1, 1}], Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}]Compute the viscous stress from the complete fluid flow solution:
FluidViscousStress[vars, pars, fluidFlowSolution]Applications (3)
Compute the total stress of the fluid flow of a non-Newtonian fluid in an opening channel by using the power law fluid flow model.
Ω = RegionUnion[Rectangle[{0, -1 / 2}, {5, 1 / 2}], Rectangle[{5, -3 / 2}, {30, 3 / 2}]];Set up variables, flow parameters and the non-Newtonian power law for parameters for the exponent and power law viscosity:
vars = {{u[x, y], v[x, y], p[x, y]}, {x, y}};
pars = <|"MassDensity" -> 1, "FluidDynamicsMaterialModel" -> <|"PowerLaw" -> <|"PowerLawExponent" -> 1 / 2, "PowerLawViscosity" -> 0.008838835|>|>
|>;Solve the PDE with an inflow profile given as {1/2,0} and with the outflow pressure set to 0. The walls are set up as no-slip walls:
{uVel, vVel, pressure} = NDSolveValue[{FluidFlowPDEComponent[vars, pars] == {0, 0, 0}, DirichletCondition[
{u[x, y] == 1 / 2, v[x, y] == 0}, x == 0], DirichletCondition[{u[x, y] == 0, v[x, y] == 0}, 0 < x < 30],
DirichletCondition[p[x, y] == 0, x == 30]}, vars[[1]], {x, y}∈Ω, Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}]viscousStress = FluidViscousStress[vars, pars, {uVel, vVel}]Visualize the norm of the viscous stress:
ContourPlot[Norm[viscousStress, "Frobenius"], {x, y}∈Ω, PlotRange -> All, PlotLegends -> Automatic]totalStress = -pressure * IdentityMatrix[2] + viscousStressVisualize the norm of the total stress:
ContourPlot[Norm[totalStress, "Frobenius"], {x, y}∈Ω, PlotRange -> All, PlotLegends -> Automatic]Compute the viscous stress of a non-Newtonian fluid flow modeled with a custom power-law model implemented as custom viscosity. Define the custom apparent viscosity function:
apparentViscosity[vars_, pars_, data_] := Module[{strainRate, shearRate, viscosity, exponent}, viscosity = pars["FluidDynamicsMaterialModel"]["Custom"]["viscosity"];
exponent = pars["FluidDynamicsMaterialModel"]["Custom"]["exponent"];
strainRate = "StrainRate" /. data;
shearRate = Sqrt[2 * ArrayDot[strainRate, strainRate, 2]];
viscosity * (shearRate) ^ (exponent - 1)]vars = {{u[x, y], v[x, y], p[x, y]}, {x, y}};pars = <|"MassDensity" -> 1, "FluidDynamicsMaterialModel" -> <|"Custom" -> <|"ApparentViscosityFunction" -> apparentViscosity, "viscosity" -> m, "exponent" -> n|>|>|>;Compute the apparent viscosity:
FluidViscousStress[vars, pars, {𝒰[x, y], 𝒱[x, y]}]%//Normal//MatrixFormCompute the viscous stress of a non-Newtonian fluid flow modeled with a custom power-law model implemented as a custom viscous stress tensor. Define the custom apparent viscosity function:
viscousStress[vars_, pars_, data_] := Module[{strainRate, shearRate, viscosity, exponent, apparentViscosity}, viscosity = pars["viscosity"];
exponent = pars["exponent"];
strainRate = "StrainRate" /. data;
shearRate = Sqrt[2 * ArrayDot[strainRate, strainRate, 2]];
apparentViscosity = viscosity * (shearRate) ^ (exponent - 1);
2 * apparentViscosity * strainRate]vars = {{u[x, y], v[x, y], p[x, y]}, {x, y}};pars = <|"MassDensity" -> 1, "FluidDynamicsMaterialModelFunction" -> viscousStress, "viscosity" -> m, "exponent" -> n|>;Compute the apparent viscosity:
stress = FluidViscousStress[vars, pars, {𝒰[x, y], 𝒱[x, y]}]stress//Normal//MatrixFormCompare the result with the custom function:
strainRate = 1 / 2 * (Grad[{𝒰[x, y], 𝒱[x, y]}, {x, y}] + Transpose[Grad[{𝒰[x, y], 𝒱[x, y]}, {x, y}]]);
stress == viscousStress[{{𝒰[x, y], 𝒱[x, y], 𝒫[x, y]}, {x, y}}, pars, "StrainRate" -> strainRate]See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2026), FluidViscousStress, Wolfram Language function, https://reference.wolfram.com/language/ref/FluidViscousStress.html.
CMS
Wolfram Language. 2026. "FluidViscousStress." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FluidViscousStress.html.
APA
Wolfram Language. (2026). FluidViscousStress. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FluidViscousStress.html
BibTeX
@misc{reference.wolfram_2026_fluidviscousstress, author="Wolfram Research", title="{FluidViscousStress}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/FluidViscousStress.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_fluidviscousstress, organization={Wolfram Research}, title={FluidViscousStress}, year={2026}, url={https://reference.wolfram.com/language/ref/FluidViscousStress.html}, note=[Accessed: 12-June-2026]}