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/)
-   -   Fade-in fvOptions source (https://www.cfd-online.com/Forums/openfoam-programming-development/164957-fade-fvoptions-source.html)

potentialFoam January 6, 2016 07:42

Fade-in fvOptions source
 
Dear Foamers,

I would like to fade in a custom-made source term during the progress of the simulation. The momentum source is introduced with a new fvOptions-class.

I tried the following (for simpleFoam first):
The variable 'time' gives the time of the simulation and the variable 'factor' should be used to fade in the source term (after the fvOptions is switched to active after 100 iterations).
Code:

const Time& time = mesh().time();
scalar factor = min( (time - 100)/10, 1);

The errors show a conflict between the data types 'Time' and 'scalar' and for the min-function.

Questions:
- 1) Is there a better approach?
- 2) Should I 'convert' the 'Time'-type to sth. else?

Regards,
Peter

fumiya January 6, 2016 09:07

Hi,

You might want to read the following thread regarding your question #2:
http://www.cfd-online.com/Forums/ope...me-scalar.html

Best regards,
Fumiya

potentialFoam January 6, 2016 09:14

Dear Fumiya,

Thanks a lot!!


All times are GMT -4. The time now is 12:34.