|
[Sponsors] |
Time varying surfaceNormalFixedValue BC with codeStream |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 28, 2013, 11:31 |
Time varying surfaceNormalFixedValue BC with codeStream
|
#1 |
Senior Member
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17 |
Dear Foamers,
I would like to change the value of the surfaceNormalFixedValue inlet velocity according to the current time step. I want to build a simple ramped inlet condition using the surfaceNormalFixedValue BC. But I got stuck when I want to access the current time step using codeStream. My code is as follows: Code:
"Inlet" { type surfaceNormalFixedValue; uBegin -0.0011968512; uEnd -0.023937024; it0 50; iter #calc "runTime.time().value()"; refValue uniform #calc "max($uEnd,$uBegin + (($uEnd-$uBegin)/$it0)*$iter)"; } Code:
: In function ‘void Foam::codeStream_511e83c811264e2205bc04185da775a50640cef3(Foam::Ostream&, const Foam::dictionary&)’: :0:8: error: ‘runTime’ was not declared in this scope make: *** [Make/linux64GccDPOpt/codeStreamTemplate.o] Error 1 Thank you very much Regards Francois |
|
March 29, 2013, 04:55 |
|
#2 |
Senior Member
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17 |
I've tried with
Code:
this->db().time().value() |
|
April 5, 2013, 15:19 |
|
#3 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
this->patch().mesh().time().value() Code:
type groovyBC; variables ( "uBegin=-0.0011968512;" "uEnd=-0.023937024;" "it0=50;" ); valueExpression "normal()*max(uEnd,uBegin+((uEnd-uBegin)/it0)*time())"; One note: getting the time seems like quite a common task to me. I'd suggest that you guys do a collection of this and similar snipplets (possibly on the Wiki) for the coded-way. This way I will stop bothering anyone with "come to the dark side, Luke"-postings
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 05:13 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |
Problem with FloatingObject | Leech | OpenFOAM Running, Solving & CFD | 10 | March 29, 2012 16:24 |
Modeling in micron scale using icoFoam | m9819348 | OpenFOAM Running, Solving & CFD | 7 | October 27, 2007 01:36 |