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

[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2010, 08:36
Default
  #181
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15
alfa_8C is an unknown quantity at this point
...problem solved!

since alphaEff = alphat (turbulent alpha) + alpha (laminar alpha),

and alphat as well as alpha is defined as volsclarfield in and thus present, the groovyBC expression can be modified as follows:

SURFACE_SOURCE
{
type groovyBC;
value uniform 283;
valueExpression "283";
gradientExpression "gradT";
fractionExpression "0";
variables "heatFlux=0.00000001;Cp0=1005;rho0=1.18;gradT=heat Flux/((alphat + alpha) * Cp0 * rho0);";
timelines (
);
}

thanx for the hint regarding the connection of alphaEff to turbulence models - it led me to the solution!
Tony
JR22 likes this.
alfa_8C is offline   Reply With Quote

Old   December 3, 2010, 05:37
Default groovy and turbulent boundary condition
  #182
Member
 
Yashar Afarin
Join Date: May 2010
Location: Toronto- Canada
Posts: 40
Rep Power: 16
yashar.afarin is on a distinguished road
Send a message via Skype™ to yashar.afarin
Hi bernhard,

I am using pisofoam and I want to model a three dimentional free turbulent planar jet with large eddy simulation. in inlet I want to use turbulentinlet for velocity fluctuations generation also I want to specify an equation for mean velocity with groovyBC but for each of them I must use their specific type.
can I use both of them at the same time? what I must specify as "type"?

I would appreciate any help
sincerely yours
yashar.afarin is offline   Reply With Quote

Old   December 3, 2010, 10:12
Default
  #183
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 yashar.afarin View Post
Hi bernhard,

I am using pisofoam and I want to model a three dimentional free turbulent planar jet with large eddy simulation. in inlet I want to use turbulentinlet for velocity fluctuations generation also I want to specify an equation for mean velocity with groovyBC but for each of them I must use their specific type.
can I use both of them at the same time? what I must specify as "type"?

I would appreciate any help
sincerely yours
I'm afraid this is not possible with vanilla groovyBC. You can write a boundary condition that uses the groovyBC engine and link it to your solver (just write a class groovyTurbulentInlet that inherits from turbulentInlet, sets the fields according to expressions then calls the superclass for the actual evaluation). Easy .... if you have done that kind of thing before
gschaider is offline   Reply With Quote

Old   December 4, 2010, 04:20
Default groovy and turbulent boundary condition
  #184
Member
 
Yashar Afarin
Join Date: May 2010
Location: Toronto- Canada
Posts: 40
Rep Power: 16
yashar.afarin is on a distinguished road
Send a message via Skype™ to yashar.afarin
>>just write a class groovyTurbulentInlet that inherits from turbulentInlet, sets the fields according to expressions then calls the superclass for the actual evaluation.

Hi Bernhard,

thanks for your response. unfortunately, I have not done that yet so I would appreciate it if you could give me more details.

sincerely yours,
Yashar
yashar.afarin is offline   Reply With Quote

Old   December 4, 2010, 04:24
Default
  #185
Member
 
Yashar Afarin
Join Date: May 2010
Location: Toronto- Canada
Posts: 40
Rep Power: 16
yashar.afarin is on a distinguished road
Send a message via Skype™ to yashar.afarin
Quote:
Originally Posted by gschaider View Post
>>just write a class groovyTurbulentInlet that inherits from turbulentInlet, sets the fields according to expressions then calls the superclass for the actual evaluation.
Hi Bernhard,

thanks for your response. unfortunately, I have not done that yet so I would appreciate it if you could give me more details.

sincerely yours,
Yashar
yashar.afarin is offline   Reply With Quote

Old   December 6, 2010, 06:25
Default
  #186
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 yashar.afarin View Post
>>just write a class groovyTurbulentInlet that inherits from turbulentInlet, sets the fields according to expressions then calls the superclass for the actual evaluation.

Hi Bernhard,

thanks for your response. unfortunately, I have not done that yet so I would appreciate it if you could give me more details.

sincerely yours,
Yashar
Sorry. I currently don't have time for more than the sketchy answer above.

If your average velocity doesn't chnage over time you might want to try funkySetBoundaryField from the swak-suite

Bernhard
gschaider is offline   Reply With Quote

Old   December 6, 2010, 11:25
Default
  #187
Member
 
Yashar Afarin
Join Date: May 2010
Location: Toronto- Canada
Posts: 40
Rep Power: 16
yashar.afarin is on a distinguished road
Send a message via Skype™ to yashar.afarin
Quote:
Originally Posted by gschaider View Post
Sorry. I currently don't have time for more than the sketchy answer above.

If your average velocity doesn't chnage over time you might want to try funkySetBoundaryField from the swak-suite

Bernhard
Hi Bernhard

thank you for your reply.
I am trying to write a new boundary condition with those applications.
my velocity is constant over time. do you think that funkySetBoundaryField can be used in turbulent flow?

Regards,
Yashar
yashar.afarin is offline   Reply With Quote

Old   December 6, 2010, 17:54
Default
  #188
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 yashar.afarin View Post
Hi Bernhard

thank you for your reply.
I am trying to write a new boundary condition with those applications.
my velocity is constant over time. do you think that funkySetBoundaryField can be used in turbulent flow?
Yes it can. funkySetBoundaryField just sets entries of the dictionary of a boundary condition to calculated, non-uniform values. It doesn't care what the physics are.

Have a look at the example that comes with swak

Bernhard
gschaider is offline   Reply With Quote

Old   December 6, 2010, 22:37
Default
  #189
New Member
 
Join Date: Dec 2010
Posts: 4
Rep Power: 15
abhi25_itbhu is on a distinguished road
Hey,

I am a new user of OpenFoam 1.7.1. I am interested in wave simulation using OpenFoam.
I came through this groovyBC utility recently. As illustrated on the "contrib groovyBC" wiki page, I was able to download the libraries for the groovyBC case....

I dowloaded the full "groovyBC" folder in the following directory:

..../OpenFOAM-1.7.1/applications/solvers/groovy/groovyBC

Then I ran the "wmake libso" command; which I think worked fine as it didn't produce any error message.

Now, I tried to run demo cases in the Demos folder but I couldn't.
For example, for the case pulsedPitzDaily, I was able to create a mesh using blockMesh, but in the next step when I ran the simulation using oodles (application: oodles in ControlDict file) command, I found the following error:

oodles: command not found

I think I am doing sth wrong at this step.
Please help me out....I appreciate your help in advance.

Regards,

Abhishek
abhi25_itbhu is offline   Reply With Quote

Old   December 7, 2010, 15:43
Default
  #190
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 abhi25_itbhu View Post
Hey,

I am a new user of OpenFoam 1.7.1. I am interested in wave simulation using OpenFoam.
I came through this groovyBC utility recently. As illustrated on the "contrib groovyBC" wiki page, I was able to download the libraries for the groovyBC case....

I dowloaded the full "groovyBC" folder in the following directory:

..../OpenFOAM-1.7.1/applications/solvers/groovy/groovyBC

Then I ran the "wmake libso" command; which I think worked fine as it didn't produce any error message.

Now, I tried to run demo cases in the Demos folder but I couldn't.
For example, for the case pulsedPitzDaily, I was able to create a mesh using blockMesh, but in the next step when I ran the simulation using oodles (application: oodles in ControlDict file) command, I found the following error:

oodles: command not found

I think I am doing sth wrong at this step.
Please help me out....I appreciate your help in advance.

Regards,

Abhishek
oodles is now pisoFoam
HenningW likes this.
gschaider is offline   Reply With Quote

Old   December 21, 2010, 08:38
Default
  #191
New Member
 
Andreas Schwärzle
Join Date: Sep 2010
Posts: 6
Rep Power: 16
chantre is on a distinguished road
Hi,

I am trying to use the groovy BC to create an Inlet, where a uniform velocity-field should change randomly for every time-step within a certain range. Since the function randNormal() gives a random skalar field, I get a non-uniform velocity distribution.
Is it possible to use rand() or randNormal() to get a single random skalar?

INLET
{
type groovyBC;
variables "uMin=0.9*vector(13,0,0);deltaU=0.2*vector(13,0,0) ;";
valueExpression "uMin+randNormal()*deltaU";
value uniform (13 0 0);
}

Thanks in advance for your help
/Andreas
charmc likes this.
chantre is offline   Reply With Quote

Old   December 22, 2010, 05:25
Default
  #192
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 chantre View Post
Hi,

I am trying to use the groovy BC to create an Inlet, where a uniform velocity-field should change randomly for every time-step within a certain range. Since the function randNormal() gives a random skalar field, I get a non-uniform velocity distribution.
Is it possible to use rand() or randNormal() to get a single random skalar?

INLET
{
type groovyBC;
variables "uMin=0.9*vector(13,0,0);deltaU=0.2*vector(13,0,0) ;";
valueExpression "uMin+randNormal()*deltaU";
value uniform (13 0 0);
}

Thanks in advance for your help
/Andreas
My first impulse would have been min(rand()), max(rand()) and average(rand()) but that would give approxiamtey 0, 1 and 0.5.

The only way I can think of would be to (I know this means some extra computation) take the value from only one cell and use it for all. Something like (havn't tried it and I'm not quite sure whether id() is in the regular groovyBC-distro or only in the swak-variant):

variables "singleRandom=max(id()==0?rand():-1);";
gschaider is offline   Reply With Quote

Old   January 4, 2011, 01:13
Default
  #193
Senior Member
 
J. Cai
Join Date: Apr 2009
Posts: 180
Rep Power: 17
chiven is on a distinguished road
Hi, Bernhard, happy new year. Thank you for the contribution. Is the GroovyBC able to be used in OpenFOAM Version 1.7.1?

Thanks a lot,
Chiven
chiven is offline   Reply With Quote

Old   January 4, 2011, 06:27
Default
  #194
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 chiven View Post
Hi, Bernhard, happy new year. Thank you for the contribution. Is the GroovyBC able to be used in OpenFOAM Version 1.7.1?

Thanks a lot,
Chiven
You mean "plain" groovyBC? Yep. The 1.6-version works to my knowledge with the current OF-version (personally I use the version that comes with swak4Foam which should be as stable)

Bernhard
gschaider is offline   Reply With Quote

Old   February 1, 2011, 11:23
Default
  #195
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
I'm trying to write a boundary condition in groovyBC that requires the tangential gradient of the associated field. Is it possible to calculate a gradient on a patch face (not an snGrad)?
akidess is offline   Reply With Quote

Old   February 2, 2011, 10:47
Default
  #196
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 akidess View Post
I'm trying to write a boundary condition in groovyBC that requires the tangential gradient of the associated field. Is it possible to calculate a gradient on a patch face (not an snGrad)?
Sorry no. The fvPatchField only voluntarily gives away the snGrad.

The only way I could think of would be to calculate the gradient for the whole field (expensive!) beforehand and then getting the patch value for that field. Calculation of that gradient-Field could be done with the expressionField-functionObject from swak4Foam but as this is only done at the end of a time-step it will probably lag behind. So if this is an issue for you you'll probably have to modify the solver

Bernhard
gschaider is offline   Reply With Quote

Old   February 2, 2011, 14:31
Default
  #197
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Thanks Bernhard. I actually noticed that after posting and went on to look if I could calculate a gradient of fvPatchField in the code, but that's far from trivial. fvc::grad works on GeometricFields / volMeshes, but since patches aren't directly related to either I'd have to come up with a whole new machinery to do this. The easy way out is (just as you said) to calculate the gradient for the entire field, and that seems to be a common solution from what I found on the forums.
akidess is offline   Reply With Quote

Old   February 2, 2011, 17:57
Default
  #198
Member
 
Join Date: Nov 2010
Posts: 54
Rep Power: 16
usergk is on a distinguished road
Hi

I am new to OpenFoam, and was trying to implement the groovyBC in the XiFoam/pitzDaily case, for OF 1.7.1.
I installed and compiled the groovy BC, and used the following in the 0/T file (for wall heat transfer):

upperWall
{
type groovyBC;
variables "htot=100.0;Tinf=298.15;rho=2700.0;cp=900.0;k=DT*r ho*cp;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))";
}
lowerWall
{
type groovyBC;
variables "htot=100.0;Tinf=298.15;rho=2700.0;cp=900.0;k=DT*r ho*cp;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))";
}

However, I got the following error:

attempt to use janafThermo<equationOfState> out of temperature range 200 -> 5000; T = 0

Any ideas why this could be happening?

gk
usergk is offline   Reply With Quote

Old   February 3, 2011, 04:36
Default
  #199
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
How did you initialize the internal field?
akidess is offline   Reply With Quote

Old   February 3, 2011, 08:44
Default
  #200
Member
 
Join Date: Nov 2010
Posts: 54
Rep Power: 16
usergk is on a distinguished road
Hi

Thanks for your reply.

Here is the 0/T file:

dimensions [ 0 0 0 1 0 0 0 ];

internalField uniform 293;

boundaryField
{
inlet
{
type fixedValue;
value uniform 293;
}
outlet
{
type inletOutlet;
inletValue uniform 293;
value uniform 293;
}
upperWall
{
type groovyBC;
variables "htot=100.0;Tinf=298.15;rho=2700.0;cp=900.0;k=DT*r ho*cp;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))";
}
lowerWall
{
type groovyBC;
variables "htot=100.0;Tinf=298.15;rho=2700.0;cp=900.0;k=DT*r ho*cp;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))";
}
frontAndBack
{
type groovyBC;
variables "htot=100.0;Tinf=298.15;rho=2700.0;cp=900.0;k=DT*r ho*cp;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))";
}
}

Please note that I have also changed frontAndBack boundary type from 'cyclic' to 'wall' so that I could give the groovyBC; the upperWall and lowerWall are also of boundary type 'wall'.

When I change the BC at the walls to fixedValue (isothermal BC) simulations seem to run fine.

Thanks,
gk
usergk 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
Ship resistance shows wiggles when using Overset mesh and dynamic mesh in Fluent Qingsong FLUENT 2 March 21, 2022 16:08
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
[ICEM] Dynamic mesh setup with ICEM David121284 ANSYS Meshing & Geometry 0 April 11, 2014 05:19
Dynamic Mesh "Shadow Wall" thezack FLUENT 0 June 4, 2013 23:09
dynamic mesh for drop interface IndrajitW FLUENT 0 March 30, 2013 09:03


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