|
[Sponsors] |
coded fixed value with time dependent if-statement |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 326
Rep Power: 7 ![]() |
hi all,
i am trying to code a boundary condition for velocity with an if-statement, that should be evaluated at every iteration step: Code:
outlet_np { type codedFixedValue; value uniform (0 0 0); name ControlledFixedValue; code #{ // scalar value = ..read from object registry, calculated in every time step.. scalar actualVelocity; if(value <= 0.05) { actualVelocity=highVelocity; }else { actualVelocity=normalVelocity; }; const vector x0(0, -1, 0); operator==( x0 * actualVelocity ); #}; } is there a way that the if-statement is evaluated at every iteration step? cheers |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 326
Rep Power: 7 ![]() |
i fixed it with
operator==(a<=b? c:d) |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 04:13 |
Setting up Lid driven Cavity Benchmark with 1M cells for multiple cores | puneet336 | OpenFOAM Running, Solving & CFD | 11 | April 7, 2019 00:58 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 11:08 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 07:09 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 07:56 |