modelCentralSecondOrder

Information

CentralSecondOrder

This model expresses the second space derivative by finite differences being second order accurate. The mesh grid can be non uniform. The scheme used is central. The control volume is cell centered. As scheme is cell centered, the flux at boundaries are reconstruced. The diffused variable is u.

for an central scheme, the reconstruction of the first space derivative of u at the borders of the control volume derives:

For a non uniform grid cell centered, the location x for the flux reconstruction at borders of the control volume matches the edge of the mesh. However for boundary nodes, called ghost nodes, the value is vertex center because it would go over the domain otherwise. The scheme for expressing the first space derivative is respectively forward for the left side of the volume and backward for the right side.

As the time derivative and numerical solving are taken in charge by the modelica's solver, the numerical stability is not be guarranteed because Fourrier (Fo) number is not monitored and it is unknows where the solving uses implicit, explicit or hybrid method.
This model do not establish any equations for the boundary point (the red ones on the scheme above). It is the responsability of the user to supply these equations when model is inherited.

The model requires as input:

  • The N parameter: it the number of discrete layers. its value have to be ≥ 2
  • The CoeffTimeDer value: it is the coefficient for the time derivative (usually the density time the specific heat capacity for heat diffusion).
  • The CoeffSpaceDer value: it is the coefficient for the space derivative (usually the conductivity for heat diffusion).
  • The sourceTerm value: it is an array of the source therm with the same size of the number of nodes being 'N' .
  • The x value: it is an array with the size of the number of nodes being 'N+1'. If N is the number of segments, N+1 is the total number of edges.

Parameters

TypeNameDefaultDescription
IntegerN3Number of discrete layers
Modelica.SIunits.Position[N + 1]xPosition array

Components

TypeNameDefaultDescription
RealCoeffTimeDer1Coefficient for time derivative
RealCoeffSpaceDerCoefficient for space derivative
Real[N]SourceTermSource term in the right hand side
BooleanSteadyStatefalseSteady state mode
Realutransported variables. size = N + 2 for ghost nodes