CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM News & Announcements > OpenFOAM Announcements from Other Sources

swak4Foam - New release

Register Blogs Community New Posts Updated Threads Search

Like Tree29Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2013, 07:08
Default
  #21
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 tomf View Post
Hi Bernhard,

Thank you for the clarification. That will save me some trial and error. Maybe I can find another solution.

Regards,
Tom
I haven't tried that (but would be interested if you succeed): use the sample-utility to write out a sampledSurface type sampledPatch and read that with timeVaryingMappedFixedValue (you'll have to find out which writer-format is working)
__________________
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
gschaider is offline   Reply With Quote

Old   March 23, 2013, 12:16
Default
  #22
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 637
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Thanks for the suggestion, did not yet consider that option, but it sounds promising. I'll keep you updated once I find a solution.
tomf is offline   Reply With Quote

Old   April 4, 2013, 09:48
Default reaction rate
  #23
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Quote:
Originally Posted by gschaider View Post
- Plugin functions to access fields from the radiation mode or the combustion model (for instance the reaction rates)
Dear Bernahrd,

Is there any function in the new version of swak4foam to evoke reaction rate (combustion->R(Yi) in YEqn.H) of species? I need to write reaction rate of some soecies in a file.

Thank you in advance for any hint

Hossein
atoof is offline   Reply With Quote

Old   April 4, 2013, 10:12
Default
  #24
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 atoof View Post
Dear Bernahrd,

Is there any function in the new version of swak4foam to evoke reaction rate (combustion->R(Yi) in YEqn.H) of species? I need to write reaction rate of some soecies in a file.

Thank you in advance for any hint

Hossein
Yes. That is what I was saying with that line.

Just add "libswakChemistryModelFunctionPlugin.so" to the libs-entry in controlDict. Now if you use any swak-thing (function-object or also funkySetFields) that uses the Field-parser for the first time you see an output like this:
Code:
Creating expression field muEff ...
"Loaded plugin functions for 'FieldValueExpressionDriver':"
psiChem_RR:
"volScalarField psiChem_RR(primitive/word speciesName)"
psiChem_RRError:
"volScalarField psiChem_RRError()"
psiChem_RRSumPositive:
"volScalarField psiChem_RRSumPositive()"
psiChem_Sh:
"volScalarField psiChem_Sh()"
psiChem_dQ:
"volScalarField psiChem_dQ()"
psiChem_deltaTChem:
"volScalarField psiChem_deltaTChem()"
psiChem_tc:
"volScalarField psiChem_tc()"
psiChem_updateChemistry:
"volScalarField psiChem_updateChemistry(primitive/scalar timestep)"
which is a list of the additional functions including their signatures. The one you're interested in is psiChem_RR which takes a species-Name as an argument.

All this uses the results from the last run-through of the chemistry-solver. In funkySetFields you've got to trigger this calculation with the psiChem_updateChemistry-function (only use it once):
"psiChem_updateChemistry(0.001)+psiChem_RR(CO)+psi Chem_RR(CO2)"
for Reaction rates of CO and CO2.

Of course you can use it to check whether the time-step influences the reaction rates
"(psiChem_updateChemistry(0.001)+psiChem_RR(CO ))-(psiChem_updateChemistry(0.002)+psiChem_RR(CO))"
but that of course calculates everything twice
atoof likes this.
__________________
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
gschaider is offline   Reply With Quote

Old   April 5, 2013, 08:27
Default reaction rate(2)
  #25
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Quote:
Originally Posted by gschaider View Post
Yes. That is what I was saying with that line.
Thanks Bernhard. It's very useful but when I try implementing the following sentences in my solver, I encounter the following error that states ‘psiChem_RR’ was not declared in this scope.

if (Y[i].name() == "O2")
{
volScalarField wO2 = psiChem_RR(Y[i].name());
wO2.write();
}


I inserted the #include "swakPsiChemistryModelPluginFunction.H" header in my .C file and the address of it in "option" which is in following:

EXE_INC = \
.
.
.
-I$(HOME)/Swak4Foam_2.x_release_0.2.3/Libraries/swak4FoamParsers/lnInclude/ \
-I$(HOME)/Swak4Foam_2.x_release_0.2.3/Libraries/swakSourceFields/lnInclude/ \
-I$(HOME)/Swak4Foam_2.x_release_0.2.3/Libraries/functionPlugins/swakChemistryModelFunctionPlugin/lnInclude

EXE_LIBS = \
.
.
.
-lsampling \
-lmeshTools \
-L$(FOAM_USER_LIBBIN) \
-lswak4FoamParsers \
-lswakChemistryModelFunctionPlugin \
-lswakSourceFields

How can I solve above problem?

Best Regards,

Hossein
atoof is offline   Reply With Quote

Old   April 5, 2013, 09:58
Default
  #26
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 atoof View Post
Thanks Bernhard. It's very useful but when I try implementing the following sentences in my solver, I encounter the following error that states ‘psiChem_RR’ was not declared in this scope.

if (Y[i].name() == "O2")
{
volScalarField wO2 = psiChem_RR(Y[i].name());
wO2.write();
}


I inserted the #include "swakPsiChemistryModelPluginFunction.H" header in my .C file and the address of it in "option" which is in following:

EXE_INC = \
.
.
.
-I$(HOME)/Swak4Foam_2.x_release_0.2.3/Libraries/swak4FoamParsers/lnInclude/ \
-I$(HOME)/Swak4Foam_2.x_release_0.2.3/Libraries/swakSourceFields/lnInclude/ \
-I$(HOME)/Swak4Foam_2.x_release_0.2.3/Libraries/functionPlugins/swakChemistryModelFunctionPlugin/lnInclude

EXE_LIBS = \
.
.
.
-lsampling \
-lmeshTools \
-L$(FOAM_USER_LIBBIN) \
-lswak4FoamParsers \
-lswakChemistryModelFunctionPlugin \
-lswakSourceFields

How can I solve above problem?

Best Regards,

Hossein
Plugin-functions are designed to be used in parsers. It could be possible to use them on their own, but the calling would be plain weird. The two best options you have are
- create an instance of FieldValueExpressionParser. Feed it the expression you want to get and get the result from that. I don't explain this in detail because for the purpose of what you want to do this would be like using dynamite to go after the cockroaches in your drain: lot of fun, but the neighbours might think it is a little bit excessive.
- have a look at the source of the plugin and try to lift the parts you need (If I remember it correctly: get from the registry the object-registry the object with the name "thermophysicalProperties". Cast it down to the combustion-thermo and then call the RR there). That might be the easiest (for your purposes)
__________________
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
gschaider is offline   Reply With Quote

Old   April 5, 2013, 23:11
Thumbs up reaction rate(3)
  #27
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Quote:
Originally Posted by gschaider View Post
- have a look at the source of the plugin and try to lift the parts you need
Thanks for quick reply. I looked up the "class swakPsiChemistryModelPluginFunction_RR" in swakPsiChemistryModelPluginFunction.C and found my question.

Thanks again
atoof is offline   Reply With Quote

Old   April 6, 2013, 06:26
Default
  #28
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 atoof View Post
Thanks for quick reply. I looked up the "class swakPsiChemistryModelPluginFunction_RR" in swakPsiChemistryModelPluginFunction.C and found my question.
I was hoping you might find the answer there
__________________
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
gschaider is offline   Reply With Quote

Old   June 11, 2013, 22:48
Default Release 0.2.4
  #29
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
A new version of swak4Foam has been released. It is the version found on the USB-stick of the 8th OpenFOAM workshop. New features include (but for all see the README which has a complete list):

- functionObjects now store their data in the sub-directory postProcessing according to the new convention OpenFOAM has (sorry: this may break existing scripts relying on the old location)
- slight change in the format written may break the restart of cases where swak-specific restart data was written with older swak-version (should not hit many people)
- Example cases are adapted to run with OF 2.2. This may prohibit them from running with 2.1 or 2.0

But now the good parts:

- build scripts have been adapted to run on more machines, allow tuning of the compilation process, compile on non-gcc compilers and give more information for finding problems
- A new library with additional searchableSurfaces (to be used in snappyHexMesh) that allow boolean operations and coordinate transformations of searchable surfaces
- Function objects to calculate the distributions of variables (and expressions)
- specification of aliases for field names that contain special characters (like thermo:rho)
- functionObject to list all registered objects (basically for finding out what is there)
- functionObjects to handle global variables
- functionObject that executes a list of other functionObjects only if the run is parallel/serial
- A new type of variable (stacked) that allows recording multiple values
- More flexible output control for functionObjects based on simpleFunctionObjects
- swakDataEntry is improved
- other stuff and bug fixes (check the README)

Also to make life easier for the non-Emacs people who have problems converting the (still incomplete ) reference guide to a more readable form it can be downloaded here: http://openfoamwiki.net/images/d/db/...mReference.pdf
immortality, JR22 and YHBen like this.
__________________
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
gschaider is offline   Reply With Quote

Old   August 13, 2013, 14:22
Default OpenFOAM 2.2.1 + Swak4Foam 0.24 ?
  #30
Senior Member
 
JR22's Avatar
 
Jose Rey
Join Date: Oct 2012
Posts: 134
Rep Power: 17
JR22 will become famous soon enough
Hi Bernhard,

Will swak4Foam 0.2.4 install correctly on the new OpenFOAM 2.2.1 ?

Also, when will swak4Foam 0.2.4 be posted to the openfoamwiki.net site?

Thank you very much.

Last edited by JR22; August 13, 2013 at 17:18. Reason: added question about swak4foam availabilty
JR22 is offline   Reply With Quote

Old   August 13, 2013, 18:52
Default
  #31
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 JR22 View Post
Hi Bernhard,

Will swak4Foam 0.2.4 install correctly on the new OpenFOAM 2.2.1 ?
I think so. But the only test is trying to compile it
Quote:
Originally Posted by JR22 View Post
Also, when will swak4Foam 0.2.4 be posted to the openfoamwiki.net site?
I like to think that the SVN-download at http://openfoamwiki.net/index.php/Co...am#Downloading is sufficient. Providing the tarballs was only a workaround while the SVN was down but I don't see the point creating/testing/uploading tarballs if there is already a way to get the sources
immortality and JR22 like this.
__________________
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
gschaider is offline   Reply With Quote

Old   January 27, 2014, 19:43
Default New Release of 0.3.0 of swak4Foam
  #32
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
8 months ago the last release of swak4Foam happened. A week later Edward Snowden blew the whistle on the NSA. Coincidence? Unlikely! (who is back there saying "Correlation does not imply causality"? Obviously someone who doesn't appreciate a good conspiracy theory). Today the next version of swak4Foam is announced and the world is expecting the next Spy-Agency to be exposed. The only question is: will it be China, Russia or Austria.

Most of the features have already leaked to the public through the public development repository and the twitter-acount @swakPyFoam but for all those whose intelligence-branch failed to interpret these informations correctly here is an incomplete list of the new features
  • the version of the release has jumped to 0.3.0 as this release has now a parser for lagrangian particles (these were the last major OF "things" that swak4Foam couldn't access. It is now possible to let swak4Foam do calculations on clouds of particles
  • the new release now supports Foam-3 (this is in the 2.x branch). The 1.x branch supports OF 1.7 and 1.6-ext, all newer Versions are supported in the 2.x-branch
  • a number of new accumulations have been added (median, quantile and weighted counterparts for most of them)
  • Python-integration has been improved (IPython inclusion, stabler etc)
  • new utilities: fieldReport to quickly get information about fields, funkyPythonPostproc allows loading OF-data into a Python-workspace and analyze it with the NumPy/SciPy/Matplotlib-ecosystem of scientific software, funkySetLagrangianFields allows setting values on the particles of a lagrangian cloud
  • a number of new function objects (calculation of potential flow, recalculation of thermophyiscs etc). The one with the longest name is swakExpressionAverageDistribution (applications for this are for instance the calculation of the average pressure as a function of the channel length)
  • several other enhancements to utilities and function objects (all found in the README)
  • a number of bugs was mercilessly squashed. Among them a problem with the correct summation of expressions on faceSets/faceZones in parallel runs
  • attempts to improve compilation
A few highlights of the release are demonstrated here http://openfoamwiki.net/staticPages/...K_again.html#/

For further information see
- the Wiki page http://openfoamwiki.net/index.php/Contrib/swak4Foam
- the README that comes with the sources
- the Documentation-folder of the sources has an incomplete reference guide. It documents all the expression-grammars

Have fun and look out for the men in the trenchcoats
__________________
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
gschaider is offline   Reply With Quote

Old   July 11, 2014, 16:36
Default New Release of 0.3.1 of swak4Foam
  #33
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
This release has been sitting on my hard-disk for several weeks but now I've gotten around to releasing it officially (it is technically identical to the version on the USB-sticks distributed at the Workshop and also the version that is pulled when you compile it as one of the ThirdParty-packages with foam-extend-3.1)

This Release supports the latest versions of OpenFOAM (2.3) and Foam-Extend (3.1). It has its fair share of bug-fixes and also some new features:
  • Compiling a "private" bison-version. The reason for this is that a growing number of distributions install bison 3.0 which is incompatible with swak4Foam. On such machines a script downloads a compatible version of bison (2.7), compiles it and installs it locally so that it will be only used for the compilation of swak4Foam
  • New utility funkyWarpMesh allows deforming the mesh according to an expression
  • A number of function-objects that trigger the writing of time-steps according to conditions
  • Function object writeOldTimesOnSignal that writes the current state of the simulation when a floating-point-exception etc happens
  • Additional library with fvOptions for OF-versions that support it
  • Macro expansion in expressions
For a full list see the section about 0.3.1 in the README
__________________
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
gschaider is offline   Reply With Quote

Old   November 6, 2014, 09:03
Default
  #34
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Dear Bernhard,

How can I store the reaction rate of species O2 in each time step using psiChem_RR? Which expressions should be added to controlDict file after adding "libswakChemistryModelFunctionPlugin.so" in the libs or do something else?
I'm using swak4Foam_2.x_release_0.2.3 now.

Thank you in advance,

Hossein
atoof is offline   Reply With Quote

Old   November 6, 2014, 10:43
Default
  #35
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 atoof View Post
Dear Bernhard,

How can I store the reaction rate of species O2 in each time step using psiChem_RR? Which expressions should be added to controlDict file after adding "libswakChemistryModelFunctionPlugin.so" in the libs or do something else?
I'm using swak4Foam_2.x_release_0.2.3 now.

Thank you in advance,

Hossein
Not sure what you mean with "store at each timestep" but maybe you may find the slides 125ff of http://openfoamwiki.net/images/7/7a/...icTraining.pdf helpful
__________________
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
gschaider is offline   Reply With Quote

Old   November 6, 2014, 13:07
Default
  #36
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Quote:
Originally Posted by gschaider View Post
Not sure what you mean with "store at each timestep" but maybe you may find the slides 125ff of http://openfoamwiki.net/images/7/7a/...icTraining.pdf helpful
Thanks.
That is what I need. Sorry for another question. For example If I set the deltaT value in controlDict to 1e-07, Does psichem_RR function consider that value to calculate the reaction rate?

Thanks
atoof is offline   Reply With Quote

Old   November 6, 2014, 14:44
Default
  #37
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 atoof View Post
Thanks.
That is what I need. Sorry for another question. For example If I set the deltaT value in controlDict to 1e-07, Does psichem_RR function consider that value to calculate the reaction rate?

Thanks
It reuses the RR that was calculated by the chemistry and used to solve the species transport equations. If you want to check the influence of the timestep there is a separate function for it (it is explained in slides 138ff. Please get into the habit of checking more than just a few pages before asking again. You're one "under-researched" question away from being permanently ignored)
__________________
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
gschaider is offline   Reply With Quote

Old   November 19, 2014, 09:58
Default
  #38
New Member
 
Mahdi
Join Date: Sep 2013
Posts: 11
Rep Power: 12
Masgar is on a distinguished road
Dear foamers,

I am trying to install swak4Foam on OF2.3, and I already tried the OF2.2x version suggested by Bruno but still there are some errors. I am wondering if there is a package developed for OF2.3. I am looking forward to your answers,

Thanks in advance and Best,
Mahdi
Masgar is offline   Reply With Quote

Old   November 19, 2014, 13:10
Default
  #39
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 Masgar View Post
Dear foamers,

I am trying to install swak4Foam on OF2.3, and I already tried the OF2.2x version suggested by Bruno but still there are some errors. I am wondering if there is a package developed for OF2.3. I am looking forward to your answers,

Thanks in advance and Best,
Mahdi
The current 2.x-release should compile with 2.3 (at least it did in June when the release was done). Please provide a link to the release you mean (Bruno is very active so looking for something he might have said takes a long time)
__________________
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
gschaider is offline   Reply With Quote

Old   November 19, 2014, 15:34
Default
  #40
New Member
 
Mahdi
Join Date: Sep 2013
Posts: 11
Rep Power: 12
Masgar is on a distinguished road
Quote:
Originally Posted by gschaider View Post
The current 2.x-release should compile with 2.3 (at least it did in June when the release was done). Please provide a link to the release you mean (Bruno is very active so looking for something he might have said takes a long time)
Hi Bernhard,

Thanks a lot for your quick response as always. I tried the 2.x-release downloaded from:

svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam/ swak4Foam_2.x

I attached the make log file output from this compile. Then I also tried this one which was suggested by Bruno (https://github.com/wyldckat/swak4foam/tree/OF22X), but I am not sure if this principally should work for me or not; anyway it did not

Thanks and Best,
Mahdi

Attached Files
File Type: txt make_log.txt (27.9 KB, 5 views)
Masgar 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
Troubles with heat release rate Xavier Ponticq CFX 4 September 12, 2012 18:49
Extend Project Release 1.6-ext hjasak OpenFOAM Announcements from Other Sources 33 July 14, 2011 18:54
OpenCFD release OpenFOAMŪ version 1.7.1 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 August 26, 2010 11:40
Diesel combustion simulation ( Heat release rate) venkatesh Siemens 2 April 29, 2009 07:38
Public Release of the Wiki Jonas Larsson CFD-Wiki 3 November 7, 2005 04:13


All times are GMT -4. The time now is 00:14.