0
$\begingroup$

is there a way to add a user defined convergence criteria to an ode solver so that the solution is stopped?

I know that Matlab uses absolute and relative tolerances but would that suffice in solving CFD equations or is a user-defined criteria needed?

Thank you.

$\endgroup$
3
  • 1
    $\begingroup$ Solving CFD equations essentially boils down to solving discretized ODE's, the absolute and relative tolerances should suffice. Typically you want mass to be conserved so you want the tolerance on the residuals of the continuity equations to be low ($\sim 10^{-6}$). If i may be so direct, i would not solve CFD problems using Matlab unless using Mex files or the GPU functions, Matlab is simply not efficient enough for that. $\endgroup$
    – nluigi
    Commented Dec 10, 2015 at 22:36
  • $\begingroup$ thank you. in what way is it not efficient? I am only using it for one dimensional laminar problems. $\endgroup$
    – melody
    Commented Dec 10, 2015 at 23:16
  • $\begingroup$ that will be fine, but going into higher dimensions you will need to move away from interpreted languages like Matlab to more dedicated compiled codes like in C/C++, Fortran, Cuda etc $\endgroup$
    – nluigi
    Commented Dec 10, 2015 at 23:30

1 Answer 1

1
$\begingroup$

I think that this can be achieved using ODE Events. You can define your custom function(s)/expression(s) that will be evaluated and can terminate the solution process – thus serving as a custom convergence criterion/criteria.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.