jwallwork23 / nn_adapt

Accelerating goal-oriented error estimation using neural networks
1 stars 1 forks source link

Improve generality #4

Open jwallwork23 opened 2 years ago

jwallwork23 commented 2 years ago

At the minute, the code is heavily geared towards steady-state turbine examples. It should be made more general, to facilitate its application to other setups.

See the TODO in this commit.

jwallwork23 commented 2 years ago

Generalisation idea 1: non-axis-aligned geometry

Consider the following two cases, which are just the "aligned" test case, but a small "headland" is introduced to the first one and the second one is curved so that it goes through 45 degrees.

1) The error is over-estimated near to the "headland" and most of the mesh resolution ends up going there:

headland_ee

2) The error estimate is a poor fit everywhere:

segment_ee

jwallwork23 commented 2 years ago

Generalisation idea 2: different boundary conditions

So far, all of the scenarios in the training and testing data have an inflow segment {"uv": uv_inflow}, an outflow segment {"elev": Constant(0.0)} and free-slip conditions on the "channel walls" {"un": Constant(0.0)}. This is a farily restrictive set of boundary conditions. Again, the use of different boundary conditions (such as no-slip conditions {"uv": Constant(as_vector([0.0, 0.0])}) introduces "unseen" flow physics, which we cannot expect the network to capture.

In order to address this issue, we should use a wider variety of boundary conditions in the training cases.

jwallwork23 commented 2 years ago

Generalisation idea 3: time-dependent case

The shallow water equations are much more commonly solved in their time-dependent form than their steady-state form. It would be very beneficial if we could emulate the goal-oriented error estimation process for such problems.

Foreseeably, this could amount to training on a single timestep, taking the same feature data and again outputting the error indicator. The difference would be that the PDE residual is different (as defined by the specific time integrator used) and will in particular include a time derivative term.

Done properly, goal-oriented mesh adaptation for time-dependent problems involves solving forward and adjoint for all time in order to have data from both at each time level. If a global enrichment method is used then this would need to be solved for all time, too, which can be very expensive. By applying the nn_adapt approach, we would be able to get away with just solving the forward and adjoint on the current sequence of meshes.

jwallwork23 commented 2 years ago

Generalisation idea 4: different QoIs

So far, we train the network under the assumption that the QoI is always the same (power output). It might be possible to train the network such that different QoIs could be chosen.

jwallwork23 commented 2 years ago

Generalisation idea 5: spatially varying physical parameters

At the minute, the bathymetry and viscosity parameters are assumed to be constant in space. It would be good vary them during training, so that the corresponding parameter spaces can be spanned more efficiently and more complex flow physics can be learned. Further, it would be good to represent these parameters in P1 space, rather than P0 space.