sandbox/ecipriano/test/spark.c
Spark Model
For the ignition of fuel mixtures in combustion simulations.
#include "grid/multigrid.h"
#include "run.h"
#include "common.h"
#include "view.h"
The spark must be applied on a temperature field.
We gather the spark properties in the following struct. We assign the temperature field, the position of the center of the spark, its diameter, the ignition time, the total durantion and the maximum temperature.
spark.policy = 2; // SPARK_RAMP
spark.T = T;
spark.position = (coord){0.25, 0.25};
spark.diameter = 4.*L0/(1 << 7);
spark.time = 0.1;
spark.duration = 0.1;
spark.temperature = 3500.;
We set a maximum delta t and we create the domain and the grid.
The temperature is initially constant and at 300K in the whole domain.
We write a video with the temperature field in time, and we write the volume integral of the temperature in the logfile.