Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
log-conform.h File Reference
#include "bcg.h"
Include dependency graph for log-conform.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pseudo_v
 
struct  pseudo_t
 

Functions

void event_defaults (void)
 Event: defaults (i = 0)
 
static void diagonalization_2D (pseudo_v *Lambda, pseudo_t *R, pseudo_t *A)
 
void event_tracer_advection (void)
 The stress tensor depends on previous instants and has to be integrated in time.
 
void event_acceleration (void)
 Event: acceleration (i++)
 

Variables

const scalar lambda [] = 1.
 
const scalar mup [] = 1.
 
void(* f_s )(double, double *, double *) = NULL
 Constitutive models other than Oldroyd-B (the default) are defined through the two functions \(\mathbf{f}_s (\mathbf{A})\) and \(\mathbf{f}_r (\mathbf{A})\).
 
void(* f_r )(double, double *, double *) = NULL
 
symmetric tensor tau_p []
 
const scalar trA [] = 0.
 

Function Documentation

◆ diagonalization_2D()

static void diagonalization_2D ( pseudo_v Lambda,
pseudo_t R,
pseudo_t A 
)
static

The eigenvalues are saved in vector \(\Lambda\) computed from the trace and the determinant of the symmetric conformation tensor \(\mathbf{A}\).

The eigenvectors, \(\mathbf{v}_i\) are saved by columns in tensor \(\mathbf{R} = (\mathbf{v}_1|\mathbf{v}_2)\).

Definition at line 192 of file log-conform.h.

References A, D, dimension, i, s, sq(), T, vector::x, x, pseudo_v::x, and pseudo_t::x.

Referenced by event_tracer_advection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ event_acceleration()

void event_acceleration ( void  )

Event: acceleration (i++)

Divergence of the viscoelastic stress tensor

The viscoelastic stress tensor \(\mathbf{\tau}_p\) is defined at cell centers while the corresponding force (acceleration) will be defined at cell faces. Two terms contribute to each component of the momentum equation. For example the \(x\)-component in Cartesian coordinates has the following terms: \(\partial_x \mathbf{\tau}_{p_{xx}} + \partial_y \mathbf{\tau}_{p_{xy}}\). The first term is easy to compute since it can be calculated directly from center values of cells sharing the face. The other one is harder. It will be computed from vertex values. The vertex values are obtained by averaging centered values. Note that as a result of the vertex averaging cells [] and [-1,0] are not involved in the computation of shear.

Definition at line 526 of file log-conform.h.

References _i, a, alpha, av, cm, fm, sq(), tau_p, vector::x, tensor::x, x, vector::y, and y.

Here is the call graph for this function:

◆ event_defaults()

void event_defaults ( void  )

Event: defaults (i = 0)

Boundary conditions for VOF-advected tracers usually depend on boundary conditions for the VOF field.

Event: defaults (i = 0)

Event: defaults (i = 0)

Initialisation

We set the default values.

Electrohydrodynamic stresses

The EHD force density, \(\mathbf{f}_e\), can be computed as the divergence of the Maxwell stress tensor \(\mathbf{M}\),

\[ M_{ij} = \varepsilon (E_i E_j - \frac{E^2}{2}\delta_{ij}) \]

where \(E_i\) is the \(i\)-component of the electric field, \(\mathbf{E}=-\nabla \phi\) and \(\delta_{ij}\) is the Kronecker delta.

We need to add the corresponding acceleration to the Navier–Stokes solver.

If the acceleration vector a (defined by the Navier–Stokes solver) is constant, we make it variable.

Event: defaults (i = 0)

Event: defaults (i = 0 )

Defaults

On trees we need to ensure conservation of the tracer when refining/coarsening.

Event: defaults (i = 0)

it is an acceleration. If necessary, we allocate a new vector field to store it.

Event: defaults (i = 0)

Event: defaults (i = 0)

\[ \begin{aligned} 0 & = - \sum_k \nabla \cdot [\theta_H (hu)_k^{n + 1} + (1 - \theta_H) (hu)^n_k] \\ \frac{(hu)^{n + 1}_k - (hu)_k^n}{\Delta t} & = - \Delta tgh^{n + 1 / 2}_k (\theta_H \nabla \eta_r^{n + 1} + (1 - \theta_H) \nabla \eta_r^n) \end{aligned} \]

where \(\eta_r\) is the equivalent free-surface height (i.e. pressure) applied on the rigid lid.

Event: defaults (i = 0)

Setup

The \(w_k\) and \(\phi_k\) scalar fields are allocated and the \(w_k\) are added to the list of advected tracers.

Boundary conditions

By default we set a zero Neumann boundary condition for all the components except if the bottom is an axis of symmetry.

Definition at line 145 of file log-conform.h.

References _i, a, dimension, f_r, f_s, scalar::i, left, periodic_bc(), s, tau_p, trA, vector::x, tensor::x, x, and vector::y.

Here is the call graph for this function:

◆ event_tracer_advection()

void event_tracer_advection ( void  )

The stress tensor depends on previous instants and has to be integrated in time.

In the log-conformation scheme the advection of the stress tensor is circumvented, instead the conformation tensor, \(\mathbf{A}\) (or more precisely the related variable \(\Psi\)) is advanced in time.

In what follows we will adopt a scheme similar to that of Hao & Pan (2007). We use a split scheme, solving successively

a) the upper convective term:

\[ \partial_t \Psi = 2 \mathbf{B} + (\Omega \cdot \Psi -\Psi \cdot \Omega) \]

b) the advection term:

\[ \partial_t \Psi + \nabla \cdot (\Psi \mathbf{u}) = 0 \]

c) the model term (but set in terms of the conformation tensor \(\mathbf{A}\)). In an Oldroyd-B viscoelastic fluid, the model is

\[ \partial_t \mathbf{A} = -\frac{\mathbf{f}_r (\mathbf{A})}{\lambda} \]

The implementation below assumes that the values of \(\Psi\) and \(\tau_p\) are never needed simultaneously. This means that \(\tau_p\) can be used to store (temporarily) the values of \(\Psi\) (i.e. \(\Psi\) is just an alias for \(\tau_p\)).

Event: tracer_advection (i++)

Computation of \f$\Psi = \log \mathbf{A}\f$ and upper convective term

We assume that the stress tensor \(\mathbf{\tau}_p\) depends on the conformation tensor \(\mathbf{A}\) as follows

\[ \mathbf{\tau}_p = \frac{\mu_p}{\lambda} f_s (\mathbf{A}) = \frac{\mu_p}{\lambda} \eta (\nu \mathbf{A} - I) \]

In most of the viscoelastic models, \(\nu\) and \(\eta\) are nonlinear parameters that depend on the trace of the conformation tensor, \(\mathbf{A}\).

In the axisymmetric case, \(\Psi_{\theta \theta} = \log A_{\theta \theta}\). Therefore \(\Psi_{\theta \theta} = \log [ ( 1 + fa \tau_{p_{\theta \theta}})/\nu]\).

The conformation tensor is diagonalized through the eigenvector tensor \(\mathbf{R}\) and the eigenvalues diagonal tensor, \(\Lambda\).

\(\Psi = \log \mathbf{A}\) is easily obtained after diagonalization, \(\Psi = R \cdot \log(\Lambda) \cdot R^T\).

We now compute the upper convective term \(2 \mathbf{B} + (\Omega \cdot \Psi -\Psi \cdot \Omega)\).

The diagonalization will be applied to the velocity gradient $(\nabla u)^T$ to obtain the antisymmetric tensor \(\Omega\) and the traceless, symmetric tensor, \(\mathbf{B}\). If the conformation tensor is \(\mathbf{I}\), \(\Omega = 0\) and \(\mathbf{B}= \mathbf{D}\).

We now advance \(\Psi\) in time, adding the upper convective contribution.

In the axisymmetric case, the governing equation for \(\Psi_{\theta \theta}\) only involves that component,

\[ \Psi_{\theta \theta}|_t - 2 L_{\theta \theta} = \frac{\mathbf{f}_r(e^{-\Psi_{\theta \theta}})}{\lambda} \]

with \(L_{\theta \theta} = u_y/y\). Therefore step (a) for \(\Psi_{\theta \theta}\) is

Advection of \f$\Psi\f$

We proceed with step (b), the advection of the log of the conformation tensor \(\Psi\).

Model term

If \(\lambda = 0\) the stress tensor for the polymeric part reduces to that of a Newtonian fluid \(\mathbf{\tau}_p = 2 \mu_p \mathbf{D}\) with \(\mathbf{D}\) the rate-of-strain tensor. Note that \(\mathbf{\tau}_p\) is in this case independent of time.

It is time to undo the log-conformation, again by diagonalization, to recover the conformation tensor \(\mathbf{A}\) and to perform step (c).

We perform now step (c) by integrating \(\mathbf{A}_t = -\mathbf{f}_r (\mathbf{A})/\lambda\) to obtain \(\mathbf{A}^{n+1}\). This step is analytic,

\[ \int_{t^n}^{t^{n+1}}\frac{d \mathbf{A}}{\mathbf{I}- \nu \mathbf{A}} = \frac{\eta \, \Delta t}{\lambda} \]

The trace at time \(n+1\) is also needed for some models.

Then the stress tensor \(\mathbf{\tau}_p^{n+1}\) is computed from \(\mathbf{A}^{n+1}\) according to the constitutive model, \(\mathbf{f}_s(\mathbf{A})\).

Definition at line 259 of file log-conform.h.

References _i, A, advection(), diagonalization_2D(), dimension, dt, eta, f_r, f_s, lambda, mup, nu, omega, s, sq(), t, tau_p, trA, u, uf, vector::x, tensor::x, x, pseudo_v::x, pseudo_t::x, vector::y, y, pseudo_v::y, and pseudo_t::y.

Here is the call graph for this function:

Variable Documentation

◆ f_r

void(* f_r) (double, double *, double *) ( double  ,
double ,
double  
) = NULL

Definition at line 76 of file log-conform.h.

Referenced by event_defaults(), and event_tracer_advection().

◆ f_s

void(* f_s) (double, double *, double *) ( double  ,
double ,
double  
) = NULL

Constitutive models other than Oldroyd-B (the default) are defined through the two functions \(\mathbf{f}_s (\mathbf{A})\) and \(\mathbf{f}_r (\mathbf{A})\).

Definition at line 75 of file log-conform.h.

Referenced by event_defaults(), and event_tracer_advection().

◆ lambda

const scalar lambda[] = 1.

The log-conformation method for some viscoelastic constitutive models

Introduction

Viscoelastic fluids exhibit both viscous and elastic behaviour when subjected to deformation. Therefore these materials are governed by the Navier–Stokes equations enriched with an extra elastic stress \(\mathbf{\tau}_p\)

\[ \rho\left[\partial_t\mathbf{u}+\nabla\cdot(\mathbf{u}\otimes\mathbf{u})\right] = - \nabla p + \nabla\cdot(2\mu_s\mathbf{D}) + \nabla\cdot\mathbf{\tau}_p + \rho\mathbf{a} \]

where \(\mathbf{D}=[\nabla\mathbf{u} + (\nabla\mathbf{u})^T]/2\) is the deformation tensor and \(\mu_s\) is the solvent viscosity of the viscoelastic fluid.

The polymeric stress \(\mathbf{\tau}_p\) represents memory effects due to the polymers. Several constitutive rheological models are available in the literature where the polymeric stress \(\mathbf{\tau}_p\) is typically a function \(\mathbf{f_s}(\cdot)\) of the conformation tensor \(\mathbf{A}\) such as

\[ \mathbf{\tau}_p = \frac{\mu_p \mathbf{f_s}(\mathbf{A})}{\lambda} \]

where \(\lambda\) is the relaxation parameter and \(\mu_p\) is the polymeric viscosity.

The conformation tensor \(\mathbf{A}\) is related to the deformation of the polymer chains. \(\mathbf{A}\) is governed by the equation

\[ D_t \mathbf{A} - \mathbf{A} \cdot \nabla \mathbf{u} - \nabla \mathbf{u}^{T} \cdot \mathbf{A} = -\frac{\mathbf{f_r}(\mathbf{A})}{\lambda} \]

where \(D_t\) denotes the material derivative and \(\mathbf{f_r}(\cdot)\) is the relaxation function.

In the case of an Oldroyd-B viscoelastic fluid, \(\mathbf{f}_s (\mathbf{A}) = \mathbf{f}_r (\mathbf{A}) = \mathbf{A} -\mathbf{I}\), and the above equations can be combined to avoid the use of \(\mathbf{A}\)

\[ \mathbf{\tau}_p + \lambda (D_t \mathbf{\tau}_p - \mathbf{\tau}_p \cdot \nabla \mathbf{u} - \nabla \mathbf{u}^{T} \cdot \mathbf{\tau}_p) = 2 \mu_p \mathbf{D} \]

Comminal et al. (2015) gathered the functions \(\mathbf{f}_s (\mathbf{A})\) and \(\mathbf{f}_r (\mathbf{A})\) for different constitutive models. In the present library we have implemented the Oldroyd-B model and the related FENE-P model for which

\[ \mathbf{f}_s (\mathbf{A}) = \mathbf{f}_r (\mathbf{A}) = \frac{\mathbf{A}}{1-Tr(\mathbf{A})/L^2} -\mathbf{I} \]

Parameters

The primary parameters are the retardation or relaxation time \(\lambda\) and the polymeric viscosity \(\mu_p\). The solvent viscosity \(\mu_s\) is defined in the Navier-Stokes solver.

Definition at line 67 of file log-conform.h.

Referenced by event_tracer_advection().

◆ mup

const scalar mup[] = 1.

Definition at line 68 of file log-conform.h.

Referenced by event_tracer_advection().

◆ tau_p

symmetric tensor tau_p[]

The log conformation approach

The numerical resolution of viscoelastic fluid problems often faces the High-Weissenberg Number Problem. This is a numerical instability appearing when strongly elastic flows create regions of high stress and fine features. This instability poses practical limits to the values of the relaxation time of the viscoelastic fluid, \(\lambda\). Fattal & Kupferman (2004, 2005) identified the exponential nature of the solution as the origin of the instability. They proposed to use the logarithm of the conformation tensor \(\Psi = \log \, \mathbf{A}\) rather than the viscoelastic stress tensor to circumvent the instability.

The constitutive equation for the log of the conformation tensor is

\[ D_t \Psi = (\Omega \cdot \Psi -\Psi \cdot \Omega) + 2 \mathbf{B} + \frac{e^{-\Psi} \mathbf{f}_r (e^{\Psi})}{\lambda} \]

where \(\Omega\) and \(\mathbf{B}\) are tensors that result from the decomposition of the transpose of the tensor gradient of the velocity

\[ (\nabla \mathbf{u})^T = \Omega + \mathbf{B} + N \mathbf{A}^{-1} \]

The antisymmetric tensor \(\Omega\) requires only the memory of a scalar in 2D since,

\[ \Omega = \left( \begin{array}{cc} 0 & \Omega_{12} \\ -\Omega_{12} & 0 \end{array} \right) \]

The log-conformation tensor, \(\Psi\), is related to the polymeric stress tensor \(\mathbf{\tau}_p\), by the strain function \(\mathbf{f}_s (\mathbf{A})\)

\[ \Psi = \log \, \mathbf{A} \quad \mathrm{and} \quad \mathbf{\tau}_p = \frac{\mu_p}{\lambda} \mathbf{f}_s (\mathbf{A}) \]

where \(Tr\) denotes the trace of the tensor and \(L\) is an additional property of the viscoelastic fluid.

We will use the Bell–Collela–Glaz scheme to advect the log-conformation tensor \(\Psi\).

Variables

The main variable will be the stress tensor \(\mathbf{\tau}_p\). The trace of the conformation tensor, \(\mathbf{A}\), is often necessary for constitutive viscoelastic models other than Oldroyd-B.

Definition at line 138 of file log-conform.h.

Referenced by event_acceleration(), event_defaults(), and event_tracer_advection().

◆ trA

const scalar trA[] = 0.

Definition at line 142 of file log-conform.h.

Referenced by event_defaults(), event_init(), event_tracer_advection(), and fenep().