CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Fade-in fvOptions source

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By fumiya

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2016, 07:42
Default Fade-in fvOptions source
  #1
Member
 
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 10
potentialFoam is on a distinguished road
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
potentialFoam is offline   Reply With Quote

Old   January 6, 2016, 09:07
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
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 likes this.
__________________
[Personal]
fumiya is offline   Reply With Quote

Old   January 6, 2016, 09:14
Default
  #3
Member
 
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 10
potentialFoam is on a distinguished road
Dear Fumiya,

Thanks a lot!!
potentialFoam is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 10:03
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 11:32
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 05:18
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 BlGene OpenFOAM Meshing & Mesh Conversion 10 August 6, 2009 04:26


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