- Home
- Skills
- APIs & Backend
- COMSOL Battery Expert
Works with the AI Agents you already use
COMSOL Battery Expert
by RVLM
Autonomous battery modeling engineer for COMSOL 6.4: picks the right fidelity (ECM, SPM, SPMe, Newman/P2D), computes capacity and OCV checks, delivers Java Shell scripts.
$30
COMSOL Battery Expert
Example session with this skill installed
Build a discharge model for a graphite/LiFePO4 pouch cell at 1C and tell me the expected voltage curve shape.
- Read your context and instructions
- Compiled the comsol battery expert
Designed for you: a graphite / LiFePO4 pouch cell discharge model at 1C. Fidelity choice:
SPMe for the first validated model — at 1C the particle diffusion time (~42 min for Rp = 5 um, D = 1e-14 m2/s) dominates over the electrolyte transport (~5 min across a 100 um cell), so SPMe captures the physics you care about without the full P2D cost. If your question is fast-charge (3C+), say so and I will re-emit the full Newman/P2D version.
Key numbers computed before building anything:
- Theoretical capacity: graphite 372 mAh/g (C6 basis), LiFePO4 170 mAh/g — per your electrode loadings I will use the per-area value Q_A = c_max·eps_s·L·F·Δθ in the script.
- 1C current: the current that depletes the limiting electrode's stoichiometric window in 3600 s (computed from Q_A; stated in the script).
- OCV at the starting SOC: OCP_LFP(θ_pos) − OCP_gr(θ_neg). With typical balancing (θ_pos: 0.02→0.97, θ_neg: 0.85→0.05) this gives
≈ 3.42 V at full charge — the first number the simulation must reproduce within mV.
Assumptions (replace flagged values with your data):
- T = 298 K isothermal (thermal coupling omitted at 1C; at 3C+ it is not optional)
- Electrolyte: 1 M LiPF6 in EC:DMC, t+ = 0.38, D_salt ≈ 3e-10 m2/s (literature-typical, ASSUMED)
- Solid diffusion coefficients ASSUMED: D_gr = 3e-14, D_LFP = 1e-18..1e-17 m2/s (LFP is anisotropic; the 1D-particle idealization flattens that)
- OCP curves from literature data tables, monotonic interpolation — I state the source in the script
Java Shell script (open a NEW blank model, paste in the Java Shell — Developer tab):
/*
* Graphite/LiFePO4 pouch cell - 1C discharge
* Fidelity: SPMe. Expected: OCV(start) ~ 3.42 V, knee near theta_pos ~ 0.97,
* discharge time ~ 3600 s at 1C, sag ~ I*R_int (computed from parameters).
*/
// --- Global parameters ---
model.param().set("L_neg", "60[um]", "anode thickness (ASSUMED)");
model.param().set("L_sep", "25[um]", "separator thickness");
model.param().set("L_pos", "80[um]", "cathode thickness (ASSUMED)");
model.param().set("eps_s_neg", "0.65", "anode active fraction");
model.param().set("eps_s_pos", "0.55", "cathode active fraction");
model.param().set("Rp_neg", "10[um]", "graphite particle radius");
model.param().set("Rp_pos", "1[um]", "LFP particle radius");
model.param().set("cmax_neg", "30555[mol/m^3]", "graphite c_max");
model.param().set("cmax_pos", "22800[mol/m^3]", "LFP c_max");
model.param().set("T0", "298[K]", "temperature");
model.param().set("Crate", "1", "C-rate");
// --- Component and geometry (1D sandwich) ---
model.component().create("comp1", true);
model.component("comp1").geom().create("geom1", 1);
// TODO geometry: three intervals neg | separator | pos, then run
model.geom("geom1").run();
// --- Physics ---
// VERIFY: battery interface type string, porous electrode / separator features
// and OCP function nodes against the Battery Design Module User's Guide
// and Programming Reference Manual for your version
// TODO: OCP interpolation functions for both electrodes (stated source),
// stoichiometry-to-SOC balancing in the header arithmetic
// TODO: current density consistent with Crate * Q_A (state the basis)
// --- Mesh ---
model.component("comp1").mesh().create("mesh1");
// TODO: resolve electrode/separator interfaces; particles with >= 10 radial elements
model.component("comp1").mesh("mesh1").run();
// --- Study: time-dependent 1C discharge ---
model.study().create("std1");
// VERIFY: time-dependent study feature tag for your version
// TODO: total time > 3700 s, output times dense near the knee
// model.study("std1").run();
// --- Results: quantitative discharge curve, not only plots ---
model.result().create("pg1", "PlotGroup1D");
// TODO: cell voltage vs time export; surface concentration at both electrodes
// vs their stoichiometry limits
model.save("lfp_graphite_1c_discharge.mph");
Validation chain when you run it:
- Voltage at t=0+ vs OCV target (≈ 3.42 V) — off by 0.1 V+ means a balancing or OCP-data error, never "solver noise".
- Discharge time to cutoff vs 3600 s (1C) — a big miss means stoichiometry window or capacity basis arithmetic.
- Voltage sag at t=0 vs I·R_int estimate from conductivities and kinetics.
- Knee shape: LFP's flat plateau then steep knee must appear; a smoothed-out knee usually means OCP interpolation or particle mesh too coarse.
Next steps: paste back the voltage-vs-time values or the solver log and I will fix one thing at a time (balancing → initial consistency → knee time stepping → mesh). If you want rate capability (0.5C/1C/2C/3C), thermal coupling, or the full P2D version, tell me which and you get the complete script.
Connects securely to your tools. The creator never sees your data.
About this skill
Simulating battery performance in COMSOL Multiphysics requires deep domain expertise in electrochemistry and Java API scripting. Manual setup often leads to convergence failures, physical inconsistencies like negative electrolyte concentrations, or misaligned stoichiometry windows that shift voltage curves. This skill acts as a specialized simulation engineer to automate the design and scripting of high-fidelity battery models.
What it does
- Automates fidelity selection choosing between Equivalent Circuit, SPM, SPMe, or P2D models based on your specific research goals.
- Validates electrochemical physics by calculating theoretical capacity, stoichiometric windows, and diffusion times before generating code.
- Generates Java Shell scripts providing complete, self-contained code ready to paste into the COMSOL Desktop Java Shell.
- Configures physics couplings including thermal effects (ohmic, kinetics, and entropic heat) and degradation mechanisms.
- Standardizes model setup with properly defined parameters for porosities, particle radii, and OCP function definitions.
How it works
- Define the problem by describing your battery chemistry, desired fidelity, and the specific behavior you need to analyze.
- Review the engineering report to confirm the calculated validation numbers, stoichiometry mapping, and chosen assumptions.
- Execute the script by copying the generated Java code into your COMSOL Java Shell to build the model geometry, physics, and study nodes.
- Iterate and refine by requesting specific physics additions or parameter sweeps, receiving a full updated script for each change.
Frameworks & tools
Specifically designed for COMSOL Multiphysics 6.4 with the Battery Design Module. Scripts are delivered in Java for the COMSOL Java Shell environment.
Why this beats prompting it yourself
Generic AI often generates broken COMSOL API calls or ignores critical electrochemical constraints like electrode balancing. This skill enforces a strict validation chain, ensuring OCP curves and stoichiometry windows are physically consistent before the first mesh element is even created.
Use cases
- Rate capability studies to determine voltage sag and internal resistance under high C-rates.
- Thermal management design to calculate reversible and irreversible heat generation during discharge.
- Electrode optimization to test how changes in porosity or thickness impact energy density.
- BMS development by generating equivalent circuit models for long time-series system simulations.
Known limitations
Requires a valid COMSOL Battery Design Module license to run the generated scripts. Users must manually verify specific node names against official documentation for niche features.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
- Software
- Java
Scripts are paste-and-run in the COMSOL Desktop Java Shell. OCP curves and diffusion coefficients are labeled with their source or marked ASSUMED - replace them with your cell's measured data for quantitative accuracy.
Permissions
What's inside
Creator
RVLM
6 skills on Agensi
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.