CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

change U and controlDict from shell

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 3 Post By Flowkersma
  • 1 Post By Flowkersma
  • 1 Post By Flowkersma

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 8, 2020, 16:04
Default change U and controlDict from shell
  #1
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Hi everyone

A boundary condition in the /U directory looks like this:

Code:
    outlet
    {
        type            fixedValue;
	value		uniform (0 VALUE 0);	//fixed inlet velocity
    }
where 6 different numbers are stored in a .dat file for VALUE. Every 5 seconds I would like to change VALUE from the first listed number to the second, and so forth, until all numbers in VALUE are ran.

I thought the easiest way to implement this is a shell script, something like this:

Code:
#!/bin/sh
setFields
decomposePar
mpirun -np 16 interFoam -parallel
but obviously more must be added. I'm thinking if I set the controlDict startFrom parameter to latestTime, I could essentially just run the simulation over again (I'm running in parallel, but this doesn't matter, right?), though two parameters must be changed from the shell:


1) in controlDict the endtime needs to be 5 seconds larger than it previously was

2) VALUE in the /U directory needs to grab the next number from the .dat file.

Any help is so appreciated!
joshmccraney is offline   Reply With Quote

 


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
Change MotorBike Tutorial to Water connoranderson OpenFOAM Running, Solving & CFD 0 January 7, 2015 20:57
controlDict and sampleDict giving different results Shenan OpenFOAM Post-Processing 2 November 15, 2014 10:15
Forces not calculated when including a library in controlDict fusij OpenFOAM 2 May 13, 2011 07:25
writing controlDict as otherfields ubaid OpenFOAM 5 September 29, 2010 07:28
FoamXException by change in controlDict vladimir OpenFOAM Pre-Processing 2 March 14, 2007 14:32


All times are GMT -4. The time now is 12:48.