## 5 Co-Simulation of CFD/CSD/RBD
### Procedure of Co-Simulation of CFD/CSD/RBD  
The procedure of co-simulation of CFD/CSD/RBD is shown in Figure 13. Firstly, the simulation program was initialized: the CFD/CSD interface interpolation matrix, the aircraft structure modal shape matrix, and the coordinates of the fluid node of the dynamic mesh of fuselage and elevator in the body reference frame in the initial state were stored in the CFD solver in the form of global variables.  
Figure 11: The FEM model of HWB aircraft.  
the product of pressure and area of each mesh element on the whole fuselage. The force and moment are input to the RBD module for the subsequent flight dynamics calculation. On the other hand, the pressure distribution on the dynamic mesh of the fuselage is transformed into the aerodynamic load distribution on the fluid node of the dynamic mesh of the fuselage and input to the CSD computing module. As for the pressure distribution on the elevator dynamic mesh, due to the rigid body assumption for the elevator, this part of the data only enters the RBD module but does not participate in the CSD calculation module.  
After the completion of the CFD solution and the processing of the pressure on the dynamic mesh, the solution of the structure is calculated in the body frame, the ultimate goal of which is to obtain the coordinates of the fluid node of the dynamic mesh of deformed fuselage in the body frame \(x^{\prime}_{f,B},y^{\prime}_{f,B},z^{\prime}_{f,B}\). The aerodynamic load is distributed on each fluid node of the dynamic mesh of the fuselage, which could be transformed into the aerodynamic load distribution on the structural FEM node through the CFD/CSD interface interpolation. According to the load distribution and the state variables of the fuselage FEM node at the \(t\) time step, the displacement and velocity of the fuselage FEM node at the \(t+1\) time step can be calculated by the structural dynamics calculation program. The displacement of the FEM node could be transformed into the displacement of the fluid node of fuselage dynamic mesh relative to the body frame by the fluid/solid interface interpolation \(dx_{f,B},dy_{f,B},dz_{f,B}\). The coordinates of the fluid node are added to the body frame \(x_{f,B},y_{f,B},z_{f,B}\) with the newly calculated displacements, the coordinates fluid node of the deformed fuselage dynamic mesh in the body frame \(x^{\prime}_{f,B},y^{\prime}_{f,B},z^{\prime}_{f,B}\) can be obtained.  
Then, there is the solution of aircraft flight dynamics. After the RBD module receives the aerodynamic force calculated by the CFD solver, combined with state variables of flight dynamic equations at a \(t\) time step, the position coordinates \(x_{cm,t},y_{cm,t},z_{cm,t}\) and the attitude angles \(x_{cm,C},y_{cm,C},z_{cm,C}\) of aircraft relative to the inertial frame at \(t+1\) time step can be calculated by solving the flight dynamics equation.  
By the transformation relation mentioned in the section on the reference frame, the obtained variables above are transformed to the counterpart in the fluid computational reference frame \(x_{cm,t},y_{cm,t},z_{cm,t}\), \(\varphi_{l},\theta_{l},\psi_{l}\).The last step of the co-simulation in the \(t\) time step is to update the dynamic mesh of the fuselage and elevator. This part is completely consistent with the mesh updating method of RBD/CFD co-simulation, except that the update of the dynamic mesh of the fuselage is based on the coordinates \(x^{\prime}_{f,B},y^{\prime}_{f,B},z^{\prime}_{f,B}\) which corresponds to the deformed fuselage relative to the body frame. After the update of the dynamic mesh, the co-simulation advances to the next time step.