CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Convective Heat transfer in laplacianFoam (https://www.cfd-online.com/Forums/openfoam-pre-processing/204489-convective-heat-transfer-laplacianfoam.html)

Fridrik July 24, 2018 16:18

Convective Heat transfer in laplacianFoam
 
Hallo everyone

i'm simulating some fins in laplacianfoam, and would like to make a convective boundary condition, but i can't seem to find the right one to impose. Does anybody have any experience with such a BC - and can push me in the right direction ?

- Fridrik Magnusson

Fridrik July 25, 2018 04:49

Further investigation
 
Tobi [1] suggest to use "laserConvection"[2] but i dont really know what all the fields mean, if you guys has any ideas please fill me in

Code:

    myPatch
    {
        type            laserConvection; //Type of BC
        value          uniform 300;    //Unknown (maybe initial condition)

        HTCheating      150;            //Heat transfer cofficient at heating
        HTCquenching    150;            //Heat transfer cofficient at cooling

        TfH            300;            //Referance temperature at heating
        TfQ            300;            //Referance temperature at cooling

        heatingTime    10;              //Unknown (maybe the start time of heating/cooling)
        kValue          0;              //Unknown (maybe constant conduction)
    };


[1] https://www.cfd-online.com/Forums/op...ianfoam-4.html
[2] https://bitbucket.org/shor-ty/laserconvectionbc

simrego July 25, 2018 08:12

Hi!


Have you seen the convectiveHeatTransfer... BC? I think this is for flat plate, but if you know your equation for the nusselt number in your case (if not a flat plate), you can simply create your BC based on it (Just rewrite the equation and compile it).

https://cpp.openfoam.org/v6/classFoa...d.html#details


BTW the 1st unknown ("value") is the initial condition. I don't know the others, but you can check them in the code. (the beauty of OF.)

Fridrik July 25, 2018 09:48

Hi Simrego, i would like to decide the htc, then this might work. It seems like Nu, Re and Pr are calculated from a vectorfield, but im not that good at reading source files. Where does convectiveHeatTransfer get the Nu, Re and Pr from ?

simrego July 25, 2018 15:55

Re and Pr are calculated from the velocity, mat props, etc.

Pr, Re: line 136, 143.
https://cpp.openfoam.org/v6/convecti...8C_source.html


Nu is the ration between convective and conductive heat transfer: Nu = h * L / k, which can be written as:
h = Nu * k / L
You use this equation in line 145-152. Where the Nu is some fancy function depending on Pr, and Re, and the end of the equation you can find that multiplication with kappa, and division with L. In the code you can find it for flat plate (i think, i'm not sure, you should check it). You can find Nu for many applications on the internet.
So if you have something else (not flat plate), you should rewrite the code between line 145-152.

simrego July 25, 2018 16:03

Or i don't know what is your goal exactly, but maybe externalWallHeatFlux could be good for you:
https://cpp.openfoam.org/v6/classFoa...d.html#details
This is a boundary condition which can operate in three modes. Details in the link.

Fridrik July 25, 2018 16:28

Fixed h
 
Code:

dud
dud

Fridrik July 25, 2018 16:29

Fixed h
 
Hi again Simrego, thanks for your suggestions.

I think it is possible to make a rewrite the "convectiveHeatTransfer" to get the "htc" from the ./0/T BC something from:

Code:

{
        label celli = patch().faceCells()[facei];
 
        scalar Re = rhow[facei]*mag(Uc[celli] - Uw[facei])*L_/muw[facei];
 
        if (Re < 5.0E+05)
        {
            htc[facei] = 0.664*sqrt(Re)*cbrt(Pr[facei])*kappaw[facei]/L_;
        }
        else
        {
            htc[facei] = 0.037*pow(Re, 0.8)*cbrt(Pr[facei])*kappaw[facei]/L_;
        }
}


to

Code:

{
        label celli = patch().faceCells()[facei];
       
            htc[facei] = Get constant from file; //psudocode
}

Do you know how i can make a "link" to another file ?

If i use the "externalWallHeatFlux" like this

Code:


    internalSurface
    {
        type            externalWallHeatFluxTemperature;
    mode        coefficient;

        Ta        uniform 273;        // fluid temperature
        h        uniform 2000;    //convective heat rate
    thicknessLayers (0.1 0.2 0.3 0.4);  //unknown
    kappaLayers    (1 2 3 4);        // unknown

    kappaMethod    fluidThermo;  // unknown (Seems to be the cause for error)

    value        uniform 300;    // initial value

    }



i get the following error:

Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 6-e05f780ebc87
Exec  : laplacianFoam
Date  : Jul 25 2018
Time  : 22:17:45
Host  : "fridrik-VirtualBox"
PID    : 1624
I/O    : uncollated
Case  : /home/fridrik/OpenFOAM/HeatTransfer/Bracket
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


SIMPLE: No convergence criteria found

Reading field T

Reading transportProperties

Reading diffusivity DT

No finite volume options present

Calculating temperature distribution

Time = 0.005

--> FOAM FATAL ERROR:
kappaMethod defined to employ fluidThermo method, but thermo package not available

    From function Foam::tmp<Foam::Field<double> > Foam::temperatureCoupledBase::kappa(const scalarField&) const
    in file turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C at line 171.

FOAM exiting

What does this error mean ?

simrego July 25, 2018 16:52

1. what do you mean under "link to another file"?


2. You use laplacianFoam, you have no thermo package there.
Now I'm a bit lost, didn't noticed it cannot be used in laplacianFoam. The not so elegant but working solution can be if you use chtMultiRegion with only one region (maybe there are other solutions too)


3. I should did it much much earlier, but what is your problem description? What do you have, what do you want, etc.

Fridrik July 26, 2018 13:52

ill start from the back

3. I want to make a code which can generate the best cross sectional fin array, which must remain closed. By utilizing topology optimization.

https://imgur.com/a/kIjVbVW

Since working with very limited computational power. The i think the best starting point is to just solve the steady state heat equation for a 2-D cross section. Where the boundary convective condition is based on empirical approximations [Nu(Re,Pr)].
Step one will be to solve a basic case, by applying the correct BC which is what we are discussing :)
Step two will be to setup the topological stuff (which is really hard)

2. Ill look into using chtMultiRegion instead of laplacianFoam

1. i mean i want to reference to a constant maybe in transportProperties.

I hope this makes sense :)


All times are GMT -4. The time now is 03:05.