Ejemplo n.º 1
0
# file: plotVorticitySnake.py
# author: Olivier Mesnard ([email protected])
# description: Plots the 2D vorticity field near the snake.
# Run this script from the simulation directory.


from snake.petibm.simulation import PetIBMSimulation
from snake.body import Body


simulation = PetIBMSimulation()
simulation.read_grid()

body = Body(file_path='flyingSnake2dAoA35ds0.004.body')

for time_step in simulation.get_time_steps():
  simulation.read_fields('vorticity', time_step)
  simulation.plot_contour('vorticity',
                          field_range=[-5.0, 5.0, 101],
                          filled_contour=True,
                          view=[-0.75, -1.0, 1.50, 1.0],
                          bodies=body,
                          width=8.0)
Ejemplo n.º 2
0
"""
Plots and saves the 2D pressure field from a PetIBM simulation at saved
time-steps.
"""

from snake.petibm.simulation import PetIBMSimulation


simulation = PetIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
  simulation.read_fields('pressure', time_step)
  simulation.plot_contour('pressure',
                          field_range=(-1.0, 0.5, 101),
                          filled_contour=True,
                          view=[-15.0, -15.0, 15.0, 15.0],
                          style='mesnardo',
                          cmap='viridis',
                          save_name='pressure',
                          width=8.0)
Ejemplo n.º 3
0
"""
Plots and saves the 2D pressure field from a PetIBM simulation at saved
time-steps.
"""

from snake.petibm.simulation import PetIBMSimulation

simulation = PetIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
    simulation.read_fields('pressure', time_step)
    simulation.plot_contour('pressure',
                            field_range=(-1.0, 0.5, 101),
                            filled_contour=True,
                            view=[-15.0, -15.0, 15.0, 15.0],
                            style='mesnardo',
                            cmap='viridis',
                            save_name='pressure',
                            width=8.0)
Ejemplo n.º 4
0
# file: plotPressure.py
# author: Olivier Mesnard ([email protected])
# description: Plots the 2D pressure field.
# Run this script from the simulation directory.


from snake.petibm.simulation import PetIBMSimulation


simulation = PetIBMSimulation()
simulation.read_grid()

for time_step in simulation.get_time_steps():
    simulation.read_fields("pressure", time_step)
    simulation.plot_contour(
        "pressure",
        field_range=[-1.0, 0.5, 101],
        filled_contour=True,
        view=[-15.0, -15.0, 15.0, 15.0],
        save_name="pressure",
        width=8.0,
    )