Tonight I flew from Munich to Dortmund on an A319 and I happened to sit just above the wings and turbine on the right side. Upon landing, the turbine opened a window or panel which exposed some grid like structure inside it and just a few seconds later, after touchdown, closed it again. Could someone explain to me what that is, how it is called and what its purpose is?
What you saw is the thrust reverser of the engine, which redirects some of the airflow forwards and therefore helps slowing the aircraft down. The grid like structure are the cascade vanes. This is what it looks like inside the engine:
The blue arrows indicate the flow of the so called bypass air, which is air that goes through the fan (and is therefore accelerated), but does not go into the core engine. With the thrust reverser deployed, this air is redirected forwards. The core air going through the actual turbine engine will still exit at the back. Since there is more bypass air than core air1, there is a net thrust generated in the forwards direction.
If you are wondering what the pilots are doing to engage reverse thrust, this is a picture of the A320 family thrust levers:
The main thrust levers are pulled all the way back during the flare to the position shown in the image (labelled 0). To open the reverser doors, you pull up on the smaller handles at the front of the thrust levers. Once the reverser doors have opened, the thrust levers can be pulled backwards to add more reverse thrust (range labelled REV in image). To close the reverser doors, the thrust levers are moved back forwards and the smaller handles are pushed back down.
Note that on a dry runway reverse thrust does not slow the aircraft down faster (assuming auto brakes are used). The brakes on the main landing gear are capable of achieving the same deceleration without reverse thrust. Engaging reverse thrust therefore reduces brake temperatures and wear.
The thrust reverser doors can look different depending on the engine type. Based on your image, the aircraft you were on was equipped with IAE V2500 engines2. The reverser doors on the CFM56 engine, as used on some A320 family aircraft, look a bit different3:
(image source: Wikimedia)
1 The IAE V2522-A5 engines used on the Airbus A319 have a bypass ratio of 4.9 : 1 (source).
3 The CFM56 engine is also used on the 737, but uses the cascade thrust reversers there (thanks to DeepSpace for pointing this out). See also Why is the CFM56 produced with two different thrust reverse options?
It's the reverse thrust door opening. I will get back to you with a picture.
Courtesy By Pieter van Marion from Netherlands - PH-BVC KLM, CC BY-SA 2.0, https://commons.wikimedia.org/w/index.php?curid=29588152
For a brief explanation, once the aircraft has touched down (and in some cases even before it touches down) there are a set of doors and vanes which deflect the jet efflux forward which are deployed to help slow the airplane. However, these are generally NOT taken into account when certifying the airplane's landing distance. They are therefore a bonus when landing. There are two main types,
Cascade vanes and
Clamshell doors aka
Buckets. The A319 has cascade vanes, similar to seen in the image.
Some more trivia, the reverse thrust on some airplanes can only be activated when the nosewheel is on the ground, due to the possibility of the buckets scraping the runway with a high nose-up attitude.