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   June 14, 2010, 15:05
Default
  #141
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Quote:
Originally Posted by gschaider View Post
I think the scripts make pretty clear what should be done. If you don't understand them (which is OK, your job is CFD) go to your sysadmin. If your sysadmin has a problem with them: get a new sysadmin

Bernhard
Thanks Bernhard, I would try this later today.

Regards.
ovie is offline   Reply With Quote

Old   June 14, 2010, 18:05
Default
  #142
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Getting an object-file from a bison/flex-grammar is a two-step process:
1. bison/flex translates the grammar into a .c and .h file
2. the c-compiler compiles those files

Usually an out of date bison produces in step 1 a C-file that doesn't compile in step 2.
In groovyBC and funkySetFields both steps are done by one rule.
So the idea is to compile groovyBC on machine A with a working bison. Then copy the generated C/H-files to machine B. Modify Make/files there to skip bison/flex and directly compile the C-files.
For an example have a look at the sources of funkySetFields. The script getGenerated.sh is basically what should be done on machine A (filenames are slightly different). Script insertGenerated.sh is what should be done on machine B.
I think the scripts make pretty clear what should be done. If you don't understand them (which is OK, your job is CFD) go to your sysadmin. If your sysadmin has a problem with them: get a new sysadmin

Bernhard
Thanks. It worked just fine!

Ovie.
ovie is offline   Reply With Quote

Old   June 15, 2010, 07:36
Default
  #143
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 ovie View Post
Thanks. It worked just fine!

Ovie.
Great. As you said in that other posting

Quote:
Originally Posted by ovie
Please could you be more specific on how this can be done? Some of us dont just have a clue
You were speaking in first person plural: could I ask you to add a small description of the procedure to the Wiki-page of groovyBC for the benefit of the others. Obviously my descriptions seem not to be clear to everyone and who would be qualified better to explain to others than one who just did the transition from mystification to enlightenment

Bernhard
gschaider is offline   Reply With Quote

Old   June 15, 2010, 14:16
Default
  #144
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Great. As you said in that other posting



You were speaking in first person plural: could I ask you to add a small description of the procedure to the Wiki-page of groovyBC for the benefit of the others. Obviously my descriptions seem not to be clear to everyone and who would be qualified better to explain to others than one who just did the transition from mystification to enlightenment

Bernhard
Bernhard,

I just did!
I hope my very puny addition would provide some relief to many struggling "others" like myself. The "others" here represents the "us" in my previous comment.
In any case, many thanks to you for this truly important addition to OpenFOAM.

Regards
ovie is offline   Reply With Quote

Old   June 16, 2010, 05:17
Default
  #145
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 ovie View Post
I just did!
I hope my very puny addition would provide some relief to many struggling "others" like myself. The "others" here represents the "us" in my previous comment.
Great. Involvment with OpenSource always starts with "puny additions"
gschaider is offline   Reply With Quote

Old   August 4, 2010, 10:30
Default
  #146
Senior Member
 
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16
Daniele111 is on a distinguished road
Hi
Is possible use groovyBc to impose a log velocity bundary condition on a surface? I already used it I imposed a log profile along a linlet line in a 2D case. In a 3D case what is the correct syntax? I found that the error source is U inlet boundary condtion, I would impose a log profile on inlet patch:

inlet
{

type groovyBC;
variables "yc=pos().y;minYc= min(yc);Ustar=0.612;kappa=0.41;para=-(Ustar/kappa)*log((pos().y + 0.001)/(0.001))*normal();";
valueExpression "para";
//type fixedValue;
//value uniform (10 0 0);

}

Where is my error?

I have this error (initial condition aren't 0):

#0 Foam::errorrintStack(Foam::Ostream&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted:
#3 log in "/lib/tls/i686/cmov/libm.so.6"
#4 Foam::log(Foam::Field<double>&, Foam::UList<double> const&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::log(Foam::UList<double> const&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#6 pve::PatchValueExpressionParserarse() at PatchValueExpressionParser.C:0
#7 Foam::PatchValueExpressionDriverarse(std::string const&) in "/home/acconcia/OpenFOAM/acconcia-1.6.x/lib/linuxGccDPOpt/libgroovyBC.so"
#8 Foam::PatchValueExpressionDriver::evaluateVariable (Foam::word const&, Foam::string const&) in "/home/acconcia/OpenFOAM/acconcia-1.6.x/lib/linuxGccDPOpt/libgroovyBC.so"
#9 Foam::PatchValueExpressionDriver::addVariables(Foa m::string const&, bool) in "/home/acconcia/OpenFOAM/acconcia-1.6.x/lib/linuxGccDPOpt/libgroovyBC.so"
#10 Foam::groovyBCFvPatchField<Foam::Vector<double> >::updateCoeffs() in "/home/acconcia/OpenFOAM/acconcia-1.6.x/lib/linuxGccDPOpt/libgroovyBC.so"
#11 Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<doub le>, Foam::fvPatchField, Foam::volMesh>&, Foam::dimensionSet const&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libfiniteVolume.so"
#12 Foam::fv::gaussLaplacianScheme<Foam::Vector<double >, double>::fvmLaplacianUncorrected(Foam::GeometricFi eld<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libfiniteVolume.so"
#13 Foam::fv::gaussLaplacianScheme<Foam::Vector<double >, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libfiniteVolume.so"
#14 Foam::fv::laplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libfiniteVolume.so"
#15 Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::fvm::laplacian<Foam::Vector<double>, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&, Foam::word const&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libincompressibleRASModels.so"
#16 Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::fvm::laplacian<Foam::Vector<double>, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libincompressibleRASModels.so"
#17 Foam::incompressible::RASModels::kEpsilon::divDevR eff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libincompressibleRASModels.so"
#18
in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linuxGccDPOpt/simpleFoam"
#19 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#20
in "/home/acconcia/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linuxGccDPOpt/simpleFoam"


Thanks

Last edited by Daniele111; August 4, 2010 at 15:06.
Daniele111 is offline   Reply With Quote

Old   August 4, 2010, 13:55
Default
  #147
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello Bernhard,

A good evening to you :-)!

A few quick questions....

1. Can GroovyBC be used in parallel simulations?

2. If yes, do I need to do something specific when using the new functionality of calculating values on a remote patch in cases where the mesh is split up into pieces in which the remote patch may be on another processor?

I was running a simulation yesterday, and it worked fine in the serial mode, but in the parallel mode, it kept throwing up warnings that the "min" and "max" functions where returning zeros, and that the average would be used (the warning regarding the average comes from the file: "PatchResultI.H", function "GetUniformInternal".

Though the simulation seems to be running, I dont know whether these warnings should be considered as important, and whether the simulation result would be compromised.

Just out of curiosity, I found the command "preservePatches" in the decomposeParDict file, but that did not help either.

Have a great day ahead!


Philippose
philippose is offline   Reply With Quote

Old   August 5, 2010, 04:53
Default
  #148
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 philippose View Post
Hello Bernhard,

A good evening to you :-)!

A few quick questions....

1. Can GroovyBC be used in parallel simulations?
Yep

Quote:
Originally Posted by philippose View Post
2. If yes, do I need to do something specific when using the new functionality of calculating values on a remote patch in cases where the mesh is split up into pieces in which the remote patch may be on another processor?

I was running a simulation yesterday, and it worked fine in the serial mode, but in the parallel mode, it kept throwing up warnings that the "min" and "max" functions where returning zeros, and that the average would be used (the warning regarding the average comes from the file: "PatchResultI.H", function "GetUniformInternal".

Though the simulation seems to be running, I dont know whether these warnings should be considered as important, and whether the simulation result would be compromised.

Just out of curiosity, I found the command "preservePatches" in the decomposeParDict file, but that did not help either.

Have a great day ahead!


Philippose
Which version of OF are you using. The behaviour that you describe comes from the Field-class. In some versions it tells us that it has a length zero. This can be the case if the patch in question has no faces on one processor. I thought I worked around that, but am not sure. If I find a Bug-report in Mantis I'll have a look

Bernhard
gschaider is offline   Reply With Quote

Old   August 5, 2010, 05:05
Default
  #149
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello again Bernhard,

Thank you for your reply :-)!

Yes, I too noticed that the warning was coming from the field related classes, but since the warnings only popped up in combination with groovyBC I thought it would be something with the way groovyBC was implemented.

The warnings were issued when using the following OpenFOAM version:

OpenFOAM-1.5-dev SVN Ver. 1797 - Compiled on a Fedora 10 64-bit system


I shall post a Mantis Bug-report once I get back home this evening.

Do you think it might be useful to try it on another SVN Version? I looked through the SVN log, and I did not see any commit comments between 1797 and the current version which pointed towards this topic.

Have a nice day (though we have continuous drizzle and a grey sky here!)

Philippose
philippose is offline   Reply With Quote

Old   August 5, 2010, 06:53
Default
  #150
Senior Member
 
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16
Daniele111 is on a distinguished road
No idea?
Daniele111 is offline   Reply With Quote

Old   August 6, 2010, 05:54
Default
  #151
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 Daniele111 View Post
No idea?
This is a busy thread. Please attach a reference to the original question.

Had a quick glance at your last question. Propable causes are:
- kappa is zero somewhere (division by zero)
- y is negative (log doesn't like this)
gschaider is offline   Reply With Quote

Old   August 6, 2010, 07:51
Default
  #152
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 philippose View Post
Hello again Bernhard,

Thank you for your reply :-)!

Yes, I too noticed that the warning was coming from the field related classes, but since the warnings only popped up in combination with groovyBC I thought it would be something with the way groovyBC was implemented.

The warnings were issued when using the following OpenFOAM version:

OpenFOAM-1.5-dev SVN Ver. 1797 - Compiled on a Fedora 10 64-bit system


I shall post a Mantis Bug-report once I get back home this evening.

Do you think it might be useful to try it on another SVN Version? I looked through the SVN log, and I did not see any commit comments between 1797 and the current version which pointed towards this topic.

Have a nice day (though we have continuous drizzle and a grey sky here!)

Philippose
Further communication concerning this problem has moved to http://sourceforge.net/apps/mantisbt...view.php?id=15 (for whoever is interested)
gschaider is offline   Reply With Quote

Old   September 7, 2010, 08:20
Default
  #153
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 14
alfa_8C is an unknown quantity at this point
Hello Bernhard,

I'm trying to install/compile groovyBC - up to now unfortunately not very successful.

This is the error that I get if I type wmake libso in the groovyBC dir:

/bin/sh: bison: not found
mv: cannot stat '*.tab.cc': No such file or directory
mv: cannot stat '*.tab.hh': No such file or directory
mv: cannot stat '*..hh': No such file or directory
g++:Make/linuxGccDPopt/PatchValueExpressionParser.C: No such file or directory
g++: no input files
make: *** [Make/linuxGccDPopt/PatchValueExpressionParser.o] Error 1

Do you have any idea what the problem could be??

Thanx a lot in advance,
Tony
alfa_8C is offline   Reply With Quote

Old   September 7, 2010, 08:37
Default
  #154
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 alfa_8C View Post
Hello Bernhard,

I'm trying to install/compile groovyBC - up to now unfortunately not very successful.

This is the error that I get if I type wmake libso in the groovyBC dir:

/bin/sh: bison: not found
mv: cannot stat '*.tab.cc': No such file or directory
mv: cannot stat '*.tab.hh': No such file or directory
mv: cannot stat '*..hh': No such file or directory
g++:Make/linuxGccDPopt/PatchValueExpressionParser.C: No such file or directory
g++: no input files
make: *** [Make/linuxGccDPopt/PatchValueExpressionParser.o] Error 1

Do you have any idea what the problem could be??

Thanx a lot in advance,
Tony
The problem is

/bin/sh: bison: not found

You'll have to install bison (and flex while you're at it, but they usually come in pairs). Shouldn't be too hard to find in the package-manager of your distro

Bernhard
gschaider is offline   Reply With Quote

Old   September 7, 2010, 13:06
Default
  #155
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 14
alfa_8C is an unknown quantity at this point
Hello Bernhard,

thanx a lot for your reply. I tried to install bison, but I still get an error message:

poyry@poyry:~$ sudo apt-get install bison
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package bison is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package bison has no installation candidate
poyry@poyry:~$

Even if this is not related to your contribution, you might have had the same problem in the past and know a solution,

Best Regards and a good evening,
Tony

By the way - I downloaded and installed/compiled pyFoam and up to now, I've just tried the pyFoamPlotWatcher so far, it works great!!!! Thanx!
alfa_8C is offline   Reply With Quote

Old   September 8, 2010, 04:17
Default
  #156
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 alfa_8C View Post
Hello Bernhard,

thanx a lot for your reply. I tried to install bison, but I still get an error message:

poyry@poyry:~$ sudo apt-get install bison
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package bison is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package bison has no installation candidate
poyry@poyry:~$

Even if this is not related to your contribution, you might have had the same problem in the past and know a solution,
Sorry. That sounds like a Debian/Ubunu-problem and I'm from the other faction (RedHat). Anyway. Last time I did something on an Ubuntu-machine when I tried to execute an uninstalled command on the shell said something like "I do not know the bison you're talking about, but the command 'apt-blabla blub' might instll it for you" (maybe they're naming the package differently)
gschaider is offline   Reply With Quote

Old   September 8, 2010, 04:59
Default
  #157
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 14
alfa_8C is an unknown quantity at this point
I could solve the problem now thank you - No offence :-)

If anybody has the same problem: just download the bison package maually and install it manually as well. You can download it dirctly from the ubuntu page. Once downloaded, follow the instructions on the "Install" and "README" file being within the downloaded package and that's it..

Enjoy!
alfa_8C is offline   Reply With Quote

Old   September 9, 2010, 09:26
Default groovyBC - Accessing fields from other patches
  #158
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 14
alfa_8C is an unknown quantity at this point
Hello again Bernhard & everybody,

In my sim. I need to set a function P=f(Q) as a pressure BC, where P is the pressure and Q is the volumetric flow rate at the same patch.

As far as I could make out it seems not to be possible to use for instance the massFlowFunctionObject as the "producer" of the Q that I need in my function right? groovyBC does not support this type of variable like:

Example:
outlet1
{
type groovyBC;
valueExpression "f(Q_outlet1)";
variables "Q_outlet@outlet1=vals(massFlowFunctionObject)"
value uniform 100010;
}

-----------------------------------------------------------------------

Assumed: NO IT'S NOT POSSIBLE

Approach:

1)Generate pressure values with massFlowFunctionObject, by implementing the function P=f(Q) into the massFlowFunctionObject, which will be then written into a text file (does it anyway).

2)Using a timeVaryingUniformFixedValueBC, which then accesses after each iteration to the new pressure value written into the text file.

Hurdle do you know any BC very similar to the timeVaryingUniformFixedValueBC, which accesses after every iteration to an updated text file instead of an "predefined" one?

If not, do you think it's a big deal to modify the
timeVaryingUniformFixedValueBC in order to fulfill this criterion?

Thanx in advance to everybody!
Tony
alfa_8C is offline   Reply With Quote

Old   September 10, 2010, 04:45
Default
  #159
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 14
alfa_8C is an unknown quantity at this point
problem solved - sorry for the inconvenience!
Tony
alfa_8C is offline   Reply With Quote

Old   September 10, 2010, 05:59
Default
  #160
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 14
alfa_8C is an unknown quantity at this point
...problem is solved... sorry for the inconvenience...
Tony
alfa_8C 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 15:08
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
[ICEM] Dynamic mesh setup with ICEM David121284 ANSYS Meshing & Geometry 0 April 11, 2014 04:19
Dynamic Mesh "Shadow Wall" thezack FLUENT 0 June 4, 2013 22:09
dynamic mesh for drop interface IndrajitW FLUENT 0 March 30, 2013 08:03


All times are GMT -4. The time now is 12:35.