CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] groovyBC in openFoam 230 (https://www.cfd-online.com/Forums/openfoam-community-contributions/141091-groovybc-openfoam-230-a.html)

imani August 30, 2014 07:34

groovyBC in openFoam 230
 
hi dear formers
i use groovyBC boundary condition im a case
my T bc in a boun is :
Code:

    ceiling
    {
        type            groovyBC;
        refValue        uniform 295;
        refGradient    uniform 0;
        valueFraction  uniform 1;
        value          uniform 295;
        valueExpression "263";
        gradientExpression "0";
        fractionExpression "pos().x > 3.88 && pos().x < 4.12 && pos().y > 2.88 && pos().y < 3.12 ? 1 : 0";
        evaluateDuringConstruction 0;
        variables      "";
        timelines      ();
        lookuptables    ();
    }

and velocity bc is :
Code:

    ceiling
    {


        type            groovyBC;
        refValue        uniform (0 0 0);
        refGradient    uniform (0 0 0);
        valueFraction  uniform 1;
        value          uniform (0 0 0);
        valueExpression "vector(0,pos().x > 3.88 && pos().x < 4.12 && pos().y > 2.88 && pos().y < 3.12 ? -0.347 : 0 ,0)";
        gradientExpression "vector(0,0,0)";
        fractionExpression "1";
        evaluateDuringConstruction 0;
        variables      "";
        timelines      ();
        lookuptables    ();

    }

my problem is that T bc is correctly done ...but velocity bc ignored!! and not considered !!! where is the problem?
thanks alot

gschaider September 1, 2014 11:48

Quote:

Originally Posted by imani (Post 508438)
hi dear formers
i use groovyBC boundary condition im a case
my T bc in a boun is :
Code:

    ceiling
    {
        type            groovyBC;
        refValue        uniform 295;
        refGradient    uniform 0;
        valueFraction  uniform 1;
        value          uniform 295;
        valueExpression "263";
        gradientExpression "0";
        fractionExpression "pos().x > 3.88 && pos().x <  4.12 && pos().y > 2.88 && pos().y < 3.12 ? 1 : 0";
        evaluateDuringConstruction 0;
        variables      "";
        timelines      ();
        lookuptables    ();
    }

and velocity bc is :
Code:

    ceiling
    {


        type            groovyBC;
        refValue        uniform (0 0 0);
        refGradient    uniform (0 0 0);
        valueFraction  uniform 1;
        value          uniform (0 0 0);
        valueExpression "vector(0,pos().x > 3.88 && pos().x  < 4.12 && pos().y > 2.88 && pos().y < 3.12 ?  -0.347 : 0 ,0)";
        gradientExpression "vector(0,0,0)";
        fractionExpression "1";
        evaluateDuringConstruction 0;
        variables      "";
        timelines      ();
        lookuptables    ();

    }

my problem is that T bc is correctly done ...but velocity bc ignored!! and not considered !!! where is the problem?
thanks alot

Looks alright from my side. What do you mean with not considered? What I do to make sure that expressions are really used is introduce errors into them. If they don't fail swak doesn't see them. Also comment out options and change the type of the BC to see whether your spec is even used (maybe a regexp-BC "shadows" it)

imani September 7, 2014 08:07

how to simulate a room with constant heat flux and groovyBC?
 
hi dear formers
excuse me
i have a question about wall heat Flux
i want to simulate a room with constant heat flux in it's wall
i write my T folder by groovyBc
but i dont have information about gradT and wallGrad T and wallHeatyFlux\what should i write in them?
thanks

wyldckat September 7, 2014 15:25

Greetings imani,

I saw the PM you sent me and I came looking for any public questions you had made on this topic.

Could you please provide more specific information? Because I'm not understanding what exactly you want or have already tried.

Preferably it would be best if you could share an example case you're trying to configure. If you cannot provide your own case, use the tutorial case "heatTransfer/buoyantPimpleFoam/hotRoom" from OpenFOAM and modify it the same way you've modified yours.

Best regards,
Bruno

imani September 8, 2014 03:16

...
 
hi again
it is my T folder
i have a room that i hav constant heat flux from it's wall
and i have two windows with constant heat flux
my windows have 2mm gap that air input from it to room

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 295;

boundaryField
{
    floor
    {
      type            fixedValue;
      value            uniform 263;
    }
    ceiling
    {
      type            groovyBC;
      variables    "Kceiling=10;Qceiling=-60;"// taken from table 3
      valueExpression "263"; //263 is air inlet tempareture
      gradientExpression "Qceiling/Kceiling";// consider the rest of celing insulated
      fractionExpression "pos().x > 3.88 && pos().x < 4.12 && pos().y > 0.5 && pos().y < 0.74 ? 1 : 0";
      value          uniform 295;

    }
    fixedWall-1
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qwall/Kwall";
      fractionExpression "0";
      value          uniform 295;
    }
    fixedWall-2
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qwall/Kwall";
      fractionExpression "0";
      value          uniform 295;
    }
    fixedWall-3
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qwall/Kwall";
      fractionExpression "0";
      value          uniform 295;
    }
    fixedWall-4
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qwall/Kwall";
      fractionExpression "0";
      value          uniform 295;
    }
    skiriting
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qskr/kskr";
      fractionExpression "0";
      value          uniform 295;

    }
    windows
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qglazing/Kglazing";
      fractionExpression "0";
      value          uniform 295;
    }
    darz
    {
      type            fixedValue;
      value            uniform 263;
    }

}

// ************************************************************************* //


gschaider September 9, 2014 09:30

Quote:

Originally Posted by imani (Post 509449)
hi again
it is my T folder
i have a room that i hav constant heat flux from it's wall
and i have two windows with constant heat flux
my windows have 2mm gap that air input from it to room

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 295;

boundaryField
{
    floor
    {
      type            fixedValue;
      value            uniform 263;
    }
    ceiling
    {
      type            groovyBC;
      variables    "Kceiling=10;Qceiling=-60;"// taken from table 3
      valueExpression "263"; //263 is air inlet tempareture
      gradientExpression "Qceiling/Kceiling";// consider the rest of celing insulated
      fractionExpression "pos().x > 3.88 && pos().x < 4.12 && pos().y > 0.5 && pos().y < 0.74 ? 1 : 0";
      value          uniform 295;

    }
    fixedWall-1
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qwall/Kwall";
      fractionExpression "0";
      value          uniform 295;
    }
    fixedWall-2
    {
      type            groovyBC;
      variables    "Kwall=8.3;Kglazing=8.3;Qwall=-35;Qglazing=-105;Qskr=300;kskr=8.3;";// taken from table 3
      gradientExpression "Qwall/Kwall";
      fractionExpression "0";
      value          uniform 295;
    }

<<snip>>

Looks OKish to me (Of course as always: signs might be wrong). Are you having any problems or why are you asking?

Anyway: You can remove a bit of redundancy by reusing similar information (but that is not groovyBC-specific, but general OpenFOAM):
Code:

    fixedWall-2
    {
          $fixedWall-1;
    }
  skiriting
  {
          $fixedWall-1;
          gradientExpression "Qskr/kskr";
    }


imani September 10, 2014 10:03

please answer me
 
hi dear formers
it is fixed flux bc for temperature

Code:

/*type            groovyBC;
      variables    "Kceiling=0.25;Qceiling=-10;";// taken from table 3
      valueExpression "263"; // temperature of skiriting heater
      gradientExpression " Qceiling/Kceiling";//
      fractionExpression " 0";
      value          uniform 295;*/

i have a wall with constant het flux bc

what should be k?

what is the scale of it?
q is w/m2


in other words the scale of gradientExpression or fixedGrdaient in openFoam is "k" or "k/m"

thanks

imani September 12, 2014 02:46

wallHeatFlux
 
hi dear formers
i ave one question about constant wallHeatFlux bc
i am modelling a computational room with negative constant heat flux in it's walls by groovyBC
but when i check my results i saw that temperature distribution not change and is like the initial condition for temperature...
for different heat fluxes i have same results
where is my mistake?

my solver is buoyantBossinesqueSimpleFoam and my bc for one of walls is like bellow:

Code:

        type            groovyBC;
        value          uniform 295;
        valueExpression "295";
        gradientExpression "gradT";
        fractionExpression "0";
    variables "heatFlux=1000;Cp0=1000;rho0=1.2;gradT=heatFlux/(kappaEff * Cp0 * rho0);";

thanks alot
imani

imani September 12, 2014 08:16

is there no one to help me?

imani September 12, 2014 08:59

hi dear baran
excuse me that i ask a question
i want to simulate heat transfer from a wall wth constant heat flux
my solver is buoyantBossinesqueSimple Foam
but when i use this bc....the temperature of room for every heat flux is equal initial condition .... i use this two bc for constant heat flux

Code:

            type            turbulentHeatFluxTemperature;
            heatSource      flux;        // power [W]; flux [W/m2]
            q              uniform -96;  // heat power or flux
            alphaEff        kappaEff;    // alphaEff field name;
                                      // alphaEff in [kg/m/s]
            Cp              Cp;          // Cp field name; Cp in [J/kg/K]
            value          uniform 295; // initial temperature value

or

Code:

        type            groovyBC;
        value          uniform 295;
        valueExpression "295";
        gradientExpression "gradT";
        fractionExpression "0";
        variables "heatFlux=-34.56;Cp0=1000;rho0=1.2;gradT=heatFlux/(kappaEff * Cp0 * rho0);";

where is the problem?

wyldckat September 13, 2014 13:10

Greetings to all!

@Imani: It is considerably hard to help you when you're posting in so many threads and providing insufficient information on each thread. If you had followed the instructions given on this thread: http://www.cfd-online.com/Forums/ope...-get-help.html - I believe we would have already been able to help you several weeks ago.

I've moved all of your posts on this topic into this single thread, so that it would make it a bit easier to diagnose what's going on. Unfortunately, the combined amount of information you've provided is only very basic. Therefore, me or anyone else who doesn't have a similar case, will have to create my/his/her own test case to try and figure out what you might be doing wrong.

If in the next 24 hours you can follow the instructions indicated here: http://www.cfd-online.com/Forums/ope...-get-help.html - then I can still help you this weekend. If not, I will only be able to try and create my own test case next weekend, namely in 7 days time.

Best regards,
Bruno

Mojtaba.a September 13, 2014 16:23

Dear Zohreh,

As Bruno told try to be more specific about your problem.
The procedure is quite simple,
If I could understood correctly you can do this simply by:

Code:

        type            fixedGradient;
        gradient      uniform 100;

In which gradT=heatFlux/k_fluid, in which k_fluid is the heat conductivity of the fluid.
Value of 100 is chosen for sample.

imani September 14, 2014 01:00

thanks dear mojtaba
i want to simulate heat transfer in aroom with baseBoard heating system
baseboard has positive constant heat flux and my walls have negative constant heat flux
i used groovy BC boundary condition that is similar fixedGradient
but i dont know why my temperature profile is wrong
when i run with 100 heatFlux my temperature profile in room is similar for the case that flux=1000 or 150 or 300
just difference between these case is that my skiriting surface temperature for higher fluxes is bigger!!!!
thanks alot for your attention

Mojtaba.a September 14, 2014 13:05

Quote:

Originally Posted by imani (Post 510249)
thanks dear mojtaba
i want to simulate heat transfer in aroom with baseBoard heating system
baseboard has positive constant heat flux and my walls have negative constant heat flux
i used groovy BC boundary condition that is similar fixedGradient
but i dont know why my temperature profile is wrong
when i run with 100 heatFlux my temperature profile in room is similar for the case that flux=1000 or 150 or 300
just difference between these case is that my skiriting surface temperature for higher fluxes is bigger!!!!
thanks alot for your attention

Dear Zohreh,

Well so many things van cause such problems.
As I understood again there is no need for groovyBC (Of course it is a lot more capable than this), Try simplify your case.
I am not sure what skirting temperature is. If you can, share your case to see if I can take a look at it.

Best.

imani September 15, 2014 03:28

1 Attachment(s)
ok i send my case

Mojtaba.a September 15, 2014 03:31

Quote:

Originally Posted by imani (Post 510333)
ok i send my case

Please send the complete case file including 0, constant and system or any other related.

imani September 15, 2014 03:46

1 Attachment(s)
hi ok i send you my case

imani September 15, 2014 03:57

internt have problem
i will send you soon

imani September 15, 2014 04:05

1 Attachment(s)
ok
now i send all

wyldckat April 6, 2015 07:25

Greetings to all!

I've had this thread on my to-do list for a long time already and only today did I manage to finally look into it.

But it's been so long, that I have to ask: Motjaba and Imani, have Imani's questions already been solved in private conversations?

Best regards,
Bruno


All times are GMT -4. The time now is 18:27.