Arcane  4.1.15.0
User documentation
Loading...
Searching...
No Matches
MicroHydroModule Class Reference

#include <tutorial/microhydro/MicroHydroModule.h>

Public Member Functions

 MicroHydroModule (const ModuleBuildInfo &mbi)
 ~MicroHydroModule ()
virtual void hydroStartInit ()
virtual void computePressureForce ()
virtual void computeVelocity ()
virtual void applyBoundaryCondition ()
virtual void moveNodes ()
virtual void computeGeometricValues ()
virtual void updateDensity ()
virtual void applyEquationOfState ()
virtual void computeDeltaT ()
virtual VersionInfo versionInfo () const

Detailed Description

Represents a highly simplified Lagrangian hydrodynamics module:

  • the only supported cell type is the hexahedron,
  • no pseudo-viscosity supported,
  • the only supported characteristic length calculation type is the one using medians,
  • the only supported boundary condition type is imposing a velocity component on a surface,
  • the nodal mass is assumed constant and is not recalculated at each iteration,
  • no value consistency test (positive pressure, positive volume, ...) is performed.

The list of operations performed by the module is as follows:

  • calculation of pressure forces,
  • calculation of momentum,
  • taking into account boundary conditions,
  • node displacement,
  • calculation of new geometric values: cell volume, cell characteristic length, resultant forces at the vertices of each cell,
  • calculation of density,
  • calculation of pressure and energy using the equation of state. This calculation is performed by an ARCANE service. Two implementations are available for the service: perfect gas, and "stiffened" gas.
  • calculation of the new time step.

Definition at line 30 of file MicroHydroModule.h.

Constructor & Destructor Documentation

◆ MicroHydroModule()

MicroHydroModule::MicroHydroModule ( const ModuleBuildInfo & mbi)
inline

Class constructor

Definition at line 35 of file MicroHydroModule.h.

◆ ~MicroHydroModule()

MicroHydroModule::~MicroHydroModule ( )
inline

Class destructor

Definition at line 38 of file MicroHydroModule.h.

Member Function Documentation

◆ applyBoundaryCondition()

void MicroHydroModule::applyBoundaryCondition ( )
virtual

Applies the boundary conditions. Boundary conditions depend on the dataset options. In this implementation, a boundary condition has the following properties:

  • a type: three types are supported: constraining the \(x\) component of the velocity vector, constraining the \(y\) component of the velocity vector, or constraining the \(z\) component of the velocity vector,
  • a value: this is a real number indicating the value of the constraint,
  • a surface: this is the surface on which the constraint applies.

Applying boundary conditions therefore consists of fixing a component of a velocity vector for every node of every face of every surface on which a boundary condition is imposed.

Definition at line 86 of file MicroHydroModule.cc.

References ENUMERATE_FACE, Arcane::ItemWithNodes::nbNode(), Arcane::ItemWithNodes::node(), TypesMicroHydro::Unknown, TypesMicroHydro::VelocityX, TypesMicroHydro::VelocityY, TypesMicroHydro::VelocityZ, Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.

◆ applyEquationOfState()

void MicroHydroModule::applyEquationOfState ( )
virtual

This entry point calculates the internal energy, pressure, and speed of sound within the cell by calling the equation of state service.

Definition at line 215 of file MicroHydroModule.cc.

References ENUMERATE_CELL.

◆ computeDeltaT()

void MicroHydroModule::computeDeltaT ( )
virtual

Determines the time step value for the next iteration. The time step is constrained by:

  • the CFL value,
  • the deltatMin() and deltatMax() values of the dataset,
  • the final time value. During the last iteration, the time step must be such that we stop exactly at the time specified in the dataset (finalTime()).

Definition at line 236 of file MicroHydroModule.cc.

References ENUMERATE_CELL, and Arcane::Parallel::ReduceMin.

◆ computeGeometricValues()

void MicroHydroModule::computeGeometricValues ( )
virtual

This entry point groups all the geometric calculations useful for the scheme. In our case, this involves for each cell:

  • calculating its characteristic length,
  • calculating the resultant forces at its vertices,
  • calculating its volume.

To optimize the calculation (cache usage), during each iteration on a cell, the coordinates of its nodes and those of the center of its faces are stored locally.

Definition at line 141 of file MicroHydroModule.cc.

References Arcane::Real3::abs(), ENUMERATE_CELL, Arcane::ItemWithNodes::nodes(), and Arcane::math::scaMul().

Referenced by hydroStartInit().

◆ computePressureForce()

void MicroHydroModule::computePressureForce ( )
virtual

Calculates the contribution of pressure forces per node at the current time \(t^{n}\). For each node of each cell, this is the pressure multiplied by the resultant force at that node. Calculates the pressure forces at the current time \(t^{n}\).

Definition at line 48 of file MicroHydroModule.cc.

References ENUMERATE_CELL, and Arcane::ItemWithNodes::nodes().

◆ computeVelocity()

void MicroHydroModule::computeVelocity ( )
virtual

Calculates the force (m_force) applied to the nodes by adding the possible contribution of pseudo-viscosity. Then calculates the new velocity (m_velocity) at the nodes.

Definition at line 67 of file MicroHydroModule.cc.

References ENUMERATE_NODE.

◆ hydroStartInit()

void MicroHydroModule::hydroStartInit ( )
virtual

Initializes the module. The initialization consists of two distinct parts:

  • the first part where the size of the array variables must be specified. In our case, these are m_cell_cqs and m_viscosity_force, both of which are cell variables possessing a value for every node of every cell. Since we only support hexahedrons, there are 8 values per cell,
  • the second part which consists of initializing the variables with their starting value. For the variables Pressure, Density, and AdiabaticCst, ARCANE initializes them directly from the dataset. The NodeCoord variable is also initialized by the architecture when reading the mesh. The other variables are calculated as follows:
    • the initial time step is given by the dataset,
    • the geometric values (characteristic length, volume, and resultant forces at the vertices) are calculated from the node coordinates,
    • the cell mass is calculated from its density andvolume,
    • the cell mass and nodal mass. A cell's mass is calculated from its density and volume,
    • the nodal mass is calculated by adding the contributions of each cell connected to a given node. Each cell contributes 1/8th of its mass to the nodal mass of each of its vertices,
    • the internal energy and the speed of sound are calculated based on the equation of state.

Definition at line 13 of file MicroHydroModule.cc.

References computeGeometricValues(), ENUMERATE_CELL, and Arcane::ItemWithNodes::nodes().

◆ moveNodes()

void MicroHydroModule::moveNodes ( )
virtual

Modifies the coordinates (m_node_coord) of the nodes based on the velocity vector and the time step.

Definition at line 128 of file MicroHydroModule.cc.

References ENUMERATE_NODE.

◆ updateDensity()

void MicroHydroModule::updateDensity ( )
virtual

Calculates the new value of the cell density, assuming that the mass of a cell is constant over time. In this case, the new density is equal to the mass divided by the new volume.

Definition at line 199 of file MicroHydroModule.cc.

References ENUMERATE_CELL.

◆ versionInfo()

virtual VersionInfo MicroHydroModule::versionInfo ( ) const
inlinevirtual

Returns the version number of the module

Definition at line 142 of file MicroHydroModule.h.


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