CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLOW-3D (https://www.cfd-online.com/Forums/flow-3d/)
-   -   How to input gaussian heat source in flow3d? (https://www.cfd-online.com/Forums/flow-3d/98980-how-input-gaussian-heat-source-flow3d.html)

huanglin8545 March 22, 2012 22:25

How to input gaussian heat source in flow3d?
 
Hello, I am trying to simulate a MIG welding pool model using flow3d . I need to use a 2D Gaussian heat source but I don't know how to define it or the expression to use.I don't know how to input it,could you help me?
Thanks!

MuxaB April 16, 2012 13:49

Quote:

Originally Posted by huanglin8545 (Post 351029)
Hello, I am trying to simulate a MIG welding pool model using flow3d . I need to use a 2D Gaussian heat source but I don't know how to define it or the expression to use.I don't know how to input it,could you help me?
Thanks!

there is no standard feature to do it. you will have to modify the FORTRAN routine HEATFL to define a spatially varying heat source

huanglin8545 April 16, 2012 23:02

flow3d input gaussion heat
 
Thank you so much.I need more help.I modify the soubroutine HEATFL.F ,how can I set variables in prepin.inp to call this modified soubroutine ?Besides,are there any differences between HEATFL and HEATOB ?

MuxaB April 16, 2012 23:40

Quote:

Originally Posted by huanglin8545 (Post 355020)
Thank you so much.I need more help.I modify the soubroutine HEATFL.F ,how can I set variables in prepin.inp to call this modified soubroutine ?Besides,are there any differences between HEATFL and HEATOB ?

1. HEATFL IS FOR FLUID SOURCES AND HEATOB IS FOR SOURCES INSIDE SOLID.
2. THERE ARE DUMMY VARIABLES, DUM1,...,DUM25 PLUS DUMMY ARRAYS, INTEGER AND REAL, THAT YOU ARE DEFINE IN THE NAMELIST XPUT TO BE USED IN HEATFL. MAKE SURE DUMN.F IS INCLUDED AT THE TOP.
3. HEATFL IS ALWAYS CALLED WHEN HEAT TRANSFER IS ON.

WHAT VERSION ARE YOU RUNNING? IF 10, THEN YOU NEED 11.1 Intel FORTRAN compiler, if an earlier one, then 9.1.

huanglin8545 April 17, 2012 21:10

flow3d input gaussion heat
 
Thank you very much for your helpful reply.Now I am confused for some details.Could you help me?
1.MAKE SURE DUMN.F IS INCLUDED AT THE TOP.You mean in the HEATFL.F I must write DUMN.F at the top of the subroutine like this: include'..\comdeck\dumn.for'?
2.My running version is 9.3.2,can I use FTN95 (Fortran 95 for Windows)to compile it?
3.When I modify the HEATFL.F,do I just add the fortran code at the end of the souroutine HEATFL.F ?
4.If I modified HEATFL.F,is it necessary to compile HEATFL.F to HEATFL.obj,and save them in HYDR3D?
Thank you!

MuxaB April 17, 2012 22:00

Quote:

Originally Posted by huanglin8545 (Post 355260)
Thank you very much for your helpful reply.Now I am confused for some details.Could you help me?
1.MAKE SURE DUMN.F IS INCLUDED AT THE TOP.You mean in the HEATFL.F I must write DUMN.F at the top of the subroutine like this: include'..\comdeck\dumn.for'?
2.My running version is 9.3.2,can I use FTN95 (Fortran 95 for Windows)to compile it?
3.When I modify the HEATFL.F,do I just add the fortran code at the end of the souroutine HEATFL.F ?
4.If I modified HEATFL.F,is it necessary to compile HEATFL.F to HEATFL.obj,and save them in HYDR3D?
Thank you!

1. Correct, but DUMN.F, not DUMN.FOR
2. Wow, that's old. yes, FORTRAN 95 is fine but it should be Compaq Visual FORTRAN on Windows or Intel 9.1 for Linux
3. Yes
4. If you use MS Visual Studio or make files provided with the installation, then it will take care of compiling and linking and code. The manual has a chapter on that.

huanglin8545 April 18, 2012 05:34

flow3d input gaussion heat
 
Thank you so much.Let me try it.You help me a lot.Thanks again.

huanglin8545 April 19, 2012 23:10

flow3d input gaussion heat
 
Thank you for your help.Now I have some problems to consult you.Could you help me?
In order to input gaussion heat source ,I modified the HEATFL.F by
ftn95 like this :

subroutine heatfl(i,j,k,heatfl1,heatfl2)
c
c add heat sources to fluid
c
c ************************************************** *************
c ** notice **
c ** this subprogram contains flow science, inc. proprietary **
c ** trade secret and confidential information. **
c ** **
c ** unauthorized use prohibited **
c ** copyright 1985-2008 flow science, inc. **
c ************************************************** *************
c
use arrays_module
c
use meshcb_module
c
use obsijk_module
c
#ifdef SINGLE
include '../comdeck/precis4.f'
#else
include '../comdeck/precis.f'
#endif
include '../comdeck/params.f'
include '../comdeck/cntrl.f'
include '../comdeck/const.f'
include '../comdeck/diag.f'
include '../comdeck/logvar.f'
include '../comdeck/obsd.f'
include '../comdeck/bcinfo.f'
include '../comdeck/acctrm.f'
include '../comdeck/scala.f'
include '../comdeck/state.f'
include '../comdeck/dumn.f'
c
c i,j,k = current cell indices
c heatfl1 = heat source for fluid 1
c heatfl2 = heat source for fluid 2
c
c heatfl1,2 is thermal energy per unit mass of fluid material
c per unit time (or power per unit mass)
c
heatfl1=zero
heatfl2=zero
c
ccc include '../comdeck/ijk.f'
c
return
end
c heatin is the gaussion heat source
c r is the size of the gaussion heat source
r=SQRT(i**2+j**2)
heatin=(dum1/2*pi*dum2**2)*EXP(-0.5*r**2/dum2**2)
k=dum3
if(dum3=0.027)
then heatfl1=heatin
endif
I just want to input the heat source on the X-Y surface,and Z=0.027.I don't think it is wrong,but it couldn't compile.I don't know why?
Thanks

hamedsheikh January 29, 2024 05:44

Gaussian heat flux code heatfl.F flow-3d
 
Quote:

Originally Posted by huanglin8545 (Post 355737)
Thank you for your help.Now I have some problems to consult you.Could you help me?
In order to input gaussion heat source ,I modified the HEATFL.F by
ftn95 like this :

subroutine heatfl(i,j,k,heatfl1,heatfl2)
c
c add heat sources to fluid
c
c ************************************************** *************
c ** notice **
c ** this subprogram contains flow science, inc. proprietary **
c ** trade secret and confidential information. **
c ** **
c ** unauthorized use prohibited **
c ** copyright 1985-2008 flow science, inc. **
c ************************************************** *************
c
use arrays_module
c
use meshcb_module
c
use obsijk_module
c
#ifdef SINGLE
include '../comdeck/precis4.f'
#else
include '../comdeck/precis.f'
#endif
include '../comdeck/params.f'
include '../comdeck/cntrl.f'
include '../comdeck/const.f'
include '../comdeck/diag.f'
include '../comdeck/logvar.f'
include '../comdeck/obsd.f'
include '../comdeck/bcinfo.f'
include '../comdeck/acctrm.f'
include '../comdeck/scala.f'
include '../comdeck/state.f'
include '../comdeck/dumn.f'
c
c i,j,k = current cell indices
c heatfl1 = heat source for fluid 1
c heatfl2 = heat source for fluid 2
c
c heatfl1,2 is thermal energy per unit mass of fluid material
c per unit time (or power per unit mass)
c
heatfl1=zero
heatfl2=zero
c
ccc include '../comdeck/ijk.f'
c
return
end
c heatin is the gaussion heat source
c r is the size of the gaussion heat source
r=SQRT(i**2+j**2)
heatin=(dum1/2*pi*dum2**2)*EXP(-0.5*r**2/dum2**2)
k=dum3
if(dum3=0.027)
then heatfl1=heatin
endif
I just want to input the heat source on the X-Y surface,and Z=0.027.I don't think it is wrong,but it couldn't compile.I don't know why?
Thanks

Hello
I have the same problem and I put the same code in Flow-3d version 11.0.4 software and replaced it. But the software does not read the code. I wanted to see if the problem is with the code or the software settings should be changed?
Can anyone help me?


All times are GMT -4. The time now is 22:57.