|
[Sponsors] |
May 19, 2013, 06:54 |
outputTime in Swak function
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I have written this SWAK function to write the expression at each outputTime(not each timeStep):
Code:
n1_totalTemperature { type swakExpression; valueType surface; surfaceName normalPlane_T0_1; verbose true; surface { type plane; basePoint (0.01725 0.002 0); normalVector (1 0 0); interpolate true; } expression "sum((T+0.000497517*magSqr(U))*rho*area())/sum(rho*area())"; accumulations ( average ); outputControl outputTime;//outputTime;// outputInterval 1; // 5000 } Code:
nused output: areaAverage(right) for p = 303977.3946 Unused output: areaAverage(right) for U = (0 -78.27914269 0) Unused output: areaAverage(right) for T = 440.0158214 Unused output: areaAverage(right) for rho = 2.406229408 Unused output: areaAverage(right) for h = 143969.4069 Unused output: Unused output: Expression totalPressure_right : average=311349.633 Unused output: Expression totalTemperature_right : average=443.0644198 Unused output: Expression totalEnthalpy_right : average=202609.9735 Unused output: Expression flowInlet : sum=-0.000200896449 Unused output: faceSource Average_left output: Unused output: areaAverage(left) for p = 328460.3658 Unused output: areaAverage(left) for U = (24.89352103 -84.5762301 0) Unused output: areaAverage(left) for T = 496.1931543 Unused output: areaAverage(left) for rho = 2.355562913 Unused output: areaAverage(left) for h = 204658.9719 Unused output: Unused output: Expression totalPressure_left : average=344793.4867 Unused output: Expression totalTemperature_left : average=494.9186351 Unused output: Expression n1_totalTemperature : average=440 Unused output: Expression n1_totalPressure : average=303975 Unused output: Expression n2_totalTemperature : average=440 Unused output: Expression n2_totalPressure : average=303975 Unused output: Expression n2_MaxU : average=2.00358353e-13 Unused output: Expression n2_Maxp : average=303975 Unused output: Expression n2_pressure_minMax : min=303975 max=303975 Unused output: Expression n3_totalTemperature : average=440 Unused output: Expression n3_totalPressure : average=303975 Unused output: Expression h1_totalTemperature : average=440.0002414 Unused output: Expression h1_totalPressure : average=303975.5373 Unused output: Expression h2_totalTemperature : average=440.0000913 Unused output: Expression h2_totalPressure : average=303975.0635 Unused output: Expression h2_pressure_minMax : min=303975 max=303978.1412 Unused output: Expression h3_totalTemperature : average=440.5776045 Unused output: Expression h3_totalPressure : average=305028.7895 Unused output: Mean and max Courant Numbers = 0.007692142019 0.09958988306
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. Last edited by immortality; May 20, 2013 at 09:30. |
|
May 19, 2013, 08:38 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
In this case, swak4Foam doesn't use "outputControl". It only uses "outputInterval". Which means that it you'll have to use something like this: Code:
outputInterval 10; Bruno
__________________
|
|
May 19, 2013, 08:53 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
Hi Bruno
1)what do you mean by "in this case"? 2)I have a variable timeStep.there isn't any other way to have outputs concurrent with folder writing times to save time? I saw this,what does cloud mean? Code:
createThrePointSet { type createSampledSet; outputControl timeStep; outputInterval 1; setName threePoints; set { type cloud; axis x; points ( (0.1 0.14 0.0001) (0.0 0.02 0.0001) (-0.1 0.02 0.0001) ); } writeSetOnConstruction true; autoWriteSet true; setFormat vtk; } thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 19, 2013, 09:00 |
|
#4 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
1) From what I can figure out, swak4Foam can use "outputControl" in some other function objects. But in this case, namely for "swakExpression", this doesn't work. 2) Quote:
Quote:
3) As I said on the email a few minutes ago, "phi" cannot be used with the "sampledSurface" in OpenFOAM's function object, which is why "faceZone" has to be used instead. Best regards, Bruno
__________________
|
|||
May 19, 2013, 18:47 |
|
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Also writing at fixed time intervals is already supported
__________________
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 |
||
May 20, 2013, 05:53 |
|
#6 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
Hi Bernhard
when does the new version will release?(current version i use is 0.2.3 is there a newer one?)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 20, 2013, 07:43 |
|
#7 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
When it is ready. Intermediate versions are found in the mercurial-repository. But they may contain bugs so use with care. New features are documented in the README
No. That is the latest released one
__________________
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 |
|
June 24, 2015, 08:13 |
|
#8 |
Member
Manjunath Reddy
Join Date: Jun 2013
Posts: 47
Rep Power: 13 |
Hi Bernhard
I'm writing the variable on the patch using swakEpression Code:
Ttop { type swakExpression; valueType patch; patchName top; outputControlMode timeStep; outputInterval 100; region stratumCorneum; expression "T"; accumulations ( average ); verbose true; autoInterpolate true; } Code:
--> FOAM FATAL ERROR: Unknown function type swakExpression Valid functions are : 71 ( CourantNo DESModelRegions Lambda2 Peclet Q addForeignMeshes addGlobalVariable calculateGlobalVariables clearExpressionField coded correctThermo createSampledSet createSampledSurface dsmcFields dynamicFunctionObjectListProxy executeIfEnvironmentVariable executeIfExecutableFits executeIfFunctionObjectPresent executeIfObjectExists executeIfOpenFOAMVersionBiggerEqual executeIfParallelSerial executeIfStartTime expressionField fieldDistribution foreignMeshesFollowTime functionObjectListProxy initPotentialFlow initSwakFunctionObject listRegisteredObjects loadCompressibleTurbulenceModel loadIncompressibleTurbulenceModel loadPsiThermoModel loadRhoThermoModel loadSLGThermoModel manipulateField manipulatePatchField panicDump patchAverage patchFieldDistribution patchFieldFlow patchIntegrate patchMassFlow patchMassFlowAverage patchProbes pressureTools probes readAndUpdateFields readGravitation recalcPhi recalcThermoHe removeGlobalVariable scalarTransport setDeltaTByTimeline setTimeStep sets solveLaplacianPDE solveTransportPDE solverPerformanceToGlobalVariables surfaces swakCoded timeActivatedFileUpdate trackDictionary volumeAverage volumeIntegrate volumeMinMax wallShearStress writeAdditionalFields writeAndEndFieldRange writeFieldsOften yPlusLES yPlusRAS ) From function functionObject::New(const word& name, const Time&, const dictionary&) in file db/functionObjects/functionObject/functionObject.C at line 92. FOAM exiting This is showing this error also Code:
--> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1179 dlopen error : /home/mechfoam/OpenFOAM/mechfoam-2.2.x/platforms/linux64GccDPOpt/lib/libsimpleSwakFunctionObjects.so: undefined symbol: _ZTIN4Foam36conditionDrivenWritingFunctionObjectE --> FOAM Warning : From function dlLibraryTable::open(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "libsimpleSwakFunctionObjects.so" Last edited by wyldckat; June 28, 2015 at 17:20. Reason: merged posts that were a few minutes apart and added [CODE][/CODE] |
|
June 28, 2015, 17:25 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answer: Edit the "system/controlDict" and add the library "libsimpleFunctionObjects.so" in "libs" before "libsimpleSwakFunctionObjects.so", e.g.:
Code:
libs ( "libsimpleFunctionObjects.so" "libsimpleSwakFunctionObjects.so" ); |
|
February 7, 2016, 04:02 |
|
#10 |
New Member
Afshin Bakhshi
Join Date: Mar 2014
Posts: 13
Rep Power: 12 |
I'm using OF 3.0.1 and just installed swak4Foam 0.4.0 from here.
installation process seemed to went well. but now I'm getting this error. Code:
-> FOAM FATAL ERROR: Unknown function type swakExpression Valid functions are : 4 ( patchProbes probes sets surfaces ) From function functionObject::New(const word& name, const Time&, const dictionary&) in file db/functionObjects/functionObject/functionObject.C at line 92. FOAM exiting where should swak4Foam libraries be placed now? |
|
February 7, 2016, 12:07 |
|
#11 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
__________________
|
||
February 7, 2016, 12:53 |
|
#12 | |
New Member
Afshin Bakhshi
Join Date: Mar 2014
Posts: 13
Rep Power: 12 |
Quote:
Code:
libs ( "libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" ); functions { liquid_COG //simpleFunctionObjects { type swakExpression; valueType internalField; setName liquidCog; accumulations (sum); expression "sum(pos()*alpha.water*vol())/(vol()*alpha.water)"; //works /*# Time sum 0.01 (0.000309988 0.0903394 0.25)*/ verbose true; outputControl outputTime; } 3. it gives me this: Code:
ls: cannot access /home/afshin/OpenFOAM/afshin-3.0.1/platforms/linux64GccDPInt32Opt/lib: No such file or directory Code:
/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib |
||
February 7, 2016, 14:45 |
|
#13 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Afshin,
Please keep in mind that OpenFOAM is very picky with every single detail Any missing detail can be the reason for it to not work as intended. Quote:
Remember what you posted in your previous post, namely post #10? Namely this: Quote:
Quote:
If this diagnosis is correct, then I need the log file "log.make" that results from this command: Code:
./Allwmake > log.make 2>&1 Code:
gzip < log.make > log.make.gz Best regards, Bruno
__________________
|
||||
February 7, 2016, 18:56 |
|
#14 | |
New Member
Afshin Bakhshi
Join Date: Mar 2014
Posts: 13
Rep Power: 12 |
Quote:
is there a problem in having multiple libs entries ? that's the complete output: Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 3.0.1-119cac7e8750 Exec : interFoam Date : Feb 08 2016 Time : 02:11:19 Host : "afshin-System" PID : 11058 Case : /home/afshin/Desktop/damBreak nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time --> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1179 dlopen error : libsimpleSwakFunctionObjects.so: cannot open shared object file: No such file or directory --> FOAM Warning : From function dlLibraryTable::open(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "libsimpleSwakFunctionObjects.so" --> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1179 dlopen error : libswakFunctionObjects.so: cannot open shared object file: No such file or directory --> FOAM Warning : From function dlLibraryTable::open(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "libswakFunctionObjects.so" --> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1179 dlopen error : libgroovyBC.so: cannot open shared object file: No such file or directory --> FOAM Warning : From function dlLibraryTable::open(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "libgroovyBC.so" --> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1179 dlopen error : libsimpleFunctionObjects.so: cannot open shared object file: No such file or directory --> FOAM Warning : From function dlLibraryTable::open(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "libsimpleFunctionObjects.so" Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading field p_rgh Reading field U Reading/calculating face flux field phi Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian Selecting turbulence model type laminar Reading g Reading hRef Calculating field g.h No MRF models present No finite volume options present DICPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Courant Number mean: 0 max: 0 Starting time loop --> FOAM FATAL ERROR: Unknown function type swakExpression Valid functions are : 4 ( patchProbes probes sets surfaces ) From function functionObject::New(const word& name, const Time&, const dictionary&) in file db/functionObjects/functionObject/functionObject.C at line 92. FOAM exiting Regards, Afshin. |
||
February 7, 2016, 19:24 |
|
#15 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answer: The log file told us the whole story!
The problem is that you built swak4Foam with root powers (probably using sudo), because it tells us that one of the installation folders was this: Code:
/home/afshin/OpenFOAM/root-3.0.1/platforms/linux64GccDPInt32Opt/lib/ OK, let's see if I don't make a mistake in the following code... please carefully run these commands: Code:
cd ~/OpenFOAM mkdir afshin-3.0.1 sudo mv root-3.0.1/* afshin-3.0.1/ sudo chown -R afshin:afshin afshin-3.0.1 Code:
ls -l $FOAM_USER_LIBBIN For example, having the following two lines in "system/controlDict" is wrong: Code:
libs ("libsimpleFunctionObjects.so"); libs ("libsimpleSwakFunctionObjects.so"); Code:
libs ("libsimpleFunctionObjects.so" "libsimpleSwakFunctionObjects.so" ); |
|
February 8, 2016, 09:16 |
|
#16 | |
New Member
Afshin Bakhshi
Join Date: Mar 2014
Posts: 13
Rep Power: 12 |
Quote:
thank you for your kind help. but I can't get my code to work: Code:
functions { liquid_COG //simpleFunctionObjects { type swakExpression; valueType internalField; setName liquidCog; accumulations (sum); expression "sum(pos()*alpha.water*vol())/(vol()*alpha.water)"; verbose true; outputControl outputTime; } } Code:
Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading field p_rgh Reading field U Reading/calculating face flux field phi Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian Selecting turbulence model type laminar Reading g Reading hRef Calculating field g.h No MRF models present No finite volume options present DICPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Courant Number mean: 0 max: 0 Starting time loop --> FOAM Warning : From function simpleFunctionObject::simpleFunctionObject in file simpleFunctionObject/simpleFunctionObject.C at line 109 'outputControlMode' not found in liquid_COG Assuming: timeStep --> FOAM Warning : From function simpleFunctionObject::simpleFunctionObject in file simpleFunctionObject/simpleFunctionObject.C at line 117 'outputInterval' not found in liquid_COG Assuming: 1 swak4Foam: Setting default mesh Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 deltaT = 0.00119048 Time = 0.00119048 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 0, Final residual = 0, No Iterations 0 Phase-1 volume fraction = 0.130194 Min(alpha.water) = 0 Max(alpha.water) = 1 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.130194 Min(alpha.water) = 0 Max(alpha.water) = 1 DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 0.00312205, No Iterations 1 time step continuity errors : sum local = 0.000863557, global = 1.26712e-12, cumulative = 1.26712e-12 DICPCG: Solving for p_rgh, Initial residual = 0.00146358, Final residual = 6.1835e-05, No Iterations 13 time step continuity errors : sum local = 3.64891e-05, global = 1.00147e-05, cumulative = 1.00147e-05 DICPCG: Solving for p_rgh, Initial residual = 5.08691e-05, Final residual = 8.19239e-08, No Iterations 48 time step continuity errors : sum local = 5.88452e-08, global = -1.01668e-08, cumulative = 1.00045e-05 ExecutionTime = 0.19 s ClockTime = 1 s Expression liquid_COG : swak4Foam: Allocating new repository for sampledMeshes swak4Foam: Allocating new repository for sampledGlobalVariables --> FOAM Warning : From function ConcretePluginFunction<DriverType>::exists in file lnInclude/ConcretePluginFunction.C at line 121 Constructor table of plugin functions for FieldValueExpressionDriver is not initialized --> FOAM FATAL ERROR: Parser Error for driver FieldValueExpressionDriver at "1.11-15" :"field alpha not existing or of wrong type" "sum(pos()*alpha.water*vol())/(vol()*alpha.water)" ^^^^^ ------------| Context of the error: - From dictionary: /home/afshin/Desktop/damBreak/system/controlDict.functions.liquid_COG Evaluating expression "sum(pos()*alpha.water*vol())/(vol()*alpha.water)" From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 1204. FOAM exiting |
||
February 14, 2016, 17:02 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answer: "alpha.water" problem... that has to do with a problem that swak4Foam has with field names that have dots in their names. Googling... results:
|
|
November 22, 2018, 22:08 |
|
#18 |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 17 |
Hi,
I would like the output time step of swakExpression be written in 7 precisions. My current command is as following: Code:
interfaceTemp { ignore_unimplemented_simpleFunctionObject::updateMesh true; aliases { alpha1 alpha.water; } type swakExpression; valueType surface; surfaceName interface1; surface { type isoSurface; isoField alpha.water; isoValue 0.9; interpolate true; writePrecision 7; } verbose true; expression "T"; accumulations ( average min max ); outputInterval 20; timePrecision 7; } But it is still written in 4, although the processing time step precision is 7: # Time average min max 31.8321 343.078 342.996 362.95 31.8321 343.065 341.481 362.862 31.8321 343.061 342.085 362.834 I will apprciate any help. Cheers, Elham |
|
November 23, 2018, 09:53 |
|
#19 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
AFAIK (but I'd have to check the sources to be sure) swak makes no effort to change the write precision. So unless the underlying Foam-implementation doesn't support this on a functionObject-level (I'm not aware of this) your best chance is to set it in the controlDict for the whole run (everything will be written with 7 digits)
__________________
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 |
||
November 25, 2018, 06:40 |
|
#20 | |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 17 |
Quote:
|
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error in compiling new drag model | k.farnagh | OpenFOAM Programming & Development | 13 | May 21, 2016 04:08 |
compressible flow in turbocharger | riesotto | OpenFOAM | 50 | May 26, 2014 02:47 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
Compilation errors in ThirdPartymallochoard | feng_w | OpenFOAM Installation | 1 | January 25, 2009 07:59 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |