We are going to simulate Air residence time in the MFHT room at the IIT Bombay.
here we use the simpleFoam k-epsilon model for flow velocity simulation and artFoam for air residence time simulation To successfully run the simulations you can follow the following steps:
step-1:Please download the case file namely 'velocity' and save it to your run folder in OpenFOAM.
Step-2:Go to your terminal and go to your run folder
Step-3:by using the "cd" command go into the 'velocity' folder. Then type the "bash ./Allrun" command in your terminal.
Step-4: After a successful process, you can visualise results in the ParaFOAM.

For setting the artFOAM solver follow the below steps.
Step-1:Download the 'artFoam' folder and save it to your run folder in OpenFOAM.
Step-2:Go to your terminal and go to your run folder.
Step-3:by using the "cd" command go into the 'artFoam' folder. Then type the "wclean" and afterwards "wmake" command in your terminal.


For running airRT (air Residence) follow the below steps.
Step-1: Download the 'airRT' folder and save it to your run folder in OpenFOAM.
Step-2: Go to your terminal and go to your run folder.
Step-3: Copy the latest velocity file (U) from the 'velocity' folder and paste and replace it with the '0' folder in the 'airRT' folder.
Step-4: by using the "cd" command go into the 'airRT' folder. Then type the "bash ./Allrun" command in your terminal.
Step-5: After a successful process, you can visualise results in the ParaFOAM.


For using the machine learning algorithm, train the model with pre-existing data, and then use the position of your exhaust fan as the input (can use either the one variable code or the two variable code as explained in the report) to find out the predicted air residence time.

There are excel files with all the results and plots are provided for verification.




To create a simple solver for scalar transport in OpenFOAM focusing on air residence time, you can follow these steps:

1. Set up the case: Begin by setting up the case directory structure in OpenFOAM, including the necessary folders like `0/` for initial conditions, `constant/` for boundary conditions, etc.

2. Define the scalar transport equation: Modify the `fvSchemes` and `fvSolution` files in the `system/` directory to define the discretization schemes and solution methods for the scalar transport equation.

3. Set up initial and boundary conditions: Define the initial conditions for the scalar field representing air residence time in the `0/` directory. Also, specify appropriate boundary conditions for the domain.

4. Write the solver code: Create a new solver by modifying an existing solver or by writing a custom one. For air residence time, you may base it on the scalarTransportFoam solver. Adjust the solver to solve for air residence time instead of a generic scalar quantity.

5. Compile the solver: Once you have written the solver code, compile it using the `wmake` command in the terminal within your case directory.

6. Run the simulation: After compiling the solver, run the simulation using the newly created solver executable. Monitor the simulation progress and check for convergence.

7. Post-processing: Once the simulation is complete, post-process the results to analyze the air residence time distribution in the domain. You can visualize the results using ParaView or other visualization tools.

8. Validation and verification: Validate the results of your simulation by comparing them with analytical solutions, experimental data, or results from other validated simulations.

9. Iterate and refine: Based on the validation results, iterate on the model, solver settings, and boundary conditions to refine the simulation setup and improve the accuracy of the results.

10. Documentation: Document the solver setup, boundary conditions, solver settings, and any modifications made to the code for future reference.

By following these steps, you can create a simple solver for scalar transport focusing on air residence time using OpenFOAM.