CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   variable temperature boundary conditions (

kirankarki October 12, 2010 16:53

variable temperature boundary conditions
Hi, i am working on some heat transfer problems.
I want to set boundary condition as variable temperature that varies with time. Is it possible to do it in openFOAM? If so, whats the way to do it?
Thanks a lot,

akidess October 13, 2010 04:20

Yes, have a look at groovyBC.

kirankarki October 13, 2010 16:40

Hi Akidess, thanks for the link. I went through it. From the link, i guess i need to install bison and compile it and make changes in controlDict. But i didnot understand how to include input data of temperature as boundary condition that varies with time for whole year, probably the data to be fed with some spreadsheet. The same case might be for wind velocity. Would you please help me how to do it coz it didnt understand well about the procedures given in the link. May be because i am not a computer guy nor a mechanical guy. Any helps will be highly appreciated

flowman October 13, 2010 20:23

you can use the timeVaryingUniformFixedValue boundary condition, which is included with OF 1.6, to read time vs. T data from a file.

kirankarki October 14, 2010 12:53

Hi flowman,
Would you please elaborate how we can do it with steps to follow.

flowman October 14, 2010 18:43

Here's an example to setup a Time vs Pressure boundary condition on an inlet.

In the 0/p file the inlet boundary condition is specified as:

        type            timeVaryingUniformFixedValue;
        fileName        "$FOAM_CASE/time-series";
        outOfBounds    clamp;          // (error|warn|clamp|repeat)

The time-series file looks like:

(        0        9780000        )
(        1        8987606        )
(        2        8678701        )

kirankarki October 19, 2010 17:18

Hi Flowman,
Thanks for the guidance, i created time seris file under my solver which have now 24 temp data for 24 hours and did what u have mentioned. But there is still error which says the file is not there, may be i am wrong giving the file path in second line of your code :
fileName "$FOAM_CASE/time-series";

My time series file location as given in terminal is :
kiran@kiran-desktop:~/OpenFOAM/kiran-1.7.0/openfoam170/applications/solvers/incompressible/my_icoFoam$ ls
createFields.H Make my_icoFoam.C TEqn.H time-series

What should i give the fileName in the code?

Thanks a lot,

flowman October 20, 2010 01:21

It would probably be better if you kept the time-series file in the main case directory (where the 0, constant and system directories are). For the case you have, set the boundary condition to:

        type            timeVaryingUniformFixedValue;
        fileName        "~/OpenFOAM/kiran-1.7.0/openfoam170/applications/solvers/incompressible/my_icoFoam/time-series";
        outOfBounds    clamp;          // (error|warn|clamp|repeat)

kirankarki October 20, 2010 14:24

Hi flowman,
Thanks once again for the correct code, now it works and give the results. I got results until 0.5s based upon my time control. I believe to get the every hour results for all 24 hours , i need to change my time control file. I will do that later on.
Right now i am concerned with the temperature results. I think the results i got is for surface temperature. But my major concern is to examine the interior air space temperature assuming there is air inside the box. For that i need to first include air inside the box(may be for this time ,static air) and then mesh it to get the air space temperature results. Am i right?

Would you please give me some help how to include air inside closed box, mesh it and get the air space temperature from this solver?

Thanks a lot,

kirankarki October 20, 2010 17:47

Another concern Flowman,
i just tried to run the solver to get temp data for at least two hours so i made my endtime 7200, deltaT 1 and writeinterval 3600,
the terminal shows its running until time = 56, then it gets terminated with some error msgs, whats wrong with this time control? Pls help me to figure out so that i can run the simulation for whole day 24 hours to get results for whole day.
The error msg as shown in teriminal is :
Time = 57

Courant Number mean: 2.18665e+99 max: 2.00072e+101
DILUPBiCG: Solving for Ux, Initial residual = 0.999999, Final residual = 1.91919e-06, No Iterations 159
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam170/lib/linuxGccDPOpt/"
#1 Foam::sigFpe::sigFpeHandler(int) in "/opt/openfoam170/lib/linuxGccDPOpt/"
#2 Uninterpreted:
#3 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam170/lib/linuxGccDPOpt/"
in "/home/kiran/OpenFOAM/kiran-1.7.0/applications/bin/linuxGccDPOpt/my_icoFoam"
in "/home/kiran/OpenFOAM/kiran-1.7.0/applications/bin/linuxGccDPOpt/my_icoFoam"
#6 __libc_start_main in "/lib/tls/i686/cmov/"
in "/home/kiran/OpenFOAM/kiran-1.7.0/applications/bin/linuxGccDPOpt/my_icoFoam"
Floating point exception

All times are GMT -4. The time now is 16:21.