• About The Regularized Singularity

The Regularized Singularity

~ The Eyes of a citizen; the voice of the silent

The Regularized Singularity

Tag Archives: philosophy

How to make a hydrocode robust

22 Tuesday Oct 2024

Posted by Bill Rider in Uncategorized

≈ Leave a comment

Tags

education, mathematics, philosophy, physics, science

tl;dr

Code users want answers no matter what. The way a code gets there matters a lot. There are useful, but utterly unprincipled ways to achieve this goal. Worse yet, they are popular with users. It is far better to achieve this goal adhering to basic principles that assure solution credibility. Here we discuss both approaches with an emphasis on choosing the principled way. A fundamental principle is to use the combination and consistency with the governing equations as a bedrock. The other basic principles are adherence to conservation and the use of dissipation to produce entropy.

Robust is when you care more about the few who like your work than the multitude who dislike it (artists); fragile when you care more about the few who dislike your work than the multitude who like it (politicians).― Nassim Nicholas Taleb

The Need for Robustness

Recently I was in a high-level, high-stress meeting about the future of hydro codes at work. There was a large number of issues to deal with, but one issue lingers in the background. The meeting was pretty low on technical content, so the discussion focused on management stuff. It was all project plans, timelines, and human resources. All the technical stuff was very high level. Still, one issue is looming: the users demand that a code that always gets answers. The incumbent legacy code is very good at this. The problem is that this is achieved in an appalling way. I’ll get to that.

I agree with the robust code as a goal and the need to give users a code that always produces answers. I also think this should be done in a way that the answers aren’t suspect as bullshit. These codes are used to tackle all sorts of important problems by important people for important reasons. I get that. This points to a level of responsibility in assuring that the answers are defensible; that is they aren’t bullshit. This requires that we adhere to some fundamental principles. Results that violate fundamental principles should be unacceptable.

Difficulty is what wakes up the genius― Nassim Nicholas Taleb

How to Make a Hydrocode Robust Incorrectly

This could have been titled “how to get bullshit results” with a hydrocode. Is anyone catching a theme here? I will freely admit that the practical solution to important problems often pushes code developers to do something awful. The biggest culprit is the process of hydrodynamic turbulence. Since turbulence is not understood, people get away with this shit. Turbulence is fundamentally dissipative too. This means that if you say the flow is turbulent and this means you get more dissipation; the extra dissipation is justified. As one friend quipped, “If the ocean was as viscous as we make it, you could drive to Europe.” Nonetheless, there are bullshit ways to introduce turbulent dissipation and codes do it. There are also legitimate ways to introduce dissipation, but it requires more thought.

Unfortunately, we aren’t dealing with this sort of issue. We are dealing with something far less defensible. I think the root of it goes to a technique popular in finite element analysis. Its popularity is in no way based on correctness. This technique is called “element death.” Basically, if a finite element starts to become a problem it is eliminated. This could be from having a difficult shape (unphysical or distorted or short lengths). It could come from a difficult condition like a super high temperature or pressure. It could be a negative pressure or temperature. It is sort of cowardly and only treats the symptoms of the problem. It does jack shit about the cause of it. It is worse than that. It is absolutely destructive to any credibility as I will elaborate shortly.

The hydrocode(s) decided to mimic this functionality. If a material in a calculation becomes difficult, it is deleted. These are multimaterial hydrocodes that solve complex problems with many materials. These codes solve problems that encounter extreme conditions routinely. These problems are intrinsically difficult. Sometimes the material gets completely out of line with reasonable physical conditions. They often achieve conditions that are implausible even in extreme situations. These conditions wreak havoc with a calculation. One fatal mechanism is causing the timestep size to plummet making the calculation impossibly expensive.

The methodology simply decides to throw the material away if some limits are exceeded. This is protective and gets the code to run to the end. It gets the answer. It can completely annihilate the calculation’s credibility too. The reasons are numerous and relatively simple. In a nutshell, the foundations of computational modeling are being disregarded.

All opinions are not equal. Some are a very great deal more robust, sophisticated and well supported in logic and argument than others.— Douglas Adams

How to Make Hydrocode Robust in a Principled Way

It is important to acknowledge what the foundational principles are for computational modeling. The fundamental theorem was discovered by Peter Lax in the early 1950’s. The basic principle is that the numerical approximation produces the governing equations for the system plus some approximation error. This is often called a truncation error. The second requirement is that the approximation is stable. Of all the governing equations the conservation of mass is the most primal. Conservation of mass is unassailable and not ever the subject of debate. When it is disregarded the entire system of governing equations goes with it. The technical term is consistency. Without conservation of mass, the approximation is not consistent. The theorem being violated is absolute and cannot be quibbled with.

Antifragility is beyond resilience or robustness. The resilient resists shocks and stays the same; the antifragile gets better.— Nassim Nicholas Taleb

Hydrocodes are solving what mathematicians call hyperbolic conservation laws. This is usually mass, momentum, and energy, which are interrelated. When mass is disregarded momentum and energy go with them. Mathematically conservation laws are solved by what are known as weak solutions. A weak solution can be discontinuous and not smooth and support structures like shock waves. These solutions require the solutions to be conservative and be in conservation form (more work by Lax). Conservation form comes from naturally conserving these quantities in a calculation by construction. It can be done by other means, but those approaches don’t provide assurance of weak solutions.

You should never be surprised by or feel the need to explain why any physical system is in a high entropy state.― Brian Greene

The issue is that weak solutions are not unique. The way to provide weak solutions that are correct and unique is dissipation. All of these conditions were derived by Peter Lax and various collaborators. It is in these theorems that the principled answer to robustness can be found. The first principle is to regard conservation as essential. The second principle is to promote dissipation as the response to problems with the solution. Dissipation is usually considered to be less accurate in solutions.

You should call it entropy, for two reasons. In the first place your uncertainty function has been used in statistical mechanics under that name, so it already has a name. In the second place, and more important, no one really knows what entropy really is, so in a debate you will always have the advantage.– John von Neumann

This is the key thought, if you would consider removing mass from a calculation then reducing accuracy should be done instead. Once the material becomes compromised accuracy should be disregarded. The way to deal with these materials is to dissipate the issue. This way the problem can be spread out and diffused without sacrificing credibility. We can do this in a graded way. The key is to remove accuracy and replace it with dissipation. The underlying principle is that dissipation is physical. It is the mechanism of the second law of thermodynamics. The application of dissipation keeps solutions physical and credible. It just reduces accuracy. A loss of accuracy is vastly superior to a loss of consistency. Moreover, dissipation usually gives better stability too. You still end up with a physical solution that can be considered credible.

The law that entropy always increases, holds, I think, the supreme position among the laws of Nature. … if your theory is found to be against the second law of thermodynamics I can give you no hope; there is nothing for it but to collapse in deepest humiliation.― Arthur Stanley Eddington

To Sum up the Argument

Disregarding the conservation of mass is not defensible. It is like employing amputation to treat infections when antibiotics are available. During the civil war infections led to huge numbers of amputations to save patients. This practice ended when antibiotics were found. While discard and element death are not as barbaric, they are unnecessary today. Moreover, we know the harm they do. They shred credibility as the results lose consistency with the most fundamental law of physics, the conservation of mass. Instead, adhere to the fundamentals and get robustness by utilizing the wisdom of the basic math.

Entropy is just a fancy way of saying: things fall apart.― Dan Brown

References

Lax, Peter D. Hyperbolic systems of conservation laws and the mathematical theory of shock waves. Society for Industrial and Applied Mathematics, 1973.

Lax, Peter D., and Robert D. Richtmyer. “Survey of the stability of linear finite difference equations.” In Selected Papers Volume I, pp. 125-151. Springer, New York, NY, 2005. (reprint of seminal 1956 paper in ommunications on pure and applied mathematics)

Lax, Peter, and Burton Wendroff. “Systems of conservation laws.” In Selected Papers Volume I, pp. 263-283. Springer, New York, NY, 2005. (reprint of the seminal 1960 paper in ommunications on pure and applied mathematics)

Harten, Amiram, James M. Hyman, Peter D. Lax, and Barbara Keyfitz. “On finite‐difference approximations and entropy conditions for shocks.” Communications on pure and applied mathematics 29, no. 3 (1976): 297-322.

Previous Writing On this Topic

https://williamjrider.wordpress.com/2017/06/30/tricks-of-the-trade-making-a-method-robust/
https://williamjrider.wordpress.com/2016/07/25/a-more-robust-less-fragile-stability-for-numerical-methods/
https://williamjrider.wordpress.com/2015/07/10/cfd-codes-should-improve-but-wont-why/
https://williamjrider.wordpress.com/2014/12/03/robustness-is-stability-stability-is-robustness-almost/
https://williamjrider.wordpress.com/2014/11/21/robust-physical-flexible-accurate-and-efficient/

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • February 2026
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013

Categories

  • Uncategorized

Meta

  • Create account
  • Log in

Blog at WordPress.com.

  • Subscribe Subscribed
    • The Regularized Singularity
    • Join 55 other subscribers
    • Already have a WordPress.com account? Log in now.
    • The Regularized Singularity
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...