CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] groovyBC in openFoam 230

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Mojtaba.a

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2014, 08:34
Default groovyBC in openFoam 230
  #1
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
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

Last edited by wyldckat; September 13, 2014 at 13:49. Reason: Added [CODE][/CODE]
imani is offline   Reply With Quote

Old   September 1, 2014, 12:48
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by imani View Post
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)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

Last edited by wyldckat; September 13, 2014 at 13:50. Reason: Added [CODE][/CODE]
gschaider is offline   Reply With Quote

Old   September 7, 2014, 09:07
Default how to simulate a room with constant heat flux and groovyBC?
  #3
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
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
imani is offline   Reply With Quote

Old   September 7, 2014, 16:25
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   September 8, 2014, 04:16
Default ...
  #5
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
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;
    }

}

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

Last edited by wyldckat; September 13, 2014 at 13:51. Reason: Added [CODE][/CODE]
imani is offline   Reply With Quote

Old   September 9, 2014, 10:30
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by imani View Post
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";
    }
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

Last edited by wyldckat; September 13, 2014 at 13:52. Reason: Added [CODE][/CODE]
gschaider is offline   Reply With Quote

Old   September 10, 2014, 11:03
Default please answer me
  #7
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
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

Last edited by wyldckat; September 13, 2014 at 13:52. Reason: Added [CODE][/CODE]
imani is offline   Reply With Quote

Old   September 12, 2014, 03:46
Default wallHeatFlux
  #8
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
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

Last edited by wyldckat; September 13, 2014 at 13:53. Reason: Added [CODE][/CODE]
imani is offline   Reply With Quote

Old   September 12, 2014, 09:16
Default
  #9
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
is there no one to help me?
imani is offline   Reply With Quote

Old   September 12, 2014, 09:59
Default
  #10
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
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?

Last edited by wyldckat; September 13, 2014 at 13:55. Reason: Added [CODE][/CODE]
imani is offline   Reply With Quote

Old   September 13, 2014, 14:10
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   September 13, 2014, 17:23
Default
  #12
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
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.
wyldckat likes this.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   September 14, 2014, 02:00
Default
  #13
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
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
imani is offline   Reply With Quote

Old   September 14, 2014, 14:05
Default
  #14
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by imani View Post
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.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   September 15, 2014, 04:28
Default
  #15
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
ok i send my case
Attached Files
File Type: gz 0.tar.gz (3.0 KB, 12 views)
imani is offline   Reply With Quote

Old   September 15, 2014, 04:31
Default
  #16
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by imani View Post
ok i send my case
Please send the complete case file including 0, constant and system or any other related.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   September 15, 2014, 04:46
Default
  #17
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
hi ok i send you my case
Attached Files
File Type: gz system.tar.gz (1.9 KB, 10 views)
imani is offline   Reply With Quote

Old   September 15, 2014, 04:57
Default
  #18
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
internt have problem
i will send you soon
imani is offline   Reply With Quote

Old   September 15, 2014, 05:05
Default
  #19
Member
 
zohreh imani nejad
Join Date: Feb 2014
Location: gonabad
Posts: 55
Rep Power: 12
imani is on a distinguished road
ok
now i send all
Attached Files
File Type: gz constant.tar.gz (14.2 KB, 8 views)
imani is offline   Reply With Quote

Old   April 6, 2015, 08:25
Default
  #20
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Started with OpenFOAM wyldckat OpenFOAM 26 June 21, 2024 07:54
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 16:54
UNIGE February 13th-17th - 2107. OpenFOAM advaced training days joegi.geo OpenFOAM Announcements from Other Sources 0 October 1, 2016 20:20
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 04:18
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07


All times are GMT -4. The time now is 20:56.