/**
* Returns the first portion of a string, nicely trimmed to finish on a whole word or sentence etc. An indicator can be specified such as
* '...' which would be added to the string if it was shortened.
*
* @param string $string The string which you would like to return a snippet of
* @paran int $max_length The maximum number of characters to return a snippet of (not including the $indicator)
* @param string $indicator Additional characters to append to the string if it is shortened (eg '...') [optional]
* @param string $search_char The character to search for the last occurance of (eg ' ' to end on a whole word [optional]
*
* @return string Returns the snippet of the string with additional indicator if the string was trimmed and
* one was specified
*/
function snippet($string, $max_length, $indicator=' ', $search_char=' ') {
if(strlen($string)>$max_length) {
return substr($string,0,strrpos(substr($string,0,$max_length),' ')).$indicator;
} else {
return $string;
}
}
?>
Computational Fluid Dynamics (CFD) is a branch of fluid mechanics that uses numerical methods and algorithms to solve and analyse problems that involve fluid flows. Super computers are used to perform the calculations required to simulate the interaction of liquids with surfaces defined by boundary conditions.
Computational Fluid Dynamics can offer a cost effective analysis for initial design reviews. Where a large scale physical model would be required to ensure similarity is maintained between full scale prototype and model, the use of a physical model can become uneconomical.