Hi all,
I checked from the forum how to embed a data table for Elmer to use temperature dependent properties, e.g. density and thermal conductivity etc. I want to confirm the algorithm how Elmer is using these tables,
1. is interpolation used between each two data points?
2. how does Elmer treat temperature values beyond the range given in the table? Elmer will do extrapolation or just use the value at the range bound?
By the way, another small question which is not related is - I know, with the help of SaveScalars, Elmer can report quantity integral over a boundary, can Elmer report the area of a boundary using a similar way?
Thanks a lot for your help. Have a nice day!
Best regards,
http://code-saturne.blogspot.com/
How is Elmer using data table for temperature dependent prop
-
- Site Admin
- Posts: 4823
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: How is Elmer using data table for temperature dependent prop
Hi
1) Yes
2) Extrapolation
3) Yes, there should be an operator "area" (or something similar)
-Peter
1) Yes
2) Extrapolation
3) Yes, there should be an operator "area" (or something similar)
-Peter
Re: How is Elmer using data table for temperature dependent prop
Thanks a lot, Peter.raback wrote:Hi
1) Yes
2) Extrapolation
3) Yes, there should be an operator "area" (or something similar)
-Peter
2) Is there an option to use the values at the bounds? otherwise I think I can add two far-away data points beyond both bounds just with the values at the bounds.
3) if the operator is area, what is the variable? sorry if it is a stupid question.
Best regards,
salad
-
- Site Admin
- Posts: 4823
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: How is Elmer using data table for temperature dependent prop
Hi
2) No. You have to give the same value twice with some interval to get constant end value.
3) I think it may be any variable active on that surface. It is just used for masking i.e. if variable is not active then the element is not integrated over.
-Peter
2) No. You have to give the same value twice with some interval to get constant end value.
3) I think it may be any variable active on that surface. It is just used for masking i.e. if variable is not active then the element is not integrated over.
-Peter
Re: How is Elmer using data table for temperature dependent prop
Thanks a lot, Peter.
Can you advise if, for the Elmer algorithm, using data table is faster than using polynomial expressions fitted from the data? I found the speed difference in my calculation but I didn't test it completely, so I am not sure whether the conclusion is general or only valid for this particular case.
Thanks in advance.
Best regards,
salad
Can you advise if, for the Elmer algorithm, using data table is faster than using polynomial expressions fitted from the data? I found the speed difference in my calculation but I didn't test it completely, so I am not sure whether the conclusion is general or only valid for this particular case.
Thanks in advance.
Best regards,
salad
Re: How is Elmer using data table for temperature dependent prop
Hi Salad,
very probably so if you use MATC (an interpreted language, not in any way optimized
for speed whatsoever) to evaluate the polynomial. The table stuff is handled inside
ElmerSolver (fortran subroutine).
You could use a Fortran UDF instead of MATC expressions; might be a different story then.
Regards, Juha
very probably so if you use MATC (an interpreted language, not in any way optimized
for speed whatsoever) to evaluate the polynomial. The table stuff is handled inside
ElmerSolver (fortran subroutine).
You could use a Fortran UDF instead of MATC expressions; might be a different story then.
Regards, Juha
Re: How is Elmer using data table for temperature dependent prop
Thanks a lot, Juha.
It is interesting to know MATC has such a performance problem. To my opinion embedded MATC expressions in sif file are even more convenient to use.
Do you also mean the way using data tables has almost the same performance with the fortran udf approach?
Thanks.
Regards, salad
It is interesting to know MATC has such a performance problem. To my opinion embedded MATC expressions in sif file are even more convenient to use.
Do you also mean the way using data tables has almost the same performance with the fortran udf approach?
Thanks.
Regards, salad
Re: How is Elmer using data table for temperature dependent prop
Hi,
i'd expect the UDF to outperform the table lookup, both usually fast enough though.
Juha
i'd expect the UDF to outperform the table lookup, both usually fast enough though.
Juha
Re: How is Elmer using data table for temperature dependent prop
Thanks a lot for the information, Juha.
salad
salad
Re: How is Elmer using data table for temperature dependent prop
Hej!
I am defining my "Temperature Dependent" material proprieties using Fortran UDF functions. It is well explained in Chapter 13: Basic Programming p.85-87. I could run y = f(a, b,...) functions with not that much trouble.
Since I have quite a lot of data in "table shape" I would like to run the Interpolation Function implemented in MATC. Is there somewhere I could get a similar script in Fortran? It would be much more efficient if I do not write it myself.
Best Regards,
/Xavier Borras
I am defining my "Temperature Dependent" material proprieties using Fortran UDF functions. It is well explained in Chapter 13: Basic Programming p.85-87. I could run y = f(a, b,...) functions with not that much trouble.
Since I have quite a lot of data in "table shape" I would like to run the Interpolation Function implemented in MATC. Is there somewhere I could get a similar script in Fortran? It would be much more efficient if I do not write it myself.
Code: Select all
!-------------------------------------------------------------------------------
! File: fluid_prop.f90
! Written by: XB, 17 April 2015
! Modified by: -
!-------------------------------------------------------------------------------
FUNCTION GetDynVisc_Mobil1_0W40 (Model, n, dt, temp) RESULT(dyn_visc)
! Modules needed
USE DefUtils
IMPLICIT NONE
! Variables in function header
!TYPE(Solver_t) :: Solver
TYPE(Model_t) :: Model
INTEGER :: n
REAL(KIND=dp) :: dt, temp, dyn_visc
! Variables needed inside the function
REAL(KIND=dp) :: refVisc, C
LOGICAL :: GotIt !Found
TYPE(ValueList_t), POINTER :: material
!TYPE(Element_t), POINTER :: Element
! Get Pointer on the list for material
write(*,*) '*****START OF GetDynVisc_Mobil1_0W40*****'
!Element => GetActiveElement (n)
!material => GetMaterial(Element, Found)
material => GetMaterial()
IF(.NOT. ASSOCIATED(material))THEN
CALL Fatal ('GetDynVisc_Mobil1_0W40', 'No material found')
END IF
! Read in reference viscosity
refvisc = GetConstReal(material, 'Reference Viscosity', GotIt)
IF(.NOT. GotIt) THEN
CALL Fatal ('GetDynVisc_Mobil1_0W40', 'refVisc not found')
END IF
! Read in parameter C
C = GetConstReal(material, 'Parameter C', GotIt)
IF(.NOT. GotIt) THEN
CALL Fatal ('GetDynVisc_Mobil1_0W40', 'Parameter C not found')
END IF
write(*,*) '***** Reading of Parameters OK! *****'
! Compute dynamic viscosity
IF (temp <= 0.0D00) THEN !Check for physical reasonable temperature
CALL Warn('GetDynVisc_Mobil1_0W40','Negative absolute temperature')
CALL Warn('GetDynVisc_Mobil1_0W40','Using viscosity reference value')
dyn_visc = refVisc
ELSE
dyn_visc = refVisc * EXP(C *(2.93D02/temp - 1.0D00))
END IF
END FUNCTION GetDynVisc_Mobil1_0W40
/Xavier Borras
Last edited by xborras7 on 17 Apr 2015, 14:45, edited 1 time in total.