|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 9 ![]() |
Hello everyone!
I am trying to give sinusoidal BC(Temperature) to a wall, I tried to use groovyBC but somehow it doesnt work. Wall is the left wall, so I tried to use pos().y/L inside sin function. Here is the BC that doesnt work. Code:
type groovyBC; value uniform 0; valueExpression "(311.3+A*sin(pos().y*pi/L))"; variables 2 ("A=5;" "L=6.69e-2;"); Eren. |
|
![]() |
![]() |
![]() |
![]() |
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
Rule of thumb: put at least as much work into the formulation of the question as you expect the other person to look at it. "Somehow it doesn't work" makes it a guessing game not a question for help and people usually go to this message board for the riddles The expression looks syntactically OK. Whether the constants fit your case is something I can't know. One thing that could cause a crash is "value uniform 0" as this value is used during initialization (before groovyBC had a chance to kick in) and depending on the the solver might lead to a crash during calculation of pressure or density. Make it "value uniform 331.3"
__________________
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 |
||
![]() |
![]() |
![]() |
![]() |
#3 | |
Member
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 9 ![]() |
Quote:
You are right, I should defined the "what" is the problem. The problem is, it does not crash, it just stays with the initial value. And according to your explanation, it is perfectly normal. I was just looking at the "initial" values to be sure it works since simulation takes too much time. I didnt knew that groovyBC takes action after initialization. Thank you very much for your time, Have a nice day. Eren. |
||
![]() |
![]() |
![]() |
![]() |
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
The reason is that during the construction of the boundary condition it is not sure that fields mentioned in the expressions are already constructed. Which would lead to a crash and users wouldn't be able to use perfectly reasonable expressions. With this groovyBC is usally evaluated the first time the variable is being solved for. Which usually is early enough. But there is an optional parameter evaluateDuringConstruction for groovyBC that forces an evaluation
__________________
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 |
||
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
divinegabriel
Join Date: Sep 2023
Posts: 1
Rep Power: 0 ![]() |
Your issue may be related to how you define variables in the code. You can try modifying the code as follows:
ini groovyBC { type groovyBC; variableName T; value uniform 0; valueExpression "(311.3+A*sin(pos().y*pi/L))"; variables "A=5" "L=6.69e-2"; } In this code, variableName is the name of the temperature variable in your model. Additionally, you should check other parameters in your model to ensure that they are set correctly and are consistent with the boundary condition you want to apply. play girls games
|
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question about adaptive timestepping | Guille1811 | CFX | 25 | November 12, 2017 17:38 |
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field | xiexing | CFX | 3 | March 29, 2017 10:00 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 17:11 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 06:28 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 07:00 |