using boundary condition in uds
Hello everyone,
I have a problem regarding using the boundary condition in an UDS I need to make the following equation in UDS0 :- ∇UDS0=-ρ(T)*J ∇J=0 ∇[-1/ρ(T) *∇UDS0]=0 Quote:
∆V=∇UDS0+∇UDS1 I=∆V/R J=I/(face area) For which made the code :- Quote:
'voltage_function' must return a value I wanted to know how to use this 'J' in UDS0 and whats wrong in this code, since it is a boundary condition. I hope the doubt is understandable. Please suggest me a way to solve this. Thank you |
Quote:
You do not need to create functions for everything; it appears that creating the functions are complicating things (in particular, you are sending the face temperature to the voltage_function on line 46). Instead, you could write out your equations with one line each. For example, if your equations were: then your code would look like: Code:
dV = F_UDSI(f,t,0) + F_UDSI(f,t,1); Code:
J = (F_UDSI(f,t,0) + F_UDSI(f,t,1))/R/A; |
Yes I think the problem was with the scalar and vector. Now its working .
But my main problem was using this 'J' in UDS0 which I am still not getting. ∇UDS0=-ρ(T)*J How can I import the J value to UDS0? |
use DEFINE_SOURCE macros to define J
best regards |
Thanks for your reply. But it was something different and I got it.:)
|
While loading the code I am getting the error received a fatal signal (Segmentation fault)
I have also tried to solve this using link https://www.cfd-online.com/Forums/fl...ion-fault.html But it didnt work. I am still getting the error. UDF is as follows :- Quote:
|
Quote:
best regards |
Quote:
Also, should the evaluation for J (line 24) be within the second face loop? What equation are you applying on the boundary? |
Hello guys, I know this thread is a bit old. But I wanted to ask you guys to elaborate on how to implement the J term. As sahoo stated, the J term is a boundary but based on the reference it's a specified flux boundary for UDS0.
Mr. AlexanderZ said that we could use DEFINE_SOURCE macro but since the J term is actually a flux term. I still don't get the idea of how to implement J term in UDS0. Best regards. Thank you. |
you may specify boundary flux using define_profile macro, as sahoo did.
check his code above. there could be a lot of reasons, why he had that error, code may not be a problem the only this to be changed in code: was Code:
J = (F_UDSI(f,t,teg) + F_UDSI(f,t,teg1))/R/At; Code:
|
I was thinking that this thread is not active anymore. I opened another thread with similar topic.
Thank you for your reply. Yes, i figured the code after quite a time. Yes, I also had error like sahoo did. I also figured the solution. Basically, when it's applied on boundary, the profile udf need to read temperature profile from the boundary which is not exist yet at the initial condition. So to fix the error you need to use standard initialization specifying temperature. After this, the error just gone. However, I have another question. If I want to specifiy the flux at a boundary like this. Should I use the area of the whole boundary or just the face at every loop? Since the loop is being done on faces. |
don't really get your question
flux is in unit/m2. for instance you can apply heat -> flux is W/m2 to get total applied energy you need integral over whole boundary -> W/m2 * m2 = W |
A boundary is consist of multiple faces, right? So I'm thinking that each faces has its own flux value. And total flux on that boundary would be integral of flux values from multiple faces on the boundary.
Let's say a boundary consist of 50 faces with different heat flux values. So total flux on that boundary would be sum of 50 different heat flux values. Each of those 50 faces has its own flux values. So from what I understand, to calculate flux value from one specific face, we need to divide heat by area of that specific face only, right? I'm a little bit confused because from the code sahoo made. I think he was trying to divide scalar value with sum of area of the entire boundary on each loop which contradict my understanding on calculating flux. I hope you understand my point. Nevertheless, thank you for all your reply. Best regards. |
as far as I understand, for your case with 50 faces, you should divide total heat flux on total area of boundary (area of all 50 faces), and apply it to each face
|
All times are GMT -4. The time now is 06:44. |