|
[Sponsors] |
August 5, 2013, 16:02 |
sampleDict output needs to be fixed!
|
#1 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear all:
The out out from sample dict for pressures need to be fixed. My code in sample dict was as follows: leftwall { type patch; patches (leftWall); rhoName rhoInf; rhoInf 998.2; //Reference density for fluid interpolate true; triangulate false; } the output is as shown in the attached images. The output filenames are not consistent. Can some one tell me how/where to fix this so that it is either leftwalls or leftwall? If on the otherhand the same code is embedded in controlDict, the files names come out as .leftwalls. Thanks! |
|
August 5, 2013, 16:04 |
|
#2 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
looks like the image did not attach. Here goes....
|
|
August 6, 2013, 10:51 |
output time interval in sample dict
|
#3 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Can anyone tell me if the output time can be set in sampledict? IN controldict for example, I can specify the output at 0.05 secs. I did a run with this time interval. However I would now like obtain output at 0.01 by using sampleDict, without running the solver again.
I am running the sloshingTan2D example in interDyMFOAM. Thankyou Musa |
|
August 17, 2013, 08:43 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Musaddeque,
From your description, it looks like you used 0.05 for writing outputs from the solver and now you want to sample with another period, although I'm not 100% if you want 0.01 or 0.1. So, there are two possible situations:
Bruno
__________________
|
|
August 27, 2013, 16:45 |
ControlDict error for forces
|
#5 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Thanks for the response. I think it is better to rerun controDict rather than add more code for post processing. I have, however another problem. I noted that OpenFOAM lets you obtain forces using the following code snippet in the controlDict:
Code:
forces { type forces; functionObjectLibs ("libforces.so"); //Lib to load patches (leftWall rightWall lowerWall); pName p; UName U; rhoName rhoInf; rhoInf 998.2; //Reference density for fluid nuInf 1e-06 CofR (0 -0.071 0.25); //Origin for moment calculations outputControl timeStep; outputInterval 1; } Code:
Starting time loop Reading surface description: leftwalls rightwalls --> FOAM Warning : From function void forces::read(const dictionary&) in file forces/forces.C at line 509 Could not find U, p: in database. De-activating forces. Interface Courant Number mean: 0 max: 0 Courant Number mean: 0.000151945 max: 0.00047273 deltaT = 0.00116279 Time = 0.00116279 Last edited by wyldckat; August 27, 2013 at 19:30. Reason: Added [CODE][/CODE] |
|
August 27, 2013, 18:18 |
keyword nu is undefined in dictionary "home/..../transportProperties"
|
#6 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Please ignore the previous post. I had a colon after the p and not a semi-colon. So I was getting an error and am now not getting an error. However, now I get an error that looks like this:
[9] --> FOAM FATAL IO ERROR: [9] keyword nu is undefined in dictionary "/home/cfsengineers/OpenFOAM/cfsengineers-2.2.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/processor9/constant/transportProperties" [9] [9] file: /home/cfsengineers/OpenFOAM/cfsengineers-2.2.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/processor9/constant/transportProperties from line 0 to line 0. nu is defined in the transportProperties. However, the lines referenced are line 0 to line 0. I cant understand what this means. Can anyone help? |
|
August 27, 2013, 19:33 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
That's a bit strange. Does the file "processor9/constant/transportProperties" exist? And is it empty or does it have the same contents as the one at the main "constant/transportProperties"? Because the message about "line 0 to 0" means that the file is either empty or non-existent, or something went wrong when reading the file, such as not enough permissions or the file is binary or something like that. Best regards, Bruno
__________________
|
|
August 27, 2013, 22:00 |
|
#8 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
I agree that it is indeed strange. The transport properties file is as follows:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Phase1 is water; phase2 is air. Values for Standard Temperature and pressure (0 deg C, 14.69 psi // or 101.325 kPa, ) in accordance with NIST // phase1 { transportModel Newtonian; nu nu [ 0 2 -1 0 0 0 0 ] 1e-06; rho rho [ 1 -3 0 0 0 0 0 ] 998.2; } phase2 { transportModel Newtonian; nu nu [ 0 2 -1 0 0 0 0 ] 1.50e-05; rho rho [ 1 -3 0 0 0 0 0 ] 1.2; } sigma sigma [ 1 0 -2 0 0 0 0 ] 0; // ************************************************************************* // Last edited by wyldckat; August 28, 2013 at 16:10. Reason: Added [CODE][/CODE] |
|
August 27, 2013, 22:25 |
|
#9 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
|
||
August 28, 2013, 16:24 |
|
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
Decomposition is usually only performed for the fields and mesh. All other dictionary files are meant to be only placed on the base case folder, since this way they will either:
The problem can be that you are trying to use something that is not aware that it should be looking in the base case folder and not inside the processor folder, which leads to this problem. Wait... you're trying to use the forces function object, correct? Is there any other functions objects you are trying to use? I ask this because there is a another possibility: the solver or function object might be trying to find the main "nu" value, as if there was only one fluid. But your case has got two fluids, which means that whatever you are using was only conceived for a single fluid. Best regards, Bruno
__________________
|
|
August 28, 2013, 17:13 |
|
#11 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
I am trying to capture wall pressure and wall forces. For the first one I am calling "libsurfaces.so" and for the second one "libforces.so". The nu error comes up when I call "libforces.so" and not when I call "libsurfaces.so"
My controldict code is as follows: Code:
\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interDyMFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 48; //endTime 0.02; //deltaT 0.01; deltaT 0.001; writeControl adjustableRunTime; writeInterval 0.05; //writeInterval 0.02; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression compressed; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep yes; maxCo 0.5; maxAlphaCo 0.5; maxDeltaT 1; functions { // probes // { // type probes; // functionObjectLibs ("libsampling.so"); // outputControl outputTime; // outputInterval 1; // probeLocations // ( // ( 0 -20.0 0 ) // ( 0 20.0 0 ) // ); // fields // ( // p // ); // } wallPressure { type surfaces; functionObjectLibs ("libsampling.so"); outputControl outputTime; surfaceFormat raw; fields ( alpha1 p ); interpolationScheme cell; surfaces ( leftwalls { type patch; patches (leftWall); interpolate true; triangulate false; } rightwalls { type patch; patches (rightWall); interpolate true; triangulate false; } ); } forces { type forces; functionObjectLibs ("libforces.so"); //Lib to load outputControl outputTime; patches (leftWall rightWall); pName p; UName U; rhoName rhoInf; rhoInf 998.2; //Reference density for fluid nuInf 1e-06; CofR (0 0 0); //Origin for moment calculations outputControl timeStep; outputInterval 1; } } // end functions Last edited by wyldckat; August 31, 2013 at 12:52. Reason: Added [CODE][/CODE] |
|
August 28, 2013, 17:15 |
|
#12 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
I am sorry - nu is not a problem for libsampling.so not libsurfaces.so
|
|
August 31, 2013, 14:18 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
I've tried the function objects you have on your "controlDict" in the tutorial case "multiphase/interDyMFoam/ras/testTubeMixer". And I found out that the problem comes from trying to use the function object "forces". In addition, it doesn't matter if I run in serial or in parallel. The problem is that you're telling the "forces" function object to use "rhoInf" as the "rho" field, which is used for incompressible flow. But since you're using a solver of the type multiphase, you have 2 "nu" values and respectively 2 "rho" fields. I searched with Google for: Code:
openfoam multiphase forces I suggest you give it a very good read, to learn how to do this! Good luck! Best regards, Bruno edit: if by any chance your patches or walls are all only in contact with a single phase, then perhaps you can use the rho for that phase. For example: Code:
rhoName rho1; Code:
rhoName rho2;
__________________
Last edited by wyldckat; August 31, 2013 at 14:43. Reason: see "edit:" |
|
September 6, 2013, 04:58 |
|
#14 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15 |
Hi Bruno, hi musahossein,
I have looked up your suggestions. Seems to me that the file Forces.C has to be altered and recompiled. There are several cases mentioned that cover a couple of other solvers than interFoam. Reading the code there the program is looking for a something named "obr_.foundObject" to identify which model to apply. First it Looks for RAS, and indeed I have a RASproperties file (even thoughI do not know what it is good for since flow conditions are laminar). At this point the code asks for rho(), which may not be defined for the interFoam solver. The Definition of RAS seems to broad to me. Later on in the code it calls for LESModel, this will not apply anyway, then for "basicThermo". I do not know what this is. Finally, the program looks for singlePhaseTransportModel. This is whare the nu error seems to be generated. Is there any obr_.foundObject variable identifying interDymFoam or InterFoam? Maybe use multiPhaseTransportModel as an identifier? Is there an identifier just for 2-phase laminar flow? Another question: The above mentioned thread treats the shear Forces generated, but there should also be the system pressure somewhere. For single Phase incompressible this is p x rho or p_rgh - rho g h if you have defined gravity. For a two Phase System, the Definition of p_rgh does not make much sense to me. Where do I find the proper pressure Definition? Does the definition of p_rgh really make sense for InterFoam? Regards, Daniel |
|
September 6, 2013, 09:23 |
|
#15 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
danny123:
I am running interDymfoam for sloshingtank 2d case. I am using a 12 core server to run my code. My controldict referenced libforces.so. When I ran it the first time, error message "keyword nu not found" came up for each processor which did not make sense. The workaround involved making the following change to two files as described below: In turbulence properties set: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType RASModel; // ************************************************** *********************** // In rasproperties set: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // RASModel laminar; turbulence off; printCoeffs on; // ************************************************** *********************** // For me this took care of the "nu" issue. However, as has been discussed in this thread, libforces.so still complains when running but does not affect the result. |
|
September 7, 2013, 08:03 |
|
#16 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Musaddeque: Quote:
@Daniel: Quote:
Best regards, Bruno
__________________
|
|||
September 11, 2013, 12:39 |
|
#17 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15 |
Hello musahossein, hello Bruno,
my flow conditions are laminar all time, so I am not worried about turbulence. The method musahossein does indeed calculate forces. Bruno, the method decribed in the post you sent us is not correct. The author may got the calculation of viscous forces right. However, pressure forces are pressure forces. There should be no difference whether it is Phase 1 or 2. For the effect of gravity, I found the following post: http://www.cfd-online.com/Forums/ope...e-gravity.html I agree with author that for multi-phase systems, to account for gravity, you need to add rho() g to all fluid cells instead of using p_rgh static pressure. Do you know if this is implemented in interDymFoam? What kind of pressure definition should I use to account for gravity? Is it sufficient defining pd instead of p and it will use gravity g automatically (p being defined pd / rho I guess)? Regards, Daniel |
|
September 13, 2013, 22:51 |
|
#18 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
http://www.cfd-online.com/Forums/ope...rgh-1-7-a.html |
||
Tags |
leftwall, leftwalls, output file name, sampledict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] outputTime in Swak function | immortality | OpenFOAM Community Contributions | 20 | October 6, 2022 13:08 |
How to control output time of pressureTools functions? | Fluido | OpenFOAM Post-Processing | 1 | May 19, 2014 09:49 |
RNG diverged during the analysis the flow over a multi element airfoil, why? | s.m | OpenFOAM Running, Solving & CFD | 0 | August 5, 2013 09:39 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |
lift and drag on ship superstructures | vaina74 | OpenFOAM Running, Solving & CFD | 3 | June 8, 2010 13:30 |