|
[Sponsors] |
[swak4Foam] groovyBC and funkySetFields married and got a kid named swak4Foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 29, 2010, 10:20 |
|
#21 |
Member
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15 |
Hello Eelco,
I followed your thread above but as I am not a C++ programmer I have some problems to understand what you actually did. I need to set a time dependent BC for heatflux. What I did so far is to create a ramp over time. But if I want the ramp to become a constant value at a certain point in time I don't know how realize it. My idea was to define two expressions, from which one is true for the first part of the calculation, and the other one for the second part, controlling it with an if then else condition like: if time()<=t1 the use expression one, else use expression two. Is this somehow realizable? If so, how is the syntax? Thank you in advance Best, Tony |
|
November 29, 2010, 11:36 |
|
#22 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
There is an example solver for swak-source-terms in the examples (basically you'll have to add the source-term to the equation and the source term has to be read) How you specify the zone is up to you: either by an expression or using a cellSet. cellSets can be created with the cellSet-utility. Either use one of the standard cellSet-methods or the one supplied by swak for that. There is a (simple) example for that too |
||
December 1, 2010, 18:28 |
Failing to compile interfoamwithsources
|
#23 |
Member
Fábio César Canesin
Join Date: Mar 2010
Location: Florianópolis
Posts: 67
Rep Power: 16 |
Hi Bernhard,
I'm getting error compiling InterFoamWithSources: Code:
M/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/home/fabioc/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/interFoamWithSources.o -L/home/fabioc/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt \ -linterfaceProperties -lincompressibleTransportModels -lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -L/home/fabioc/OpenFOAM/fabioc-1.7.x/lib/linux64GccDPOpt -lswak4FoamParsers -lswakSourceFields -lOpenFOAM -liberty -ldl -lm -o /home/fabioc/OpenFOAM/fabioc-1.7.x/applications/bin/linux64GccDPOpt/interFoamWithSources /home/fabioc/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libinterfaceProperties.so: undefined reference to `typeinfo for Foam::alphaContactAngleFvPatchScalarField' collect2: ld returned 1 exit status make: *** [/home/fabioc/OpenFOAM/fabioc-1.7.x/applications/bin/linux64GccDPOpt/interFoamWithSources] Error 1 Using OF-1.7.x... will try latter with OF-1.6-ext .. Last edited by Canesin; December 1, 2010 at 18:56. |
|
December 3, 2010, 05:31 |
Not able to compile swak4foam
|
#24 |
New Member
Harshad
Join Date: Mar 2009
Posts: 14
Rep Power: 17 |
Hi,
When I try to do wmake in swak4FoamParsers I get following error SOURCE=FieldValueExpressionParser.yy ; rm -f Make/linux64GccDPOpt/FieldValueExpressionParser.C Make/linux64GccDPOpt/FieldValueExpressionParser.tab.hh; bison -ra -v -d $SOURCE ; mv *.tab.cc Make/linux64GccDPOpt/FieldValueExpressionParser.C ; sed -i.bak "s/position.hh/FieldValueExpressionParser_position.hh/" location.hh ; mv location.hh lnInclude/FieldValueExpressionParser_location.hh ; mv stack.hh lnInclude/FieldValueExpressionParser_stack.hh ; mv position.hh lnInclude/FieldValueExpressionParser_position.hh ; sed -i.bak "s/stack.hh/FieldValueExpressionParser_stack.hh/;s/location.hh/FieldValueExpressionParser_location.hh/" FieldValu[harshad@headhpccluster swak4FoamParsers]$ wmake SOURCE=FieldValueExpressionParser.yy ; rm -f Make/linux64GccDPOpt/FieldValueExpressionParser.C Make/linux64GccDPOpt/FieldValueExpressionParser.tab.hh; bison -ra -v -d $SOURCE ; mv *.tab.cc Make/linux64GccDPOpt/FieldValueExpressionParser.C ; sed -i.bak "s/position.hh/FieldValueExpressionParser_position.hh/" location.hh ; mv location.hh lnInclude/FieldValueExpressionParser_location.hh ; mv stack.hh lnInclude/FieldValueExpressionParser_stack.hh ; mv position.hh lnInclude/FieldValueExpressionParser_position.hh ; sed -i.bak "s/stack.hh/FieldValueExpressionParser_stack.hh/;s/location.hh/FieldValueExpressionParser_location.hh/" FieldValueExpressionParser.tab.hh ;mv *.hh lnInclude ; touch -r $SOURCE lnInclude/FieldValueExpressionParser*.hh ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -IMake/linux64GccDPOpt -I/home/harshad/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/home/harshad/OpenFOAM/OpenFOAM-1.6/src/meshTools/lnInclude -IlnInclude -I. -I/home/harshad/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/harshad/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c Make/linux64GccDPOpt/FieldValueExpressionParser.C -o Make/linux64GccDPOpt/FieldValueExpressionParser.o FieldValueExpressionParser.yy:40.1-15: invalid directive: `%initial-action' FieldValueExpressionParser.yy:41.1-44.1: syntax error, unexpected "{...}" mv: cannot stat `*.tab.cc': No such file or directory sed: can't read location.hh: No such file or directory mv: cannot stat `location.hh': No such file or directory mv: cannot stat `stack.hh': No such file or directory mv: cannot stat `position.hh': No such file or directory sed: can't read FieldValueExpressionParser.tab.hh: No such file or directory mv: cannot stat `*.hh': No such file or directory g++: Make/linux64GccDPOpt/FieldValueExpressionParser.C: No such file or directory g++: no input files make: *** [Make/linux64GccDPOpt/FieldValueExpressionParser.o] Error 1 Can anybody help me? |
|
December 3, 2010, 09:11 |
|
#25 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Try wclean. Have a look whether the regular interFoam compiles for you |
||
December 3, 2010, 09:14 |
|
#26 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
December 6, 2010, 00:38 |
|
#27 |
New Member
Harshad
Join Date: Mar 2009
Posts: 14
Rep Power: 17 |
bison version: 1.875c
Thanks |
|
December 6, 2010, 00:40 |
|
#28 |
New Member
Harshad
Join Date: Mar 2009
Posts: 14
Rep Power: 17 |
Thanks for reply
I am using bison 1.875c Could not 'make' latest version so tried using existing version. |
|
December 6, 2010, 06:13 |
|
#29 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
||
December 6, 2010, 06:52 |
|
#30 |
New Member
Harshad
Join Date: Mar 2009
Posts: 14
Rep Power: 17 |
Ok
I will try installing latest bison again Thanks for clarifications |
|
December 6, 2010, 10:17 |
|
#31 |
Member
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15 |
Hy Bernhard,
I've implemented now volume sources for momentum,mass and energy in reactingFoam and now I need to control the sources by an expression, which describes the source behavior over time. But as you can see below, in my source properties I can only specify a constant value instead of an expression. FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object massSourcesProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ( source1 { active true; timeStart 0.001; duration 0.05; selectionMode cellSet; volumeMode absolute; fieldData ( (H2O 1e-1) // kg/s (CO2 1e-1) (N2 1e-1) (O2 1e-1) ); cellSet heatSource; } ); Is this now a case that can be solved with swak4Foam? If so, could you point me to the right example or post where to add the expression and synthax of it. The source zone in the mesh is defined with cellSets. Thank you in advance Tony |
|
December 6, 2010, 17:50 |
|
#32 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
To specify the source just in a cell set foo use this expression "set(foo) ? 1 : 0" instead of 1 use the expression you want to use Bernhard |
||
December 7, 2010, 06:35 |
|
#33 |
Member
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15 |
Hello Bernhard,
thanx for your quick reply. One difference is in the createFields.H file: expressionSource<vector> momentumSource ( IOdictionary ( IOobject ( "momentumSourceDict", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ), mesh ); In my case I need to add additionally energySources and massSources. EnergySources shouldn't be a problem, as the only changes to make are to set <vector> to <scalar> and to change momentumSource to energySource and so on. But what about massSources. I mean is it possible to control different species over a single massSourceDict? Or do I have to specify for each specie an own dict? One last question. Is this synthax right in the .C File? I just took the momentumSource synthax from interFoamWithSourcesFoam and adapted it to mass and energy... if (runTime.write()) { chemistry.dQ()().write(); volVectorField momSrc=momentumSource(); momSrc.rename("momSrc"); momSrc.write(); volVectorField enegSrc=energySource(); momSrc.rename("enegSrc"); momSrc.write(); volVectorField masSrc=massSource(); momSrc.rename("masSrc"); momSrc.write(); } Thank you very much, Tony |
|
December 7, 2010, 06:41 |
|
#34 |
Member
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15 |
oh I'm sorry... like this of course!!!!
if (runTime.write()) { chemistry.dQ()().write(); volVectorField momSrc=momentumSource(); momSrc.rename("momSrc"); momSrc.write(); volScalarField enegSrc=energySource(); enegSrc.rename("enegSrc"); enegSrc.write(); volScalarField masSrc=massSource(); masSrc.rename("masSrc"); masSrc.write(); } |
|
December 7, 2010, 15:42 |
|
#35 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
BTW: I'm sure you've included the overall mass-source into the continuity equation Quote:
Bernhard |
|||
December 10, 2010, 08:01 |
|
#36 | |
Senior Member
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20 |
Quote:
i am facing the same problem (ld returned 1 exit status). Is it possible that this is somehow related to where the *.o file is written... because i had to manually change the Make/files when compiling swak4Foam. I changed from ../Libraries/... to ../lib/.. and this fixed the "earlier" problem.. neewbie |
||
December 12, 2010, 13:04 |
|
#37 |
Senior Member
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17 |
Hi Bernhard,
I've compiled swak4Foam for both 1.6-ext and 1.7.0. Everything seems okay except for the simpleSwakFunctionObjects library. It is mentioned on the wiki page but does not appear with the other libraries. Looking in the make log file the only reference to simpleFunctionObjects appears in this segment below: Code:
wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file general/swakExpressionFunctionObject.C could not open file timelineFunctionObject.H for source file general/swakExpressionFunctionObject.C Making dependency list for source file patch/patchExpressionFunctionObject.C could not open file patchFunctionObject.H for source file patch/patchExpressionFunctionObject.C SOURCE=general/swakExpressionFunctionObject.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/binkz/OpenFOAM/binkz-1.7.0/Libraries/simpleFunctionObjects/lnInclude -I../swak4FoamParsers/lnInclude -I/home/binkz/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude -I/home/binkz/OpenFOAM/OpenFOAM-1.7.0/src/meshTools/lnInclude -I/home/binkz/OpenFOAM/OpenFOAM-1.7.0/src/sampling/lnInclude -I/home/binkz/OpenFOAM/OpenFOAM-1.7.0/src/triSurface/lnInclude -I/home/binkz/OpenFOAM/OpenFOAM-1.7.0/src/lagrangian/basic/lnInclude -IlnInclude -I. -I/home/binkz/OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude -I/home/binkz/OpenFOAM/OpenFOAM-1.7.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/swakExpressionFunctionObject.o In file included from general/swakExpressionFunctionObject.C:28:0: general/swakExpressionFunctionObject.H:40:36: fatal error: timelineFunctionObject.H: No such file or directory compilation terminated. make: *** [Make/linux64GccDPOpt/swakExpressionFunctionObject.o] Error 1 Thanks, Ziad |
|
December 12, 2010, 17:18 |
|
#38 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Let me quote from the README-file (sometimes I wonder why I write that stuff): Code:
** Requirements - Version 1.7 of OpenFOAM (1.6 should work, too) - the compiler generators =bison= and =flex= - =simpleSwakFunctionObjects= needs the =simpleFunctionObjects= (see http://openfoamwiki.net/index.php/Contrib_simpleFunctionObjects) all other functionality has no additional requirements (=simpleSwakFunctionObjects= is only required by some examples) It is assumed that the sources are installed at =$WM_PROJECT_USER_DIR/Libraries/simpleFunctionObjects= |
||
December 12, 2010, 17:54 |
|
#39 |
Senior Member
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17 |
Right! I had simpleFunctionObjects, just not in $WM_PROJECT_USER_DIR/Libraries
Thanks for the "tip". |
|
December 13, 2010, 04:14 |
|
#40 |
Member
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15 |
Hello Bernhard,
two short questions: 1. what exactly do you mean with your comment: BTW: I'm sure you've included the overall mass-source into the continuity equation My Eqns look like this: UEqn: fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + turbulence->divDevRhoReff(U) == //rho*g rho.dimensionedInternalField()*g + momentumSource.Su() ); UEqn.relax(); if (momentumPredictor) { solve(UEqn == -fvc::grad(p)); } ...and YEqn: for (label i=0; i<Y.size(); i++) { if (Y[i].name() != inertSpecie) { volScalarField& Yi = Y[i]; solve ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - fvm::laplacian(turbulence->muEff(), Yi) == //kappa*chemistry.RR(i), kappa*chemistry.RR(i)().dimensionedInternalField() + massSource.Su(i), mesh.solver("Yi") ); Yi.max(0.0); Yt += Yi; Is there something wrong regarding the specie fractions or what else do you mean? 2. Do you know where to get the properties set for CO in the same "form" like other species used for reactingFoam? OpenFOAM support doesn't help unfortunately... Many thanx in advance, Tony |
|
|
|