It is often necessary to be able to set the initial geometry to something different than what is defined in the grid files. This is often the case when doing a grid refinement study on a previously optimized geometry or starting an optimization from a previous optimization. There are several ways to accomplish this, and the one to use depends on what you plan to do with the new geometry. All of these approaches, except the first, require the use of an explicit map, i.e. a B-spline fitting is used. The instructions below assume that a new geometry was obtained from an optimization, and it is this geometry that you want to analyze/start a new optimization from.
Most simply, you can do a flow solve on the newgrid.g produced by the optimization. Do this by
Creating a new run directory, copy the newgrid.g file from the optimization into this directory as grid.g. Also copy the grid.con and input.param.
Run the case. The method works with opt_method = 'flowsolve' and 'trim'.
This method cannot be used with any fitting, i.e. GRID%EXPLICIT_MAP must be .false. in the new run. If the GRID%READ_FINE_GRID was used in the original optimization, the newgrid.g from that run won't be fittable as it will have the finer spacings. If the GRID%READ_FINE_GRID was not used, this new run could be fit, but it is not advisable as the geometry will change since it is a different grid being fit compared to the original run. Since GRID%EXPLICIT_MAP shouldn't be used, this method cannot be used together with GRID%RESIZE for refinement studies.
Also, the newgrid.g file from the original optimization run must be consistent with grid.con. That is, is GRID%RESIZE with GRID%SCALE /= 1 was used in the original run that produced the newgrid.g file, the newgrid.g file will contain a different number of nodes than are specified in grid.con. So, either a new grid.con must be generated that corresponds to the size in newgrid.g, or one of the following two options should be used instead.
When doing an optimization (or whenever the grid is fit), a [new]grid.mapkv file is written. The grid.mapkv file is the mapping (including the B-spline mesh and the knot vectors) that is generated from fitting the initial grid. For optimizations a newgrid.mapkv file is also written at each function call which is the mapping of the grid at the most recent function call. These file can be used to set the geometry. The MESH namelist has the option GRID%READ_MAP which will read in the mapping defined in the file called grid.mapkv instead of doing a fitting. So, to do a solve on the geometry defined in a map file, do the following:
Create a directory with all the necessary files (grid.g, grid.con, gridturb.g, input.param, etc.). It is often easiest to simply copy the optimization directory if you are doing a solve on a previously optimized shape and then remove all output files (except newgrid.mapvk).
Get the desired map file and call it grid.mapkv. If an optimization directory was copied as mentioned in #1 above, rename newgrid.mapkv as grid.mapkv.
Set GRID%READ_MAP = .true.
If your are doing a turbulent solve, make sure to also have GRID%READ_FINE_GRID = .true. as needed.
Run the case as usual. This method works with opt_method = 'flowsolve' and 'trim'.
Since an explicit map (fitting) is used, options like GRID%RESIZE can be used.
If you are trying to analyze a geometry that was optimized using the "axial control" methodology, you can use the axialDVs_XXX.dat file that was written. If this file is available, it is generally the preferred approach as it can be used to both analyze a previously optimized geometry or to start an optimization from that previously optimized geometry. It is also simple to setup as it reuses all of the input files from the original optimization. It does not, however, work with a simple opt_method = 'flowsolve', but rather only for 'trim', or 'optimize'.
To use this approach:
Create a directory with all the necessary files (grid.g, grid.con, gridturb.g, input.param, patch.con, etc.). It is often easiest to simply copy the optimization directory if you are doing a solve on a previously optimized shape and then remove all output files (except the desired axial DV file).
Rename the axial DV file from the desired iteration, e.g. 'axialDVs_XXX.dat', that defines your geometry of interest as something, say 'setAxialDVs_XXX.adv'.
In the input.param set jtstrm%setADVs = .true., and jtstrm%setADVs_file = 'setAxialDVs_XXX.adv', where the latter is the name of the above named file for the geometry of interest.
Set the AoA to that from the function call that corresponds to the geometry specified in #2 above.
Run the case. This method works with opt_method = 'trim' and 'optimize'.
This can be used to either do an analysis at a constant lift using the 'trim' opt_method, to start a new optimization from the shape defined in the axial DV file, or to just do an analysis (e.g. flowsolve) by leveraging the optimization code and then stopping before any optimization actually happens. For the latter, set jtstrm%max_funevl = 2, which will cause the code to do one function evaluation (flowsolve and gradient evaluation) on the geometry specified by setADVs.