In this study, a square cavity is modeled using Computational Fluid Dynamics (CFD) as well as artificial intelligence (AI) approach. In the square cavity, copper (Cu) nanoparticle is the nanofluid and the flow velocity characteristics in the x-direction and y-direction, and the fluid temperature inside the cavity at different times are considered as CFD outputs. CFD outputs have been assessed using one of the artificial intelligence algorithms, such as a combination of neural network and fuzzy logic (ANFIS). As in the ANFIS method, we have a non-dimension procedure in the learning step, and there is no issue in combining other characteristics of the flow and thermal distribution beside the x and y coordinates, we combine two coordinate parameters and one flow parameter. This ability of method can be considered as a meshless learning step that there is no instability of the numerical method or limitation of boundary conditions. The data were classified using the grid partition method and the MF (membership function) type was dsigmf (difference between two sigmoidal membership functions). By achieving the appropriate intelligence in the ANFIS method, output prediction was performed at the points of cavity which were not included in the learning process and were compared to the existing data (the results of the CFD method) and were validated by them. This new combination of CFD and the ANFIS method enables us to learn flow and temperature distribution throughout the domain thoroughly, and eventually predict the flow characteristics in short computational time. The results from AI in the ANFIS method were compared to the ant colony and fuzzy logic methods. The data from CFD results were inserted into the ant colony system for the training process, and we predicted the data in the fuzzy logic system. Then, we compare the data with the ANFIS method. The results indicate that the ANFIS method has a high potentiality compared to the ant colony method because the amount of R in the ANIFS system is higher than R in the ant colony method. In the ANFIS method, R is equal to 0.99, and in the ant colony method, R is equal to 0.91. This shows that the ant colony needs more time for both the prediction and training of the system. Also, comparing the pattern recognition in the two systems, we can obviously see that by using the ANFIS method, the predictions completely match the target points. But the other method cannot match the flow pattern and velocity distribution with the CFD method.