OpenMD 3.2
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::VelocityField Class Reference

A linear (homogeneous) ambient velocity field, v(r) = v0 + K . r. More...

#include <VelocityField.hpp>

Public Member Functions

 VelocityField (SimInfo *info)
bool isActive () const
 true when a valid velocityField{} block was supplied
Vector3d getVelocity (const Vector3d &r) const
 ambient velocity at position r: v0 + K . r
const Mat3x3d & getVelocityGradient () const
 constant velocity gradient, K_ij = d v_i / d r_j
const Mat3x3d & getRateOfStrain () const
 rate-of-strain tensor E = sym(K) (the constant-stress part)
const Mat3x3d & getSpin () const
 spin tensor W = antisym(K)
const Vector3d & getVorticity () const
 vorticity vector, omega = curl v (the constant-vorticity part)
Vector3d getAngularVelocity () const
 angular velocity an immersed sphere co-rotates with, omega / 2
const Vector3d & getBackgroundVelocity () const
 uniform background velocity v0

Detailed Description

A linear (homogeneous) ambient velocity field, v(r) = v0 + K . r.

Built from a velocityField{ ... } block. The velocity gradient \( K_{ij} = \partial v_i / \partial r_j \) is assembled from an optional constant-stress (rate-of-strain) part and an optional constant-vorticity part:

\( \mathsf{K} = \mathsf{E} + \mathsf{W}, \qquad \mathsf{E} = \mathrm{sym}(\mathsf{K}), \quad \mathsf{W} = \mathrm{antisym}(\mathsf{K}). \)

Unlike the electric-field gradient in UniformGradient (which Laplace's equation forces to be symmetric and traceless), K carries an independent antisymmetric part. Because E is built traceless and W is antisymmetric, this decomposed field is divergence-free by construction (incompressible, \(\nabla\cdot\mathbf{v}=0\)).

This is a passive object: it is queried by the (Langevin / hydrodynamic) integrator rather than registered as a ForceModifier. Accessors expose the quantities the mobility coupling consumes: the ambient velocity (leading drag), the rate of strain (stresslet), and the vorticity / co-rotation rate (rotational coupling). Since the flow is linear, \(\nabla^2\mathbf{v}=0\) and the a^2/6 Faxen term vanishes identically.

The velocity field can be applied by specifying one of these blocks in the omd file:

// pure planar/uniaxial extension along x
velocityField {
useVelocityField = true;
strainRate = 1.0e-3; // fs^-1
strainDirection1 = (1, 0, 0);
strainDirection2 = (1, 0, 0);
}
// rigid rotation about z (vorticity only)
velocityField {
useVelocityField = true;
vorticity = (0, 0, 2.0e-3); // fs^-1
}
// background velocity field
velocityField {
useVelocityField = true;
backgroundVelocity = (0, 0, 1.0e-4); // Angstrom fs^-1
}
// simple shear v_x = gammaDot * y (equal strain + vorticity)
velocityField {
useVelocityField = true;
strainRate = 1.0e-3;
strainDirection1 = (1, 0, 0);
strainDirection2 = (0, 1, 0);
vorticity = (0, 0, -1.0e-3);
}

This last block is important: simple shear is not a pure strain or pure vorticity state — it's \( K_{xy} = \) split as \(E_{xy} = \dot{\gamma} / 2 \) plus \( \omega = -\dot{\gamma} \), which is why both strain and vorticity appear.

Definition at line 126 of file VelocityField.hpp.

Constructor & Destructor Documentation

◆ VelocityField()

OpenMD::VelocityField::VelocityField ( SimInfo * info)
explicit

Definition at line 54 of file VelocityField.cpp.

Member Function Documentation

◆ getAngularVelocity()

Vector3d OpenMD::VelocityField::getAngularVelocity ( ) const
inline

angular velocity an immersed sphere co-rotates with, omega / 2

Definition at line 149 of file VelocityField.hpp.

◆ getBackgroundVelocity()

const Vector3d & OpenMD::VelocityField::getBackgroundVelocity ( ) const
inline

uniform background velocity v0

Definition at line 152 of file VelocityField.hpp.

◆ getRateOfStrain()

const Mat3x3d & OpenMD::VelocityField::getRateOfStrain ( ) const
inline

rate-of-strain tensor E = sym(K) (the constant-stress part)

Definition at line 140 of file VelocityField.hpp.

◆ getSpin()

const Mat3x3d & OpenMD::VelocityField::getSpin ( ) const
inline

spin tensor W = antisym(K)

Definition at line 143 of file VelocityField.hpp.

◆ getVelocity()

Vector3d OpenMD::VelocityField::getVelocity ( const Vector3d & r) const
inline

ambient velocity at position r: v0 + K . r

Definition at line 134 of file VelocityField.hpp.

◆ getVelocityGradient()

const Mat3x3d & OpenMD::VelocityField::getVelocityGradient ( ) const
inline

constant velocity gradient, K_ij = d v_i / d r_j

Definition at line 137 of file VelocityField.hpp.

◆ getVorticity()

const Vector3d & OpenMD::VelocityField::getVorticity ( ) const
inline

vorticity vector, omega = curl v (the constant-vorticity part)

Definition at line 146 of file VelocityField.hpp.

◆ isActive()

bool OpenMD::VelocityField::isActive ( ) const
inline

true when a valid velocityField{} block was supplied

Definition at line 131 of file VelocityField.hpp.


The documentation for this class was generated from the following files: