|
[Sponsors] |
[swak4Foam] PatchValueExpressionDriver::evaluate |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 14, 2012, 14:18 |
PatchValueExpressionDriver::evaluate
|
#1 |
Member
Vitor Vasconcelos
Join Date: Jan 2012
Posts: 33
Rep Power: 14 |
Hello all,
I've been studying swak4foam and groovyBC source codes in order to implement a boundary condition in which I define a non-uniform profile in my patch. I did it using groovyBC and it works. Since I need this feature coded in a BC, I am trying to the same as groovyBC implementation. But I'm stucked in PatchValueExpressionDriverI.H file trying to figure out how the PatchResultExpressionDriver::evaluate method works. My question: after evaluating the expression, how (and where) groovyBC creates a patch with the calculated values and write it in the boundary condition? Thanks, Vitor |
|
December 14, 2012, 15:58 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
But the actual setting of the boundary condition (as in all BCs) happens in the updateCoeffs-method of the groovyBCFvPatchField
__________________
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 |
||
December 14, 2012, 16:19 |
|
#3 |
Member
Vitor Vasconcelos
Join Date: Jan 2012
Posts: 33
Rep Power: 14 |
Thanks for your reply.
But I think now I'm in trouble... I came to patchValueExpressionDriver because groovyBCFvPatchField::updateCoeffs() encapsulates its work doing: Code:
this->refValue() = driver_.evaluate<type>(this->valueExpression_); It's still a mystery for me how to be able to set a direction (like z) in my patch independent of its surface is structured or not. I'll keep seeking into the source code to realize, after parsing for example cos(pos().z), the cos function results are set into the patch. ANY suggestions are welcome. And thanks for your very fast reply! |
|
December 16, 2012, 20:22 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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 |
||
December 17, 2012, 08:36 |
|
#5 | |
Member
Vitor Vasconcelos
Join Date: Jan 2012
Posts: 33
Rep Power: 14 |
Quote:
I'm trying to check how this is done in groovyBC and my start point is: after parsing the expression value (I'm not interested in the parsing itself), how groovyBC come from an expression like Code:
cos(pos().z) Thanks for you valuable comments. I feel more confident I'm going in the right way. I'll let you know about my progress (probably you'll see more questions here before this progress I think...). Regards, Vitor |
||
December 17, 2012, 13:21 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
In order to be flexible groovyBC does certain things in a way that is more complicated than is necessary if you want to write your own hardcoded BCs. And understanding all these details is only necessary if you want to write a better version of the swak-parsers
__________________
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 |
||
December 17, 2012, 13:41 |
|
#7 | |
Member
Vitor Vasconcelos
Join Date: Jan 2012
Posts: 33
Rep Power: 14 |
Quote:
I've been through many different OpenFOAM BC's. But for some simple questions it's difficult to find answers. Answers which make things much simpler. For example, I took I lot of time to realize that I can use a fixedGradient class for my problem instead of more complex like mixed. (I hope, at least...) I'll check totalPressure. For instance, I found no way to initialize my patch values (or gradients) in a function profile correctly without doing it hard-coded. Moreover, since I'm trying to implement a very particular boundary condition simulating a fuel rod I don't want to leave more than the heat flux specification to the potential users of my BC. One more time, thanks again for your comments. Regards, Vitor |
||
|
|