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

How to get the value of deltaT in OpenFOAM?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree14Likes
  • 7 Post By fumiya
  • 5 Post By fumiya
  • 2 Post By alundilong

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2013, 02:31
Question How to get the value of deltaT in OpenFOAM?
  #1
New Member
 
anonymous
Join Date: Apr 2010
Posts: 14
Rep Power: 16
shchao is on a distinguished road
Dear FOAMers:
I want to use the value of deltaT, known as time steppness ,while calculation in fvMotionSolver lib.Does OpenFOAM define this varible?Or How can I calculate the time stepness, esspecially in interFoam?Thank you!

Last edited by shchao; March 2, 2013 at 02:57.
shchao is offline   Reply With Quote

Old   March 2, 2013, 03:44
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
You can use runTime.deltaTValue().
fumiya is offline   Reply With Quote

Old   March 2, 2013, 04:57
Exclamation Thank you for your reply but it seems there's a little problem
  #3
New Member
 
anonymous
Join Date: Apr 2010
Posts: 14
Rep Power: 16
shchao is on a distinguished road
Hi,Fumiya!
Thank you for your reply!
I'm using a piston-type wavemaker derived from oscillatingDisplacement in fvMotionSolver.When i add runTime.deltaTValue() into the code and excute the wmake libso command.It returns an error --'runTime' doesn't declare in this scope.I have include the setDeltaT.H in the file.
shchao is offline   Reply With Quote

Old   March 2, 2013, 05:56
Default
  #4
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
Hi shchao,

How about this->db().time().deltaTValue()?

Fumiya
fumiya is offline   Reply With Quote

Old   March 2, 2013, 06:40
Thumbs up It works!Thank you!
  #5
New Member
 
anonymous
Join Date: Apr 2010
Posts: 14
Rep Power: 16
shchao is on a distinguished road
Hi,Fumiya
I've modified the code as you said. And it works.Thank you sincerely!
shchao is offline   Reply With Quote

Old   November 5, 2013, 08:59
Default
  #6
New Member
 
Jarvis
Join Date: Jun 2013
Posts: 14
Rep Power: 12
nbyjn is on a distinguished road
Quote:
Originally Posted by shchao View Post
Hi,Fumiya!
Thank you for your reply!
I'm using a piston-type wavemaker derived from oscillatingDisplacement in fvMotionSolver.When i add runTime.deltaTValue() into the code and excute the wmake libso command.It returns an error --'runTime' doesn't declare in this scope.I have include the setDeltaT.H in the file.
Hi shchao,
Glad to meet you! I'm also using a piston-type wavemaker by interDyMFoam.
But I have two questions:
1.At the starttime, the piston(left boundary) moves rightward, so the water level should rise. But in fact, the water goes down! Do you have the same question?
2.interDyMFoam change the timestep automaticly, so the slover runs slower and slower. It's so slow that it can't calculate for 0.1s in a whole night! Can you give me some advice?
Thank you very much!
nbyjn is offline   Reply With Quote

Old   October 12, 2014, 09:04
Default
  #7
Member
 
Ed Ransley
Join Date: Jul 2012
Posts: 30
Rep Power: 13
Ed R is on a distinguished road
Hi all,

I'm trying to use deltaT in a restraint on sixDoFRigidBodyMotion solver. I've tried both the runTime.deltaTValue() and db().time().deltaTValue() and neither runTime nor db are define in the scope.

Which .H files do I need to include in order to use runTime or is it significantly more difficult than that?

Thanks,

Ed
Ed R is offline   Reply With Quote

Old   January 14, 2016, 14:09
Default
  #8
Member
 
yijin Mao
Join Date: May 2010
Location: Columbia, MO
Posts: 62
Rep Power: 15
alundilong is on a distinguished road
you might try.
runTime.time().deltaT();
if you need scalar
runTime.time().deltaT().value();

Quote:
Originally Posted by Ed R View Post
Hi all,

I'm trying to use deltaT in a restraint on sixDoFRigidBodyMotion solver. I've tried both the runTime.deltaTValue() and db().time().deltaTValue() and neither runTime nor db are define in the scope.

Which .H files do I need to include in order to use runTime or is it significantly more difficult than that?

Thanks,

Ed
stanweer and sultimate like this.
alundilong is offline   Reply With Quote

Old   March 19, 2021, 09:31
Default
  #9
New Member
 
Guanwen Luo
Join Date: Jan 2021
Posts: 6
Rep Power: 5
zzluozz11 is on a distinguished road
Quote:
Originally Posted by alundilong View Post
you might try.
runTime.time().deltaT();
if you need scalar
runTime.time().deltaT().value();
Hi, I got an error "runtime was not declared in this scope", eventhough I add the head file "time.h". Please tell me how to deal with it. Thanks.
zzluozz11 is offline   Reply With Quote

Old   March 7, 2022, 08:15
Default
  #10
New Member
 
Join Date: Oct 2021
Posts: 5
Rep Power: 4
ali moeni is on a distinguished road
Hi
You can try runTime.deltaT(), but I'm not sure if it works
ali moeni is offline   Reply With Quote

Old   March 7, 2022, 10:32
Default
  #11
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by zzluozz11 View Post
Hi, I got an error "runtime was not declared in this scope", eventhough I add the head file "time.h". Please tell me how to deal with it. Thanks.

Sure, but runTime is a variable. See for example,
https://www.openfoam.com/documentati...8H_source.html
olesen is offline   Reply With Quote

Old   August 26, 2022, 04:02
Default
  #12
New Member
 
Gavin.
Join Date: Aug 2022
Posts: 4
Rep Power: 3
GavinRe is on a distinguished road
I need help setting up my deltaT, maxCo and maxAlphaCo(?) for my simulation. I am trying to simulate flow across a vertical cylinder ; which I based on interFoam/RAS/weirOverFlow tutorial.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     interFoam;

startFrom       latestTime;

startTime       0;

stopAt            endTime;

endTime         1;

deltaT             0.01;

writeControl    adjustableRunTime;

writeInterval    0.1;

purgeWrite       0;

writeFormat     binary;

writePrecision   6;

writeCompression    off;

timeFormat       general;

timePrecision    6;

runTimeModifiable yes;

adjustTimeStep  on;

maxCo             0.2;
maxAlphaCo     0.2;

maxDeltaT       1;

// ************************************************************************* //
The solver stop halfway and when I tried running my simulation on paraview, the water does not rise/flow.
view.PNG
GavinRe is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
feature or bug - deltaT issue lakeat OpenFOAM Running, Solving & CFD 29 August 8, 2020 02:34
openfoam 1.5-dev on opensuse10.3-64bit anon_c OpenFOAM 2 December 4, 2009 01:33
Issues with OpenFoam sanjibdsharma OpenFOAM 0 August 14, 2009 09:41
2009 OpenFOAM Summer School in Zagreb, Croatia hjasak OpenFOAM Announcements from Other Sources 0 March 27, 2009 13:08
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25


All times are GMT -4. The time now is 05:40.