|
[Sponsors] |
Want to change value of g during case running. i.e after 3 seconds |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 22, 2015, 00:50 |
Want to change value of g during case running. i.e after 3 seconds
|
#1 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
i want to apply value of g in a different way. i want to change value of g after half of endTime. Is there any way to do that???? i tried if else statement but it doesnt work and terminates with this error
--> FOAM FATAL IO ERROR: "ill defined primitiveEntry starting at keyword 'if' on line 19 and ending at line 28" file: /home/usman/OpenFOAM/project2D/constant/g at line 28. From function primitiveEntry::readEntry(const dictionary&, Istream&) in file lnInclude/IOerror.C at line 132. FOAM exiting |
|
March 22, 2015, 01:15 |
Help required. i want to change value of g after half of endTime
|
#2 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
hye i want to change value of g after half of endTime. i did the following changes in g file
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class uniformDimensionedVectorField; location "constant"; object g; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; double B; value (B -9.81 0) if (runTime.timeName() < ( endTime / 2)) {B = 0} else {B = 15}; // ************************************************** *********************** // but the error was Reading g --> FOAM FATAL IO ERROR: wrong token type - expected Scalar, found on line 19 the word 'B' file: /home/usman/OpenFOAM/project2D/constant/g.value at line 19. From function operator>>(Istream&, Scalar&) in file lnInclude/Scalar.C at line 93. FOAM exiting please help me how can i do that |
|
March 22, 2015, 01:40 |
|
#3 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
hello foamers i also have a similer problem.
i just want to do this double B; value (B -9.81 0) if (runTime.timeName() < ( endTime / 2)) {B = 0} else {B = 15;} please tell me how to do this. i am new in openfoam and programming |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running AMI case in parallel | Kaskade | OpenFOAM Running, Solving & CFD | 3 | March 14, 2016 15:58 |
running a case of multiphase Nozzle 2d | harsha_kulkarni | OpenFOAM Running, Solving & CFD | 3 | June 19, 2014 04:29 |
facing high courant number while running the case in OpenFOAM | Nikhil Thakur | Main CFD Forum | 1 | July 30, 2012 04:23 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 12:24 |
How to save a case running in background | us | FLUENT | 0 | July 6, 2005 10:43 |