CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Restart simulation with different inflow

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By cmgotelli

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2019, 00:46
Default Restart simulation with different inflow
  #1
New Member
 
Clemente
Join Date: Dec 2019
Posts: 8
Rep Power: 7
cmgotelli is on a distinguished road
Hi all! I'm running a simulation with interFoam and I have a (maybe) dumb question. I'm trying to restart a simulation from the 30 second, but using a different inflow rate. I've tried copying the solution from the folder "30" into a folder named "0", changing the initialConditions file in the path "0/include". Nevertheless, the after running the simulation I can't see any change in the results, it's like the flow never increased.
I've looked in forums but the answers I've found are for restarting with the same flow. Can any of you help me please?

Thanks in advance!
cmgotelli is offline   Reply With Quote

Old   December 9, 2019, 07:36
Default
  #2
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
you might want to post your files, but initialConditions are the conditions for the first guess at the flow field. You want to change your boundary conditions to increase the flow rate.
Bazinga is offline   Reply With Quote

Old   December 9, 2019, 07:48
Default
  #3
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8
Krao is on a distinguished road
Hi Clemente,

I would like to know, why you are copying the results into the 0 folder. You can resume your simulation from the latest time step, by editing your controlDict. As Mr. Bazinga told, you need to change the boundary conditions, to the new flow rate. You can edit your the BCs in the last time step, and continue the simulation from there onwards.
Krao is offline   Reply With Quote

Old   December 9, 2019, 08:00
Default
  #4
New Member
 
Clemente
Join Date: Dec 2019
Posts: 8
Rep Power: 7
cmgotelli is on a distinguished road
Hi Krao,


Thanks for your reply.


Quote:
I would like to know, why you are copying the results into the 0 folder

I'm doing it just to try something different, originally I just use the LatestTime setting in controlDict.


Quote:
You can edit your the BCs in the last time step, and continue the simulation from there onwards.

To do this I only have to replace the U file, or do I have to do something else?
Thank you again!!
cmgotelli is offline   Reply With Quote

Old   December 9, 2019, 08:03
Default
  #5
New Member
 
Clemente
Join Date: Dec 2019
Posts: 8
Rep Power: 7
cmgotelli is on a distinguished road
Thank you Bazinga for replying! This are my files:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     interFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         100;

deltaT          0.001;

writeControl    adjustableRunTime;

writeInterval   0.1;

purgeWrite      0;

writeFormat     binary;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  on;

maxCo           0.1;
maxAlphaCo      0.1;

maxDeltaT       1;

// ************************************************************************* //

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}

5         
(
    atmosphere
    {
        type patch;
        nFaces 89;
        startFace 3962;
    }
    inlet
    {
        type patch;
        nFaces 48;
        startFace 4051;
    }
    lowerWall
    {
        type wall;
        nFaces 128;
        startFace 4099;
    }
    outlet
    {
        type Unspecified;
        nFaces 19;
        startFace 4227;
    }
    BaseAndTop
    {
        type empty;
        nFaces 4104;
        startFace 4246;
    }
)

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include        "include/initialConditions"

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            variableHeightFlowRateInletVelocity;
        flowRate        $inletFlowRate;
        alpha           alpha.water;
        value           uniform (0 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            noSlip;
    }

    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //



Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/

inletFlowRate        60;
pressure             0;
turbulentKE          4.14e-03;
turbulentEpsilon     4.39e-05;

// ************************************************************************* //

As I read from you and Krao, I have to change the last two files in the latestTime that was recorded, right?


Thank you again!
cmgotelli is offline   Reply With Quote

Old   December 9, 2019, 08:12
Default
  #6
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8
Krao is on a distinguished road
Yes you need to edit the last two files, but I don't think they are required to be replaced.

Assuming that you have a fully developed flow at the latest time step, it is worth to make use of the simulation results obtained so far. So, I would insert the new values into the required part/patch, by editing the files in the required U/K/epsilon/P files in the latest time step folder. Or, if you think that would not make any sense, you can replace and continue.
Krao is offline   Reply With Quote

Old   December 9, 2019, 08:24
Default
  #7
New Member
 
Clemente
Join Date: Dec 2019
Posts: 8
Rep Power: 7
cmgotelli is on a distinguished road
ohh that's great! One last thing, there's any way to edit these files if they are written in binary, or do I have to write the results in ascii format only?


thanks again!
cmgotelli is offline   Reply With Quote

Old   December 9, 2019, 08:30
Default
  #8
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8
Krao is on a distinguished road
Not required, Binary is ok! But don't open these binary files in standard editors, as it makes the process slow. Use vi editor in your terminal to open and edit these files. Search for the particular patch and edit it. If you are not familiar with Linux terminal use the following link to explore more http://www.wolfdynamics.com/images/O...rash_intro.pdf
Krao is offline   Reply With Quote

Old   December 9, 2019, 08:35
Default
  #9
New Member
 
Clemente
Join Date: Dec 2019
Posts: 8
Rep Power: 7
cmgotelli is on a distinguished road
Yes, I'm using Ubuntu actually. The thing is that when I use the vi editor to open these files I get something weird. Attached is an image, maybe I have to use another editor like vim?
Attached Images
File Type: jpg Screenshot from 2019-12-09 09-31-42.jpg (76.1 KB, 26 views)
cmgotelli is offline   Reply With Quote

Old   December 9, 2019, 08:50
Default
  #10
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8
Krao is on a distinguished road
What you are getting is absolutely okay, try to search the required patch in the file. For example inlet patch.
Krao is offline   Reply With Quote

Old   December 9, 2019, 08:55
Default
  #11
New Member
 
Clemente
Join Date: Dec 2019
Posts: 8
Rep Power: 7
cmgotelli is on a distinguished road
OMG you're right! hahaha I think that I just have to change the "flowRate", right?
Attached Images
File Type: png Screenshot from 2019-12-09 09-53-24.png (69.5 KB, 30 views)
cmgotelli is offline   Reply With Quote

Old   December 9, 2019, 08:57
Default
  #12
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8
Krao is on a distinguished road
Yes you are ready to go from here!
Krao is offline   Reply With Quote

Old   December 9, 2019, 09:11
Default
  #13
New Member
 
Clemente
Join Date: Dec 2019
Posts: 8
Rep Power: 7
cmgotelli is on a distinguished road
Thanks! I really appreciate your help! <3
Krao likes this.
cmgotelli is offline   Reply With Quote

Reply

Tags
initial condition, interfoam, restart


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restart simulation using results from other solver sahmed OpenFOAM Running, Solving & CFD 8 July 5, 2019 07:02
Mapping Field Data for Mesh Regions from Another Simulation veterator OpenFOAM Pre-Processing 1 July 10, 2018 06:28
restart the simulation kmgraju CFX 2 November 21, 2013 09:27
restart simulation darookie CFX 8 January 14, 2013 03:18
Error when restart simulation zebu83 OpenFOAM 0 October 20, 2009 05:30


All times are GMT -4. The time now is 16:53.