

how i can add the scale function in open foam
hello everyone
please how i can add a function to the differential equation in openfoam, especially the scale function,
like here
: fvm::ddt(T) - (1/(1+dfra(T)*Lat/(CP*eT)))*fvm::laplacian(DT, T) == fvOptions(T)
i can't difinde (dfra(T))
the function what i want add it is this:
int fraction(int n);
using namespace std;
double dfra (double a)
{
double r;
if(a>-0.5 && a<+0.5)
r=1;
else r=0;
return r;
}
Thank you
OpenFOAM


Hi, You can use the pos & neg functions for your case. Please find the link below for details.
https://openfoam.com/documentation/guides/latest/doc/openfoam-guide-expression-syntax.html
Regards,
Ashley
https://openfoam.com/documentation/guides/latest/doc/openfoam-guide-expression-syntax.html
Regards,
Ashley


the 'non-GUI' post-processing tools have Function objects can be listed by running a solver with the -listFunctionObjects option, e.g. volScalarFields for the Xi-based combustion models. add: Add a list of a field by a scale factor; streamFunction: Writes the steam-function.


I thought this was going to be some boring old post, but it really compensated for my time. www.emondagesaint-sauveur.com
Login to add comment