Skip to content

Commit

Permalink
update fluid transfer spec
Browse files Browse the repository at this point in the history
  • Loading branch information
SOF3 committed Feb 1, 2024
1 parent 90545ef commit 110da16
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ What to expect from the game:
Explore the dynamically generated map to unlock new resources.
- **Cooperative**: Cooperative multiplayer is (will be) supported.
Work together to develop the metropolis and thrive even better.
- **Diplomatic**: PvP is (will be) supported.
- **Diplomacy**: PvP is (will be) supported.
Build trade relations with other players to become a business tycoon,
but beware sabotages from espionage, both physical and social.

Expand Down
46 changes: 34 additions & 12 deletions fluid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,51 @@ which may be modified through construction/renovation.

### Transfer rate

Fluid transfer across a pipe is computed from four variables:
resistance, pressure, force and diffusion.
To generalize, the transfer rate of a fluid type across a link is computed by
Fluid transfer across a pipe is computed from net force, resistance and diffusion.

```text
pressure_gradient / resistance + force + concentration_gradient
```
#### Forces

The net force is computed as the sum of different forces acting on the link.

##### Pressure difference

The difference in pressure level between two containers induces
a net flow from the higher-pressure to the lower-pressure container.

##### Pumps

Pumps may be installed on transfer links during construction and renovation.

##### Fields

[Vector fields](../field/README.md) may catalyze transfer in a direction
depending on the field properties.

#### Resistance

Resistance is the cost of moving a fluid from one link of a storage to another.
There are multiple factors that multiply into the resistance value.

##### Shape

For corridor links, the resistance is a simplified version
For corridor links, the base resistance is a simplified version
of the flow rate multiplier given by the Hagen–Poiseuille equation,
i.e. `resistance = length / radius^4`, where `length` and `radius` describe the duct.

For inter-building links, we assume the length is the radius of the building itself,
and assume the whole building space is available for transfer,
so the resistance is simply `1 / radius^3`.
so the base resistance is simply `1 / radius^3`.

##### Material

The fluid type defines a `viscosity` value,
which is a multiplier applied on the resistance directly.

##### Fields

#### Force
[Scalar fields](../field/README.md) may affect flow rate depending on the field properties.

The force is the sum of active transport effects exerted by other modules, for example:
#### Diffusion

- A pump installed on the link.
- A [field](../fluid/README.md) that affects flow rate.
Diffusion is the result of concentration gradient of a fluid type between containers.
The net sum of diffusion-induced transfer is zero.

0 comments on commit 110da16

Please sign in to comment.