CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Why is "fluxRequired" run time selectable? (https://www.cfd-online.com/Forums/openfoam-solving/109186-why-fluxrequired-run-time-selectable.html)

koad November 11, 2012 20:18

Why is "fluxRequired" run time selectable?
 
I have been using OpenFOAM for a few months now and have found the "flux" method for fvMatrix equations useful. And I understand that to use "flux" I have to list the fields for which the flux is to be generated in the "fluxRequired" subdictionary of the fvSchemes. And I understand that it costs CPU time to calculate the fluxes, so that you might only want to calculate it for certain fields.

What I don't understand is why fluxRequired is run time selectable. If the "flux" method is used in the code to get the flux for a field, say "p", the code will crash if "p" is not listed in the fluxRequired subdictionary. So there is nothing to select. Either "p" is listed under fluxRequired and the code runs, or "p" is missing and the code crashes. There doesn't seem to be any other options. So why make it run time selectable?

It seems to me that the "fluxRequired" variable ought to be set in the code, perhaps when the field is created, rather than in the fvSchemes file. Is there any way to do this?

Thanks for the help!

sylvester November 22, 2012 08:47

Hi Brian,

I agree. This construct has never seen sensible to me.

Sylvester

Quote:

Originally Posted by koad (Post 391535)
I have been using OpenFOAM for a few months now and have found the "flux" method for fvMatrix equations useful. And I understand that to use "flux" I have to list the fields for which the flux is to be generated in the "fluxRequired" subdictionary of the fvSchemes. And I understand that it costs CPU time to calculate the fluxes, so that you might only want to calculate it for certain fields.

What I don't understand is why fluxRequired is run time selectable. If the "flux" method is used in the code to get the flux for a field, say "p", the code will crash if "p" is not listed in the fluxRequired subdictionary. So there is nothing to select. Either "p" is listed under fluxRequired and the code runs, or "p" is missing and the code crashes. There doesn't seem to be any other options. So why make it run time selectable?

It seems to me that the "fluxRequired" variable ought to be set in the code, perhaps when the field is created, rather than in the fvSchemes file. Is there any way to do this?

Thanks for the help!



All times are GMT -4. The time now is 17:09.