In OpenFOAM, How freestream BC is unique compared to inletoutlet BC.
Bcz in both these BCs, if the flow is outflow, it becomes zerogradient and if there is any inflow, we have to specify the value. Then what is the difference between two.
although your question is not completly clear for me, I will try to answer it by explaining some basics by CFD modelling:
So beginning with the equations :). When one does a CFD simulation, the equation of mass and impulse equlibrium should always be solved. One solves this equations within the computational domain, which practically is your discretized geometry. With the FEM or FVM we solve mostly boundary value problem and from here you can see the need to define values, gradients etc. at the boundaries. Now, if you have a problem, where material is flowing in your computational domain, you should know how much exactly is it. For this you should know the density, the cross section and the velocity. You are not able to calculate the mass flow without knowing the velocity. In the case of an outflow BC you can simply just you zerogradient condition. Why so? Because you now know, how much materia is flowing in and how much is already inside your computational domain. Hence you can simply solve the mass equlibrium and to find out how much should flow out of the domain. Making you of the zerogradient condition you can also calculate the velocity destributuion on the cross section of the outflow and make the solved problem explicit. I hope my explanation will help you!
Free-stream conditions are theoretically asymptotic but, as we work in a confined domain, we set some condition mimicking the asymptotic flow behavior.
Conversely, inlet/outlet conditions must specify that flow is entering or leaving the domain. Depending on the flow model compressible/incompressible and (in case of compressibility) on the Mach number, the way to set inflow/outflow BC.s can drastically change.
Basically, free-stream is used when you don't know for sure what is going on that boundary, you can have eigenvalues coming in or coming out of your computational domain. When you say that a given boundary is an inlet or an outlet, your a choosing a boundary condition which will correctly extrapolate properties from the inside or outside of the domain (depending if it is subsonic or supersonic boundary condition)
I'd recommend the reading of chapter 3 (The Mathematical Nature of the Flow Equations and their Boundary Conditions) from the book Numerical Computation Of Internal And External Flows by C. Hirsch. You will find a formal mathematical definition of most classic boundary conditions used in CFD.