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

Fade-in fvOptions source

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By fumiya

Reply
 
LinkBack Thread Tools Display Modes
Old   January 6, 2016, 08:42
Default Fade-in fvOptions source
  #1
Member
 
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 37
Rep Power: 3
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, 10:07
Default
  #2
Senior Member
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 199
Blog Entries: 1
Rep Power: 9
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.
__________________
fumiya is offline   Reply With Quote

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

Thanks a lot!!
potentialFoam is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Pre-Processing 24 August 23, 2015 22:41
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 11:32
funkySetFields compilation error tayo OpenFOAM 39 December 3, 2012 06:18
Version 15 on Mac OS X gschaider OpenFOAM Installation 120 December 2, 2009 11:23
Compiling gmshFoam with OpenFOAM-1.5 BlGene Open Source Meshers: Gmsh, Netgen, CGNS, ... 10 August 6, 2009 04:26


All times are GMT -4. The time now is 07:05.