Git Product home page Git Product logo

msc-thesis's Introduction

msc-thesis

M. Sc. Thesis code and results.

The computation engine is located at https://github.com/KikeM/romtime.

Defense and Graduation tasks

Abstract

We present a Reduced Order Model (ROM) for a one-dimensional gas dynamics problem: the isentropic piston. The main body of the PDE, the geometrical definition of the moving boundary, and the boundary conditions themselves are parametrized. The Full Order Model is obtained with a Galerkin semi-implicit Finite Element discretization, under the Arbitrary-Lagrangian formulation (ALE). To stabilize the system, an artificial viscosity term is included. The Reduced Basis to express the solution is obtained with the classical POD technique.

To overcome the explicit use of the jacobian transformation, typical in the context of moving domains, a system approximation technique is used. The (Matrix) Discrete Empirical Interpolation Method, (M)DEIM, allows us to work with a weak form defined in the physical domain (and hence the physical weak formulation) whilst maintaining an efficient assembly for the algebraic operators, despite their evolution with every timestep.

All in all, our approach to the construction of the Reduced Order Model is purely algebraic and makes no use of Full Order structures in its resolution, thus achieving a perfect offline-online split. A concise description of the reducing procedure is provided, together with a posteriori error estimations, obtained via model truncation, to certify the Reduced Order Model.

msc-thesis's People

Contributors

kikem avatar

Watchers

 avatar  avatar  avatar

msc-thesis's Issues

ROM : Solver and Reconstruction

Once we have #2 and #5 we can build a ROM of our problem.
This is done by projecting the FOM operators at each step and solving the resultant ROM system of equations.
Once this is done, the reduced solution needs to be projected back into the original space to asses the error.

Warning: How does it work with boundary conditions?

  • Build ROM system.
  • Dense solver.
  • Reconstruct solution in the FOM mesh.

PB : Categories

  • PB: Product Backlog
  • FOM: Full Order Model
  • ROM: Reduced Order Model
  • DEIM: Discrete Empirical Interpolation Method
  • MDEIM: Matrix Discrete Empirical Interpolation Method
  • TH: Theoretical Analysis

BUG : Incompatible piston movement with initial rest condition

Given the current sinusoidal movement of the piston, its initial velocity is not zero!

L(t)  = L0 * (1 - delta * h(t))
L'(t) = -L0 * delta * h'(t)

h(t)  = sin(wt)
h'(t) = w * cos(wt)

L'(t) = -L0 * delta * w * cos(wt) 
L'(0) = -L0 * delta * w

This is not compatible with a fluid departing from rest.

The fix easy,

L(t)  = L0 * (1 - delta * h(t))
L'(t) = -L0 * delta * h'(t)

h(t)  = 1 - cos(wt)
h'(t) = w * sin(wt)

L'(t) = -L0 * delta * w * sin(wt) 
L'(0) = 0

This has an impact in the definition of the boundary conditions.

CLN : Recover MFP problem to validate code

Instead of using a parabola, I think it would be better to use a sinusoidal function (still taking of from rest).

This is necessary since the previous results were obtained before KikeM/romtime#25 was fixed.

Additionally, it was done with the heat equation, should be try with the piston equations?

ENH : Automatic detection of number of basis elements in SVD

How do we know how many elements are necessary to detect the basis.

This is actually a nice discussion, because it is not true that we need as many basis elements as nodal points.

In fact, this helps support our decision to rule out the linear operators from our experiments on how many modes can be removed without affecting too much the solution.

Related to KikeM/romtime#23

ROM : Error and efficiency computations (I)

At the present moment (0.1.0) I am checking the ROM with the L2 norm against the exact solution.
This is fine for the moment, since I am working with a manufactured problem.
However, in the ROM community there are standard ways to measure how well a model is doing.

Calculate comparison with and without ALE term.

We remove the mesh velocity terms from the convection matrix and the lifting operator to appreciate its effects.

When such term is not included mass is no longer preserved, proving the necessity of a term that accounts for mesh deformation.

DISC : From Naive To ... ?

Now that I have the naive ROM implementation put up for a fixed domain, the question arises on which task to tackle next.

We have the following unresolved issues, ordered from complex to simple:

  • 1. (M)DEIM Implementation
  • 2. Moving Domain: Mesh Deformation
  • 3. Moving Domain: Generalised Transformation.
  • 4. A posteriori errors, ¿Riesz representation theorem?
  • 5. POD Implementation (#5).
  • 6. ROM-community error calculations (#20).
  1. The very first issue is the one where I feel the most uncertain about.
  2. Regarding the second issue, fenics has an ALE.move() method which allegedly displaces the mesh.
    However, I am skeptical it will be easy and straightforward.
  3. No problems here, I just need to change the weak form definition (this will probably end up in a bit of refactoring, to deal with several problems elegantly).
  4. There seems to a way to compute a posteriori errors via the Riesz representation theorem.
    I need to review how to do that.
  5. POD should be easy, I only need to review the papers describing its implementation, and read a couple of posts online.
  6. Easy peasy :)

CLN : BDF convergence schemes

Show the difference between BDF-1 and BDF-2.

  • Convergence of outflow value in time.
  • Net mass error.
  • Error difference between successive discretizations.
  • Test with and without nonlinear term.

For the ROM too?

FOM : Snapshot generator

Once #2 is done, we can generate a thin-layer around the FOM solver to obtain the FOM snapshots (solution, matrices, vectors, etc.).

The goal is to have a clean interface to our solver in order to extract the ingredients for the basis generation.

  • Create parameter manager class. Given a parametric space, for the moment define a random generator of snapshots.
  • Create snapshot generator class.

DISC : Which boundary conditions to solve?

Implementation details with the boundary conditions arise when the basis is built.
Ideally, the basis should be built for homogeneous/natural boundary conditions.

  • An "easy" workaround is to solve the heat equation for natural boundary conditions du/dn = 0 for the whole domain (although I am not sure if existence is guaranteed).
  • Solve for homogeneous Dirichlet boundary conditions for the moment.
    There is no strict need to parametrize the boundary conditions for our purposes.
  • The generic implementation is to introduce a lifting function.

ROM : POD Implementation

Although in theory one can use the solution snapshots as a basis to project the operators, in practice these might define a basis with a large condition number.
Having it go through the POD, even if it is with the same number of basis vectors as snapshots, will produce an orthonormal basis.

Warning: watch-out for standardisations, this could introduce problems.

Deliverable
Build POD space of solution snapshots.

References

BUG, DISC: Homogeneous snapshots for lifting terms in DEIM tree walk for asymptotic stationary solutions

When I was implementing the DEIM procedure for the lifting term, it would not be able to build a basis for one of the tree branches for a certain combination of parameters, namely one where the stationary solution was quickly attained.

I proceeded to inspect the snapshots, and I found (with a certain horror and underlying feeling of a possible bug) that they were identically zero.
Yet, the tests for the FOM solver are passing, which means that the lifting term is being correctly assembled.

What is going on then?

Well, this behaviour is actually not buggy at all, but rather a consequence of the asymptotic stationary nature of MFP-1 (which is one of its desired characteristics).
Indeed, as the solution converges towards a stationary value,

  • the forcing term tends towards a constant value (the stationary value is a parabola, hence constant second order derivative),
  • and the lifting terms tends towards zero!

Why is this happening?
Well, if we have reached a stationary value, the lifting term only needs to enforce the constant boundary values, which are actually suppressed in the imposition of the homogeneous boundary conditions in the assembly and solution of the algebraic problem.

This means that the lifting term is identically zero!

How can we overcome this issue for asymptotic stationary problems?
By reducing together the forcing term and the lifting term.

ENH : Automatic ROM reporting

Once the ROM is defined in terms of the weak formulations (mass, stiffness, forcings, etc.), boundary conditions, parameter space, and hyper reductions, it would be good to automate the "reporting".

Questions to answer in a ROM reporting:

  • Which problem is solved.
  • Efficiency rates: how much was the problem compressed.
  • Errors: L2 (done), H1.
    • Time integration errors.
    • Take a look at the paper from Negri, he suggested a couple of metrics.
    • A posteriori errors.
  • Error location: is it near a non-linearity?
  • Spectral decay in the POD/SVD.
  • How far away can we go from the trained set? (This actually proves if we have captured the dynamics or not).
    • Euclidean distance from the furthest point of the training set.
    • Euclidean distance from the "centre" of the cluster.
  • Performance rates: how much time is saved up (this metric is implementation-dependent, be careful).

Naive Implementation - Fixed Domain

The goal is to build a simple code base that solves the reduction problem completely for a fixed domain.

Is this naive approach, the Discrete Empirical Interpolation is not used, since it would only add extra layers of complexity.
The ROM operators are obtained by assembly and projection of the FOM operators.

I am aware this does not honor the offline-online split principle, but it does allow me to tackle all the implementation details.
Once these are dealt with, implementing the (M)DEIM algorithms should not be too cumbersome.

## Steps

  • Definition of Manufactured Solution #10.
  • Parametrized FOM Solver #7 #2 #9 #15.
  • Basis construction: POD SVD orthogonalisation #4 #5.
  • Parametrized ROM Solver #8 #6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.