Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowfish543 authored Sep 17, 2023
1 parent eee1ba0 commit 382790b
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# StdToolheadOpenfoam

Standardised CFD workflow for 3d printer toolhead analysis based on Openfoam.com
<br><br>This repository aims to provide a standardised methodolodgy for CFD analysis.
<br>The workflow follows the process outlined below:
Expand All @@ -25,15 +26,46 @@ This workflow assuems a common folder structure:
<br><br>**Note** that the pre-run cleanup script will update the mesh geometry based on the contence of `./<CaseName>/01_Geometry`

## OpenFOAM versions

The scripts are developed for running on v2306 of [OpenFOAM.com](https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled)
The [Windows 10 installation guide](https://www.openfoam.com/download/openfoam-installation-on-windows-10) on the OpenFOAM website will install v2012. In order to install v2306 please use the following guide:
[https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled/windows](https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled/windows)
If you choose v2012 use the [./0.org/p_v2012](./02_Run/0.org/p_v2012) pressure boundary condition. **Note:** The file will need to be renamed to `p`

## CFD basics

Keeping this very brief as there are numerous far better guides that I could give, however this is aimed at providing the key points to enable a user to generate a CFD model, not understand it fully.<br>
A simulation is based on a domain, this is the volume you are modelling the fluid flow in (in our case, the fluid is air).<br>
The domain will have 3 classes of boundaries:
1) Walls - no fluid passes through these
2) Inlets - Regions where fluid comes into the domain
3) Outlet - Regions where fluid exits the domain

In this workflow, the inlets are fan outlets. They are modelled as a uniform velocity based on a fan flow function curve (pressure drop relative to volumetric flow rate)<br>
The outlet is the atmosphere. We don't specify any velocity here, just that flow can exit through these planes, the simulation will do the work to predict how and where.<br>
The simulation is run incompressible. This is due to the mach numbers generally being low (<0.3). If you are trying to predict something like berd air or a very high pressure inlet, it's possible that this may not be valid.<br>

The model is run transiently. This can be important and is not possible in simscale with a free licence. Essentially the simulation will run from the starting of the cooling fans through to a fully developed flow. By running transiently it is possible to detect aerodynamic instablities. When a simulation is run steady-state these can lead to poor convergence and non-physical results. This does increase the run time, however optimistion of the goemetry and meshing still allow for a relatively fast solution, converging within a couple of hours, although exact times vary significantly depending on CPU, and to a less extent, RAM performance.

## Step 1: Geometry Preparation
To be added....

Geometry preparation is critical to high quality meshes and convergence. The geometry will also directly impact the mesh size and hence solution time.<br>
The following is given as an example of the preparation and which can then be used on your own geometry. [https://a360.co/3PRtX5L](https://a360.co/3PRtX5L)<br>
The initial steps are as follows:
1) Define the fluid domain - Basically work out how much you want to model. Take a note of the min/max x,y,z coords for this domain.
2) Position the geometry with the origin (0,0,0) at the nozzle tip
3) Add part geometry to simulate more realistic restictions about the nozzle.
4) Simplify the duct and nozzle gometry. Removing small faces and insiginicant features will significantly reduce the mesh size and in turn, the simulation run-time.
5) Substract the gometry from the fluid domain
6) Un-stitch the domain and re-stitch faces based on the regions defined in step 2.
7) Convert grouped faces to mesh
8) Combine mesh's as required (ie. left and right duct outer walls into 'walls')
9) Generate solid bodies for the refinement zones about the part and nozzle.
10) Export all mesh and solid bodies as stl's (in _**mm**_)
11) Save all stl's in <code>./01_Geometry/</code>

## Step 2: Fluid Domain Generation

The fluid domain is generated using stl's containing the surfaces which make up a given <code>patch</code>
<br>A patch is used to define boundary conditions, such as a domain inlet, outlet or a wall.
<br>Walls are sub-divided to enable mesh refinement in given regions, hence multiple stl's are required for the walls
Expand All @@ -42,34 +74,45 @@ The fluid domain is generated using stl's containing the surfaces which make up
The following stl's are required for the meshing to work without modification:

### Inlet

- inletLeft
- inletRight

### Outlet

- outletAtmosphere

### Walls

- walls
- wallsDuctLeft
- wallsDuctRight
- wallsNozzle
- wallsBuildplate
- wallsPart

### Refinement Regions

- refinementNozzle
- refinementPart
<br><br>Further details to be added...

## Step 3: Boundary Condition Calculation

Template file includes suitable bounadry conditions to simulate a 4010 GDSTime blower into ambient air
<br>The Case is run isothermal incompressible with k-Omega SST turbulence model.
<br><br>Supporting workbook to be added...

### Runtime considerations

This CFD is configured to run transiently. This ensures the CFD analysis is robust when solving unsteady flowfields (frequently caused by modelling opposing jets of air from the ducts) case is run transiently. It also allows the use of a fan pressure curve to determine the expected jet velocities for a given duct design.
<br><br>A transient analysis runs using time steps. The flowfield is re-calculated for each time step, in this case it's simulating the fan startup through to steady state operation.
<br><br>The analysis needs to be run sufficiently long that the flow has developed over the nozzle and stabilised. Testing has shown this is ~0.016s. The anlaysis is configured to run for 0.02s to give some headroom.
<br><br>The duration of a time step is set by the time taken for flow to pass through a cell within the simulation. Therefore a very fine mesh or a very high speed flow will lead to small time step being required and a longer run time. If the velocity is increased (ie more powerful fan is modelled) then the time required to reach a steady state condition is expected to reduce, however this should be monitored during the run using ParaFOAM to ensure the solution has reached a steady state condition.
<br><br>Before running very high velocity flows the user should consider whether it's required. If the flowfield is unchanged (likely to be the case for the low Mach numbers typically running), hand calculations are likely to be sufficient to estimate the velocity.

## Step 4: Mesh Configuration

Meshing is completed in a number of steps.
1) blockMesh is generated for the fluid domain. This is the background mesh and will be refined.
2) The mesh is decomposed based on the number of processors solving the analysis
Expand All @@ -87,20 +130,26 @@ Meshing is completed in a number of steps.
<br>Issues with the blockMesh domain will result in a `world` patch being created and errors associates with boundary conditions not being provided during the decomposition of the mesh.

### Mesh refinement

Mesh refinement is used to decrease the element size generated by the blockMesh. The case has been configured to use 2 approaches for this, surface refinement and volumetric refinement.
<br><br>The refinement is applied in regions of higher velocity, stong interaction between jets or regions of interest where details in the geometry may impact the results.
<br><br>Refinement is defined based on the level of reduction in the region relative to the blockMesh size, with each level halving the element size. More details can be found in the [OpenFOAM guide](https://www.openfoam.com/documentation/guides/latest/doc/guide-meshing-snappyhexmesh).

#### Surface refinement

The focus of the wall refinement is in the ducts and nozzle, with the nozzle being more refined than the ducts
<br><br>The part and build plate have a level of refinement to ensure the geometry is well resolved, however the velocities slow significantly by this region and therefore significant refinement is not required.

#### Volumetric refinement

Volumetric refinement is used to capture the region of interaction between the opposing jets, as well as an additional highly resolved region between the part and the nozzle. Gaps require ~8 elements to properly resolve flow, however the low level of flow coupled with the resultant very small elements will significantly increase both run time and mesh size (ram requirements) and is not expected to significantly alter understanding.
<br><br>The simpliest way to add volumetric refinement is through generation of a volume in CAD and export as an STL, as has been done for the part and nozzle refinement regions. The local region around the tip of the nozzle has been added as a cylinder within [snappyHexMeshDict](./Run_02/system/snappyHexMeshDict), and is reliant on the mesh being datumed such that the tip of the nozzle is at (0, 0, 0).

## Step 5: Case Configuration
To be added...

## Step 6: Case Execution

Before running the case ensure the number of processors in the run scripts are set according to [decomposParDict](./02_Run/system/decomposeParDict)
<br><br>The following files need to be checked and updated as required:
- [miniMesh](./miniMesh)
Expand Down

0 comments on commit 382790b

Please sign in to comment.