It is challenging to properly control the ventilation in a complex built environment, such as a data center room and aircraft cabin. The ventilation effects depend on both an indoor airflow distribution and HVAC system. This presentation introduces a coupled simulation of three-dimensional indoor airflow and building HVAC system. The indoor airflow is simulated by a fast fluid dynamics program, while the HVAC and control system is modeled with a Modelica language. We will introduce the principle of the coupled simulation and demonstrate its usage for the ventilation control.