Calcium carbide production overhaul #63392
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Bugfixes "Calcium carbide production overhaul"
Purpose of change
The production of calcium carbide by arc furnace as implemented in #32454 is very much a rough first prototype. C++ was adapted from charcoal kiln, unfinished CaC2 was basically a clone of unfinished charcoal, grinding requirements missing, etc. Lacks scientific rigor.
Process yields 50±10% by volume compared to inputs, that's pretty much copied from charcoal firing and has no relation to the stochiometry of calcium carbide production CaO + 3 C -> CaC2 + CO.
Describe the solution
Calcium carbide's stats, like many chems, is standardized to 1 unit = 0.01 mole of the chemical. That's great, we'll start from that.
We have "calcium carbide premix", which is coke and lime that have been ground to fine powder and combined in the right proportion to be smelted into CaC2. For the sake of sanity in calculations and implementation, we'll set it equivalent to the end product, i.e. absent any loss/wastage, one unit of premix becomes one unit of CaC2. Do a bunch of math to determine what the weight / volume stats should be.
Adjusted the recipe for grinding coke and lime into calcium carbide premix to get inputs and outputs to match the required proportions as closely as possible. Make it require mortar and pestle for grinding and not just hammering.
Created a recipe that uses "electric arc furnace"
f_arc_furnace
; energy requirement for the reaction is 460 kJ per mole (plus overheads and wastage, 70% efficiency is generous, source reports 40~75%). The smelting creates molten CaC2 which is allowed to cool and solidify; this then has to be crushed and ground down to the powdered form that ischem_carbide
.Obsoleted "unfinished calcium carbide" which is what you would have found if you smashed apart an arc furnace after firing it up but before it is done. This was created when shoehorning the charcoal firing process for carbide production and no longer needs to be a thing. Delete cac2powder and unfinished_cac2 ammo types, and cac2powder material, which were "shoehorns".
For now this PR disables the
iexamine
function forf_arcfurnace_empty
so the old process can no longer be started, but any savegames with the process underway can still get the produced carbide from thef_arcfurnace_full
(after required time has elapsed), which turns the furniture back into af_arcfurnace_empty
. Will leave it like this for a transition period, after which the "arc furnace" (f_arcfurnace_empty
,f_arcfurnace_full
) and itsiexamine
functions will no longer be used at all and are removed as dead code.Have not decided what to do with the furniture after its obsolescence. It is kind of redundant with
f_arc_furnace
, so one thought is to migrate/obsolete it. However,f_arc_furnace
cannot be constructed, whereas thef_arcfurnace_empty
can, with some special requirements like fire bricks. It is not clear to me if it is okay to merge these into one furniture def, or whether they should continue to exist separately, filling different gameplay roles.For now, I've given
f_arcfurnace_empty
the samefake_arc_furnace
asf_arc_furnace
, so players who went to the trouble of constructing the former -- which existed specifically for making CaC2 -- aren't left without a means of doing so.Describe alternatives you've considered
1
Industrial processes also involve "electrode paste composed of coal tar pitch binder and anthracite coal" [source] but we're going with a more artisanal approach per sources cited in #32441.
2
The carbide smelting process liberates carbon monoxide, IRL this may be piped directly to other industrial process (e.g. lime kiln) that are colocated with the carbide arc furnace to take advantage of this. We could certainly come up with uses for carbon monoxide in-game -- there are at least a couple of recipes for extraction of metal from ores that could have a variation that uses CO.
One way to do it is to have a carbon monoxide item that is produced as by-product, but that requires the player to have some additional means to capture and bottle it. If the by-product can be made on an opt-in basis (or otherwise discarded), that would be more palatable than forcing players to have extra equipment to collect CO that they don't want just in order to make carbide.
Another idea is to add machinery in C++ to support having some kind of co-recipe that defines a co-process that can be crafted at the same time to take advantage of synergies. E.g. while making carbide, we can take the liberated carbon monoxide to reduce
chem_zinc_oxide
tochem_zinc_powder
, perhaps even leverage some waste heat to lower the amount of fuel required.Testing
Test the recipes for mix/grind coal+lime into premix and smelt/grind premix into carbide.
Additional context
Assumes that
coal_lump
has mass 37.5g per unit and not 1.5g -- this is bugfixed by 79cd0dc in #63375, no need to duplicate it here.