Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_OpenThrustFile.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: open file for thrust history.
26 !
27 ! Description: none.
28 !
29 ! Input: global = case name, steady/unsteady flow.
30 !
31 ! Output: to file.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_OpenThrustFile.F90,v 1.3 2008/12/06 08:44:27 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_openthrustfile( global )
44 
45  USE moddatatypes
46  USE moderror
47  USE modglobal, ONLY : t_global
48  USE modmpi
49  USE modparameters
50  IMPLICIT NONE
51 
52 ! ... parameters
53  TYPE(t_global), POINTER :: global
54 
55 ! ... local variables
56  CHARACTER(CHRLEN+4) :: fname
57 
58  INTEGER :: errorflag
59 
60 !******************************************************************************
61 
62  CALL registerfunction( global,'RFLO_OpenThrustFile',&
63  'RFLO_OpenThrustFile.F90' )
64 
65 ! open file
66 
67  IF (global%myProcid == masterproc) THEN
68  fname = trim(global%outDir)//trim(global%casename)//'.thr'
69 
70 ! - append to existing file (restart) or create new file
71 
72  IF ((global%flowType==flow_unsteady .AND. global%currentTime>0._rfreal).OR.&
73  (global%flowType==flow_steady .AND. global%currentIter>1)) THEN
74  OPEN(if_thrust,file=fname,form='formatted',status='old', &
75  position='append',iostat=errorflag)
76  ELSE
77  OPEN(if_thrust,file=fname,form='formatted',status='unknown', &
78  iostat=errorflag)
79  ENDIF
80  global%error = errorflag
81  IF (global%error /= 0) &
82  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
83 
84 ! - write header
85 
86  IF (global%thrustPlane == xcoord) &
87  WRITE(if_thrust,1000,iostat=errorflag) 'x',global%thrustCoord
88  IF (global%thrustPlane == ycoord) &
89  WRITE(if_thrust,1000,iostat=errorflag) 'y',global%thrustCoord
90  IF (global%thrustPlane == zcoord) &
91  WRITE(if_thrust,1000,iostat=errorflag) 'z',global%thrustCoord
92  global%error = errorflag
93  IF (global%error /= 0) &
94  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
95  ENDIF
96 
97 ! finalize
98 
99  CALL deregisterfunction( global )
100 
101 ! format
102 
103 1000 FORMAT('# thrust history (iteration/time, momentum, ', &
104  ' pressure, total thrust [N])',/,'# ',a,' = ',1pe13.5)
105 
106 END SUBROUTINE rflo_openthrustfile
107 
108 !******************************************************************************
109 !
110 ! RCS Revision history:
111 !
112 ! $Log: RFLO_OpenThrustFile.F90,v $
113 ! Revision 1.3 2008/12/06 08:44:27 mtcampbe
114 ! Updated license.
115 !
116 ! Revision 1.2 2008/11/19 22:17:38 mtcampbe
117 ! Added Illinois Open Source License/Copyright
118 !
119 ! Revision 1.1 2004/11/29 20:51:39 wasistho
120 ! lower to upper case
121 !
122 ! Revision 1.1 2003/06/02 17:12:01 jblazek
123 ! Added computation of thrust.
124 !
125 !******************************************************************************
126 
127 
128 
129 
130 
131 
132 
subroutine rflo_openthrustfile(global)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
RT a() const
Definition: Line_2.h:140