Skip to content

Conversation

@ayush4874
Copy link

Problem

The Pressure Coefficient (Cp) calculation currently divides by ReferenceDynamicPressure without checking if it is zero.
This causes NaN values or crashes when:

  1. The reference velocity is set to 0.0 (e.g., in moving reference frame simulations).
  2. The user inadvertently sets zero free-stream values.

Solution

Added a safety check for GetReferenceDynamicPressure() in:

  • CFlowCompOutput.cpp (Compressible)
  • CFlowIncOutput.cpp (Incompressible)
  • CNEMOCompOutput.cpp (NEMO / Hypersonic)

If the dynamic pressure is effectively zero (abs < 1e-10), the Cp output defaults to 0.0 instead of performing the division.

@pcarruscag
Copy link
Member

Logic for this should be handled in SetReferenceValues of the flow solvers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants