|
[Sponsors] |
[swak4Foam] have considered using condition in SWAK functions? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 7, 2013, 03:11 |
have considered using condition in SWAK functions?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
i want to know applying conditions on time in SWAK function postProcessing is applicable or not?(in one time period have one expression to be calculated and another expression in another time period)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
July 7, 2013, 10:24 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
How about giving an example of what you want to do, already in code? Best regards, Bruno
__________________
|
|
July 20, 2013, 13:11 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi Bruno
like this: Code:
totalPressure_left { type swakExpression; valueType patch; patchName left; accumulations ( average ); variables ( "gamma1=1.4;" "gamma2=1.35;" "R=287.14;" ); expression "time()<.002 ? sum(p*(pow(1+(gamma1-1)/2*magSqr(U)/(gamma1*R*T),(gamma1/(gamma1-1))))*rho*area())/sum(rho*area()) : sum(p*(pow(1+(gamma2-1)/2*magSqr(U)/(gamma2*R*T),(gamma2/(gamma2-1))))*rho*area())/sum(rho*area())"; verbose true; outputControlMode outputTime; outputInterval 1; }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
July 21, 2013, 09:16 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
Sorry, no time to test this myself. My guess is that if you can add 2 fields directly on the resulting expression, then you should be able to use a condition as well. Best regards, Bruno
__________________
|
|
July 22, 2013, 18:18 |
|
#5 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
- both expression have to give the same result type otherwise the parser will throw up (can't switch from vector to scalar) - internally BOTH expressions are evaluated, but only the one that fits the condition is used (apart from taking a bit more time this can lead to problems if the expression that is not used with the current condition is mathematically invalid. "log(time()-0.002)" in your example for instance) Quote:
__________________
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 |
Time dependant pressure boundary condition | yosuke1984 | OpenFOAM Verification & Validation | 3 | May 6, 2015 06:16 |
Velocity profile boundary condition | Tuca | FLOW-3D | 1 | April 23, 2013 12:02 |
No-slip condition for non-resolved boundary layer in open channel banks | Lupocci | Main CFD Forum | 1 | January 17, 2013 03:11 |
about the implemention of periodic boundary condition | harbinyg | Main CFD Forum | 5 | July 12, 2012 04:30 |
Boundary condition clarification | shaswat | CFX | 1 | April 8, 2012 04:06 |