|
[Sponsors] |
[swak4Foam] Using lookuptables in momentumSourceDict with swak4Foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 10, 2013, 13:43 |
|
#21 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
October 27, 2013, 11:07 |
Create a new field from an expression
|
#22 |
Member
alighaffari
Join Date: May 2011
Posts: 31
Rep Power: 15 |
Hi Dear Bernhard
thanks for your posts, replies and "swak4Foam". I could solve a PDE using "solveLaplacianPDE" function But I have another question on the "expessionField" function. I am trying to create and calculate a new transformed velocity field using this function. I followed ,for starting, the example available in slides on swak4Foam (No C++, please. We’re users!, Bernhard F.W. Gschaider, June 2011, slide number 61/176): --------------------------------------------------------------------------------------------------------------------------------- libs ( " libswakFunctionObjects .so" ); functions ( liquidVel { type expressionField; outputControl outputTime; //outputInterval 1; fieldName Uliquid; expression "U*alpha1"; autowrite true } ) ; --------------------------------------------------------------------------------------------------------------------------------------- but it does not work and OpenFoam gives the following error: --------------------------------------------------------------------------------------------------------------------------------------- /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.1.x-0cbac23c1af5 Exec : interFoamWithSources Date : Oct 27 2013 Time : 17:53:21 Host : "ali-pc" PID : 2918 Case : /home/ali/OpenFOAM/ali-2.1.x/run/Afkhami2008/cylinder-radius0.2-sourceterm-PDE nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading field p_rgh Reading field alpha1 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 Calculating field g.h time step continuity errors : sum local = 0, global = 0, cumulative = 0 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 IO ERROR: attempt to read beyond EOF file: /home/ali/OpenFOAM/ali-2.1.x/run/Afkhami2008/cylinder-radius0.2-sourceterm-PDE/system/controlDict::functions at line 88. From function ITstream::read(token&) in file db/IOstreams/Tstreams/ITstream.C at line 83. FOAM exiting ----------------------------------------------------------------------------------------------------------------------------------- I have created the "Uliquid" file in the "0" folder based on the "U" file. I have no idea on this error message. I'm Looking forward to some directions. your valuable time is highly appreciated. thanks, Ali Ghaffari |
|
October 28, 2013, 05:13 |
|
#23 | |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
you missed semicolon in your expression, it should be like that:
Quote:
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
||
October 28, 2013, 10:23 |
|
#24 |
Member
alighaffari
Join Date: May 2011
Posts: 31
Rep Power: 15 |
||
October 28, 2013, 19:25 |
|
#25 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Is it maybe the line "autowrite true" without the semicolon?
__________________
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 |
||
October 29, 2013, 10:52 |
|
#26 |
Member
alighaffari
Join Date: May 2011
Posts: 31
Rep Power: 15 |
Hi Dear Bernhard Gschaider
yes it was the reason for error : "autowrite true" without the semicolon. thanks so much. |
|
November 4, 2013, 12:07 |
|
#27 |
Member
alighaffari
Join Date: May 2011
Posts: 31
Rep Power: 15 |
Hi Dear Bernhard Gschaider
Its me again with another question. I have calculated the magnitude of the gradient of a scalar field in two ways: 1) by using the "magGrad" from "foamCalc" utility: foamCalc magGrad distance 2) by defining a new Field in "controldict" file: functions( distGrad { type expressionField; outputControl timeStep; outputInterval 1; fieldName graddistance; expression "-grad(distance)"; autowrite true; } ); and finally I have calculated the magnitude of the new field "graddistance". ("distance" is a new scalar field which is calculated from solving the Laplaces equation via "solveLaplacianPDE" function.) But the results are very much different (in order of 1000000). It is so strange and confusing for me. Which way is more reliable? I need the gradient of "distance" in the solution time. Is there any better method for its calculation? Thank you Regards |
|
November 4, 2013, 12:19 |
|
#28 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 5, 2013, 10:05 |
|
#29 |
Member
alighaffari
Join Date: May 2011
Posts: 31
Rep Power: 15 |
the difference is all over the solution domain. It seems that the results from magGrad function from "foamCalc" are true. But I need the gradient over the solution time. What can I do? Is there any other Method?
|
|
November 8, 2013, 18:31 |
|
#30 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
That's strange. "mag(grad(T))" in swak uses the same functions as magGrad. I think I need to see pictures of the differences to tell what might be the problem
__________________
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 9, 2013, 10:18 |
|
#31 |
Member
alighaffari
Join Date: May 2011
Posts: 31
Rep Power: 15 |
Dear Bernhard Gschaider
Thanks for your attention. I could finally find the reason of the differences. It was due to the "writePrecision" in the controlDict file. The differences were existed when the default value ,6, was chosen. But by increasing the "writePrecision" the differences decreased. finally no differences were observed by choosing the "20" for "writePrecision". I think that the "magGrad" function from "foamCalc" reads the data from written results files But the "grad" function from "swak" reads data from RAM. Please correct me if I am wrong? thanks Ali |
|
November 9, 2013, 20:08 |
|
#32 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
So that problem solved itself? Fine.
__________________
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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
InterDyMFoam+simpleFunctionObject | Elham | OpenFOAM Running, Solving & CFD | 5 | July 10, 2017 12:59 |
[swak4Foam] and twoPhaseEulerFoam | mnikku | OpenFOAM Community Contributions | 1 | February 19, 2016 06:21 |
source term in near wall cell | rajcfd | OpenFOAM Pre-Processing | 5 | February 1, 2016 11:31 |
[swak4Foam] Install swak4Foam on OpenFOAM1.7.1 on Ubuntu 13.04 | kobayashi | OpenFOAM Community Contributions | 2 | January 5, 2014 18:33 |
[swak4Foam] fails in parallel with -otherTime? | Phicau | OpenFOAM Community Contributions | 3 | June 26, 2013 14:00 |