Implements the analytical solution engine for initializing or driving the simulation. More...
Go to the source code of this file.
Macros | |
| #define | __FUNCT__ "SetAnalyticalGridInfo" |
| #define | __FUNCT__ "AnalyticalSolutionEngine" |
| #define | __FUNCT__ "SetAnalyticalSolution_TGV3D" |
| #define | __FUNCT__ "SetAnalyticalSolution_ZeroFlow" |
| #define | __FUNCT__ "SetAnalyticalSolution_UniformFlow" |
| #define | __FUNCT__ "SetAnalyticalSolutionForParticles_TGV3D" |
| #define | __FUNCT__ "SetAnalyticalSolutionForParticles_UniformFlow" |
| #define | __FUNCT__ "SetAnalyticalSolutionForParticles" |
| #define | __FUNCT__ "EvaluateAnalyticalScalarProfile" |
| #define | __FUNCT__ "SetAnalyticalScalarFieldOnParticles" |
| #define | __FUNCT__ "SetAnalyticalScalarFieldAtCellCenters" |
Functions | |
| static PetscErrorCode | SetAnalyticalSolution_TGV3D (SimCtx *simCtx) |
| Populate the Eulerian field vectors with the Taylor–Green vortex at the current time. | |
| static PetscErrorCode | SetAnalyticalSolution_ZeroFlow (SimCtx *simCtx) |
| Set every analytical Eulerian field to the quiescent zero-flow reference state. | |
| static PetscErrorCode | SetAnalyticalSolution_UniformFlow (SimCtx *simCtx) |
| Fill the analytical Eulerian fields with the configured spatially uniform flow state. | |
| static PetscErrorCode | SetAnalyticalSolutionForParticles_TGV3D (Vec tempVec, SimCtx *simCtx) |
Evaluate Taylor–Green velocities at swarm particle positions and store them in tempVec. | |
| static PetscErrorCode | SetAnalyticalSolutionForParticles_UniformFlow (Vec tempVec, SimCtx *simCtx) |
| Fill the particle velocity vector with the configured uniform analytical flow. | |
| static PetscErrorCode | EvaluateConfiguredScalarProfile (const VerificationScalarConfig *cfg, PetscReal x, PetscReal y, PetscReal z, PetscReal *value) |
| Internal helper that evaluates the configured scalar verification profile. | |
| PetscBool | AnalyticalTypeRequiresCustomGeometry (const char *analytical_type) |
| Implementation of AnalyticalTypeRequiresCustomGeometry(). | |
| PetscBool | AnalyticalTypeSupportsInterpolationError (const char *analytical_type) |
| Implementation of AnalyticalTypeSupportsInterpolationError(). | |
| PetscErrorCode | SetAnalyticalGridInfo (UserCtx *user) |
Internal helper implementation: SetAnalyticalGridInfo(). | |
| PetscErrorCode | AnalyticalSolutionEngine (SimCtx *simCtx) |
| Implementation of AnalyticalSolutionEngine(). | |
| PetscErrorCode | SetAnalyticalSolutionForParticles (Vec tempVec, SimCtx *simCtx) |
| Implementation of SetAnalyticalSolutionForParticles(). | |
| PetscErrorCode | EvaluateAnalyticalScalarProfile (const SimCtx *simCtx, PetscReal x, PetscReal y, PetscReal z, PetscReal t, PetscReal *value) |
| Implementation of EvaluateAnalyticalScalarProfile(). | |
| PetscErrorCode | SetAnalyticalScalarFieldOnParticles (UserCtx *user, ParticleFieldId particle_field_id) |
| Implementation of SetAnalyticalScalarFieldOnParticles(). | |
| PetscErrorCode | SetAnalyticalScalarFieldAtCellCenters (UserCtx *user, Vec targetVec) |
| Implementation of SetAnalyticalScalarFieldAtCellCenters(). | |
Variables | |
| static const FieldId | kAnalyticalCellFields [] = {FIELD_ID_UCAT, FIELD_ID_P} |
| Cell-centred fields every analytical setter finalizes, in the order the post-projection finalization uses for the solved flow. | |
Implements the analytical solution engine for initializing or driving the simulation.
This file provides a modular and extensible framework for applying analytical solutions to the Eulerian fields. The primary entry point is AnalyticalSolutionEngine, which acts as a dispatcher based on user configuration.
— DESIGN PHILOSOPHY —
simCtx->scaling parameters are intentionally NOT used here; they are reserved for dimensionalization during I/O and post-processing only.t. This involves:Ucat and P directly.Ucont via metric dot products and deriving Ucat through Contra2Cart.user->Bcs.Ubcs). It does NOT fill dummy cells itself. After setting the physical state, every setter runs the same sequence the solved flow is finalized with (see FinalizePostProjectionCellFields): UpdateDummyCells on non-periodic faces, SynchronizePeriodicCellFields on periodic ones, UpdateCornerNodes for edges and corners, and the periodic synchronization again because corner averaging can overwrite periodic endpoints. The boundary values are this module's own Ubcs, which is why the setters do not call that finalizer: it would refresh Ubcs from the boundary handlers.else if condition and a corresponding static implementation function, without modifying any other part of the solver. Definition in file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalGridInfo" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "AnalyticalSolutionEngine" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalSolution_TGV3D" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalSolution_ZeroFlow" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalSolution_UniformFlow" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalSolutionForParticles_TGV3D" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalSolutionForParticles_UniformFlow" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalSolutionForParticles" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "EvaluateAnalyticalScalarProfile" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalScalarFieldOnParticles" |
Definition at line 83 of file AnalyticalSolutions.c.
| #define __FUNCT__ "SetAnalyticalScalarFieldAtCellCenters" |
Definition at line 83 of file AnalyticalSolutions.c.
|
static |
Populate the Eulerian field vectors with the Taylor–Green vortex at the current time.
Definition at line 246 of file AnalyticalSolutions.c.
|
static |
Set every analytical Eulerian field to the quiescent zero-flow reference state.
Definition at line 380 of file AnalyticalSolutions.c.
|
static |
Fill the analytical Eulerian fields with the configured spatially uniform flow state.
Definition at line 415 of file AnalyticalSolutions.c.
|
static |
Evaluate Taylor–Green velocities at swarm particle positions and store them in tempVec.
Definition at line 475 of file AnalyticalSolutions.c.
|
static |
Fill the particle velocity vector with the configured uniform analytical flow.
Definition at line 517 of file AnalyticalSolutions.c.
|
static |
Internal helper that evaluates the configured scalar verification profile.
Local to this translation unit.
Definition at line 574 of file AnalyticalSolutions.c.
| PetscBool AnalyticalTypeRequiresCustomGeometry | ( | const char * | analytical_type | ) |
Implementation of AnalyticalTypeRequiresCustomGeometry().
Reports whether an analytical type requires custom geometry/decomposition logic.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/AnalyticalSolutions.h.
Definition at line 63 of file AnalyticalSolutions.c.
| PetscBool AnalyticalTypeSupportsInterpolationError | ( | const char * | analytical_type | ) |
Implementation of AnalyticalTypeSupportsInterpolationError().
Reports whether an analytical type has a non-trivial velocity field for which interpolation error measurement is meaningful.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/AnalyticalSolutions.h.
Definition at line 75 of file AnalyticalSolutions.c.
| PetscErrorCode SetAnalyticalGridInfo | ( | UserCtx * | user | ) |
Internal helper implementation: SetAnalyticalGridInfo().
Sets the grid domain and resolution for analytical solution cases.
Local to this translation unit.
Definition at line 88 of file AnalyticalSolutions.c.
| PetscErrorCode AnalyticalSolutionEngine | ( | SimCtx * | simCtx | ) |
Implementation of AnalyticalSolutionEngine().
Dispatches to the appropriate analytical solution function based on simulation settings.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/AnalyticalSolutions.h.
Definition at line 192 of file AnalyticalSolutions.c.
| PetscErrorCode SetAnalyticalSolutionForParticles | ( | Vec | tempVec, |
| SimCtx * | simCtx | ||
| ) |
Implementation of SetAnalyticalSolutionForParticles().
Applies the analytical solution to particle velocity vector.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/AnalyticalSolutions.h.
Definition at line 546 of file AnalyticalSolutions.c.
| PetscErrorCode EvaluateAnalyticalScalarProfile | ( | const SimCtx * | simCtx, |
| PetscReal | x, | ||
| PetscReal | y, | ||
| PetscReal | z, | ||
| PetscReal | t, | ||
| PetscReal * | value | ||
| ) |
Implementation of EvaluateAnalyticalScalarProfile().
Evaluates the configured verification scalar profile at one physical point.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/AnalyticalSolutions.h.
Definition at line 609 of file AnalyticalSolutions.c.
| PetscErrorCode SetAnalyticalScalarFieldOnParticles | ( | UserCtx * | user, |
| ParticleFieldId | particle_field_id | ||
| ) |
Implementation of SetAnalyticalScalarFieldOnParticles().
Writes the configured verification scalar profile onto a particle swarm scalar field.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/AnalyticalSolutions.h.
Definition at line 635 of file AnalyticalSolutions.c.
| PetscErrorCode SetAnalyticalScalarFieldAtCellCenters | ( | UserCtx * | user, |
| Vec | targetVec | ||
| ) |
Implementation of SetAnalyticalScalarFieldAtCellCenters().
Writes the configured verification scalar profile at physical cell centers into a scalar Vec.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/AnalyticalSolutions.h.
Definition at line 685 of file AnalyticalSolutions.c.
|
static |
Cell-centred fields every analytical setter finalizes, in the order the post-projection finalization uses for the solved flow.
Definition at line 43 of file AnalyticalSolutions.c.