# PFIRE

Jump to: navigation, search

This section explains how to create a model and calculate it in a PFIRE application. The only one commercial software that needs is GID. This is an interactive graphical user interface used for the definition, preparation and visualization of all the data related to a numerical simulation. It's a versatile software that in the preprocessing can build a mesh for finite element and in the postprocessing views results in a very simple graphic interface.

## How to create a model (Pre-processing)

The starting point to create a model in GID is to build the geometry as a net of points, lines and surfaces. The program works, when defining the geometry, similar to a CAD application: the platform in which we create the model is a vector system, for this we have to assign the elements with its cartesian coordinates. The application explained here is on the fusion of a 2-D polymer sample warmed up by an heat flux on an only one free surface. The sample is a rectangular of 5cm x 10cm so at the beginning we work with line elements.

### Drawing the model

- Click

``` geometry > create > straight line
```

- In the command string enter all vertix's coordinates

``` "0 0" enter
```
``` "0.05 0" enter
```
``` "0.05 0.1" enter
```
``` "0 0.1" enter
```
``` "0 0" enter
```
``` click "join"
```
``` zoom the figure
```

It's important entering the last point "0 0" as the first because in this way the figure is closed.

- We need to create a surface on the rectangle, so click

``` geometry > create > nurbs surface > by contour
```

select all four line of the rectangle and press "esc".

### Load a problem type

- Click

```Data > Problem type > Load..
```

searching the file.gid that represents the problem. In this case "PFIRE.gid".

- Click

```Data > Conditions > Elements type
```

and click on the type of elements supported by the problem type. In this case "UpdatedLagrangianFluid2D".

- Click

```Data > Conditions > Fluid boundary conditions
```

This section it's very important because the user applies to the model all the boundary conditions in input that the program runs. We put on the following conditions:

IS_BOUNDARY 1.0 for each border line, IS_STRUCTURE 1.0 only for fix perimeter. All lines without IS_STRUCTURE 1.0 are considered free surfaces of the polymer sample and on these the heat flux is applicated. In this case we consider free surface only the vertical line on the right.

DISPLACEMENT X and DISPLACEMENT Y zero on all the boundary.

DENSITY=1000 on all lines and on the sample surface.

VISCOSITY=0.00001 on all lines and on the sample surface.

All the other conditions are applicated by the program kratos automatically. All these conditions are listed on the table Data > Problem Data and it's possible to change some values.

### Generate the mesh

Gid generates meshes automatically by the contour. Choose the mesh > generate mesh option and put in the value 0.002 as mesh size. After this choose Calculate > Calculate option.

Now the model is ready to calculate it.

## How to calculate the model

After the creation of the model and putting in of all conditions we have to start the computation. Now it's described how to implement the application in Linux. We have to:

- open a terminal window.

- open the directory .Gid that holds the model.

- write python filename.py.

- wait until the computational process stops.

Gid Post-process reads the following files generated by the calculating module:

- project_name.flavia.res: result file. Each element of the mesh corresponds to a value.

- project_name.flavia.msh: file containing the post-process 2D mesh.

## How to visualize results (Post-processing)

To open and visualize the results we use Gid another time but in post-processing mode.

- open file.gid of the model made up before.

- click File > Postprocess

- click File > open multiple and select all result files.

Now it's possible to visualize the trend of all variable during the heating time. For example:

- click View results > contour fill and choose one variable as temperature.

- click Windows > Animate, click play and enjoy it.