Skip to main content
ClaudeWave
Skill173 repo starsupdated 3mo ago

co2-carbon-footprint

Calculate CO2 emissions and carbon footprint from BIM model data. Analyze embodied carbon by material, element, and building system.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction /tmp/co2-carbon-footprint && cp -r /tmp/co2-carbon-footprint/1_DDC_Toolkit/BIM-Analysis/co2-carbon-footprint ~/.claude/skills/co2-carbon-footprint
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# CO2 Carbon Footprint Calculator

## Business Case

### Problem Statement
Sustainability requirements demand carbon tracking:
- Need to quantify embodied carbon
- Material selection impact unclear
- Reporting requirements increasing
- No integration with BIM workflow

### Solution
Calculate CO2 emissions from BIM quantities using EPD (Environmental Product Declaration) data and carbon coefficients.

### Business Value
- **Sustainability** - Meet green building requirements
- **Design optimization** - Identify high-carbon elements
- **Reporting** - Automated carbon reports
- **Decision support** - Compare material alternatives

## Technical Implementation

```python
import pandas as pd
from datetime import datetime
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass, field
from enum import Enum


class LifeCycleStage(Enum):
    """EN 15978 Life Cycle Stages."""
    A1_A3 = "a1_a3"  # Product stage
    A4 = "a4"        # Transport to site
    A5 = "a5"        # Construction
    B1_B7 = "b1_b7"  # Use stage
    C1_C4 = "c1_c4"  # End of life
    D = "d"          # Beyond system boundary


class MaterialCategory(Enum):
    """Material categories for carbon calculation."""
    CONCRETE = "concrete"
    STEEL = "steel"
    TIMBER = "timber"
    ALUMINUM = "aluminum"
    GLASS = "glass"
    BRICK = "brick"
    INSULATION = "insulation"
    GYPSUM = "gypsum"
    OTHER = "other"


@dataclass
class CarbonCoefficient:
    """Carbon emission coefficient for a material."""
    material: str
    category: MaterialCategory
    kgco2_per_unit: float  # kg CO2e per unit
    unit: str  # kg, m3, m2, etc.
    stage: LifeCycleStage
    source: str  # EPD reference
    uncertainty: float = 0.1  # 10% default uncertainty


@dataclass
class CarbonResult:
    """Carbon calculation result for an element."""
    element_id: str
    element_name: str
    material: str
    category: MaterialCategory
    quantity: float
    unit: str
    kgco2_per_unit: float
    total_kgco2: float
    stage: LifeCycleStage
    level: str = ""
    notes: str = ""


@dataclass
class CarbonSummary:
    """Carbon footprint summary."""
    total_kgco2: float
    total_tonco2: float
    by_material: Dict[str, float]
    by_category: Dict[str, float]
    by_stage: Dict[str, float]
    by_level: Dict[str, float]
    element_count: int
    gfa: float  # Gross Floor Area
    kgco2_per_m2: float


class CarbonCoefficientDatabase:
    """Database of carbon emission coefficients."""

    def __init__(self):
        self.coefficients: List[CarbonCoefficient] = []
        self._load_default_coefficients()

    def _load_default_coefficients(self):
        """Load standard carbon coefficients (EPD-based)."""
        # Concrete products
        self.add_coefficient(CarbonCoefficient(
            material="Concrete C30/37", category=MaterialCategory.CONCRETE,
            kgco2_per_unit=250, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Concrete"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Concrete C40/50", category=MaterialCategory.CONCRETE,
            kgco2_per_unit=300, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - High Strength Concrete"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Reinforcement Steel", category=MaterialCategory.STEEL,
            kgco2_per_unit=1.99, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Rebar"
        ))

        # Steel products
        self.add_coefficient(CarbonCoefficient(
            material="Structural Steel", category=MaterialCategory.STEEL,
            kgco2_per_unit=2.5, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Structural Steel"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Steel Sheet", category=MaterialCategory.STEEL,
            kgco2_per_unit=2.3, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Sheet Metal"
        ))

        # Timber products
        self.add_coefficient(CarbonCoefficient(
            material="Softwood Timber", category=MaterialCategory.TIMBER,
            kgco2_per_unit=-500, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - CLT (carbon sequestration)"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Glulam", category=MaterialCategory.TIMBER,
            kgco2_per_unit=-350, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Glued Laminated Timber"
        ))

        # Aluminum
        self.add_coefficient(CarbonCoefficient(
            material="Aluminum Profile", category=MaterialCategory.ALUMINUM,
            kgco2_per_unit=8.0, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Aluminum"
        ))

        # Glass
        self.add_coefficient(CarbonCoefficient(
            material="Float Glass", category=MaterialCategory.GLASS,
            kgco2_per_unit=15.0, unit="m2", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Float Glass"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Double Glazing Unit", category=MaterialCategory.GLASS,
            kgco2_per_unit=35.0, unit="m2", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - IGU"
        ))

        # Masonry
        self.add_coefficient(CarbonCoefficient(
            material="Clay Brick", category=MaterialCategory.BRICK,
            kgco2_per_unit=0.24, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Clay Brick"
        ))

        # Insulation
        self.add_coefficient(CarbonCoefficient(
            material="Mineral Wool", category=MaterialCategory.INSULATION,
            kgco2_per_unit=1.2, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Mineral Wool"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="EPS Insula