Variable Temperature for internal Body

Numerical methods and mathematical models of Elmer
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

Variable Temperature for internal Body

Post by gos »

Hello,

I'm on Elmer 7.0.

I have a domain where air (with Conductivity Ka) surrounds a water pipe. I want to be able to vary the Temperature of the Water. For speed, I want to use a userfunction (DLL) to vary the temperature. Can this be done as follows:

Code: Select all

  
Temperature = Variable Time
Real Procedure "UserFunctions.dll" "getWaterTemperature"
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Variable Temperature for internal Body

Post by mzenker »

Hi,

the syntax for the sif file is correct as far as I see. Of course, it also depends on the contents of your UDF... ;)

HTH,

Matthias
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

Re: Variable Temperature for internal Body

Post by gos »

mzenker wrote:Hi,

the syntax for the sif file is correct as far as I see. Of course, it also depends on the contents of your UDF... ;)

HTH,

Matthias
Thanks Matthias,

I forgot to indicate that I thought of using the statement within a Body Force statement :

Code: Select all

Body 1
 ! Pipe Water
  Body Force = 1
  ...
End

Body Force 1
  Temperature = Variable Time
  Real Procedure "UserFunctions.dll" "getWaterTemperature"
End

The getWaterTemperature UserFunction will take the Time as the first parameter, and return the Temperature.
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Variable Temperature for internal Body

Post by annier »

Hi gos,
Please refer Elmer Models Manual in Heat Solver
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
There in Body Force Section, I don't see the keyword Temperature. Rather there are keywords Temperature lower limit and Temperature upper limit.
So, the UDF definition in SIF depends on the availability of the keyword in code.
For example,the "Temperature" in boundary can be varied with time using FunctionDirichletBoundary condition you have mentioned above.


Yours Sincerely
Anil Kunwar
Last edited by annier on 04 Sep 2015, 16:52, edited 1 time in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

Re: Variable Temperature for internal Body

Post by gos »

annier wrote:Hi gos,
Please refer Elmer Models Manual in Heat Solver
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
There in Body Force Section, I don't see the keyword Temperature. Rather there are keywords Temperature lower limit and Temperature upper limit.
So, the UDF definition in SIF depends on the availability of the keyword in code.

Yours Sincerely
Anil Kunwar
Thanks,
However, in this posting: viewtopic.php?f=7&t=3396
Temperature is indeed used within a Body Force section....
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Variable Temperature for internal Body

Post by annier »

Hi gos,
Yes it says that we can use Temperature as the body force and in Solver.Keywords file the following keywords are present:

Code: Select all

BodyForce:Real:     'Temperature Condition'
BodyForce:Real:     'Temperature Load'
BodyForce:Real:     'Temperature Lower Limit'
BodyForce:Real:     'Temperature Passive'
So, you will be using

Code: Select all

Body Force 1
Temperature Load = Variable time
...
End 
The temperature body force (source term in the RHS of the partial differential equation) may be nodal so the word "load" follows the variable "temperature".
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

Re: Variable Temperature for internal Body

Post by gos »

annier wrote:Hi gos,
Yes it says that we can use Temperature as the body force and in Solver.Keywords file the following keywords are present:

Code: Select all

BodyForce:Real:     'Temperature Condition'
BodyForce:Real:     'Temperature Load'
BodyForce:Real:     'Temperature Lower Limit'
BodyForce:Real:     'Temperature Passive'
So, you will be using

Code: Select all

Body Force 1
Temperature Load = Variable time
...
End 
The temperature body force (source term in the RHS of the partial differential equation) may be nodal so the word "load" follows the variable "temperature".

Thanks annier.

Some years since I developed my original model, so have forgotten a some Elmer how-to's. Looking into the Keywords file is one trick I had forgotten.

Since the (simplified) Temperature is the same for all Nodes within the Water Pipe is assumed to be the same, I will simply return how the Temperature varies with time.

Does that seem reasonable?
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

Re: Variable Temperature for internal Body

Post by gos »

Hello,

Strangely, the keyword "Load" must NOT be there for this to work. With the keyword Load in place, my simulations do not converge any more. (Previously I have used a Fixed Temp for the Pipe Water, using an Initial Condition and a very high Heat Capacity to get a constant temp)

However, when I remove "Load", things work

Code: Select all

Body Force 1
Temperature  = Variable time
...
End
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

Re: Variable Temperature for internal Body

Post by gos »

The question now is:

How can I turn off the Temperature Body Force after a given amount of time from my User Function DLL?

Anyone have any clue? @Elmer Team ?
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Variable Temperature for internal Body

Post by annier »

Hi gos,
If the keyword "Temperature" solves it, then it can be used there at the place.
Why don't you use MATC function to define the body force?

Code: Select all

Temperature = Variable time
Real MATC "f(tx)"

Yours Sincerely
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Post Reply