CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   how to avoid strange keywords (https://www.cfd-online.com/Forums/openfoam-programming-development/194615-how-avoid-strange-keywords.html)

gaza October 19, 2017 17:04

how to avoid strange keywords
 
Hi All,
I coded function
Code:

tmp<volVectorField> fun()
{
    return tmp<volVectorField>
            (
                  fvc::div(rho1/rho2*B*B*G*G)
            );
};

and when I run the solver I got this message like
Code:

keyword div((((rho1|rho2)*B*B*G*G) is undefined in fvSchemes
how to avoid this?

guin October 20, 2017 03:23

Try following in Solver:

Code:

fvc::div(rho1/rho2*B*B*G*G,"weirdDivergenceTerm")
and in fvSchemes:

Code:

weirdDivergenceTerm Gauss upwind; //as an example

gaza October 20, 2017 05:25

Hi Rodrigo,
Thank you so much, it works :)


All times are GMT -4. The time now is 13:20.