소스 정보
- 저장소
- Soljourner/claude-engineering-skills
- 최근 소스 활동
- 2025년 11월 7일 22:15
- 감지된 SKILL.md 언어
- 영어
- 스타
- 62
- 포크
- 17
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/Soljourner/claude-engineering-skills --skill comsol-multiphysics명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | comsol-multiphysics |
| description | Set up coupled fluid-structure interaction for pump vibration analysis |
| category | integrations |
| domain | multiphysics |
| complexity | advanced |
| dependencies | [] |
Comprehensive guide for setting up and automating coupled fluid-structure interaction (FSI) simulations using COMSOL Multiphysics, with a focus on pump vibration analysis and related multiphysics applications.
COMSOL Multiphysics is a leading commercial simulation platform for modeling and solving complex multiphysics problems. It provides:
COMSOL excels at coupled physics problems including:
COMSOL Multiphysics requires commercial licenses for all production use:
Base Package:
Module Licenses:
License Server Setup:
# Set license server environment variable (Linux/Mac)
export LMCOMSOL_LICENSE_FILE=1718@license-server.company.com
# Or in Windows
set LMCOMSOL_LICENSE_FILE=1718@license-server.company.com
License Types:
Comprehensive computational fluid dynamics for single-phase and multiphase flows:
Capabilities:
Turbulence Models:
Flow Types:
Multiphase Flow:
Pump-Specific Features:
Comprehensive structural analysis including linear and nonlinear behavior:
Capabilities:
Analysis Types:
Material Models:
Dynamic Analysis:
Pump-Specific Features:
Couples CFD and Structural Mechanics for two-way interaction:
Coupling Approaches:
One-Way FSI:
Two-Way FSI:
Weak Coupling:
Strong Coupling:
FSI Features:
Pump FSI Applications:
Acoustics Module:
Heat Transfer Module:
Optimization Module:
COMSOL provides a comprehensive Java API for programmatic model building and automation:
Core Components:
import com.comsol.model.*;
import com.comsol.model.util.*;
public class PumpFSI {
public static Model run() {
// Create model
Model model = ModelUtil.create("PumpFSI");
// Create component
model.component().create("comp1", true);
// Create geometry
model.component("comp1").geom().create("geom1", 3);
// Import CAD geometry
model.component("comp1").geom("geom1").create("imp1", "Import");
model.component("comp1").geom("geom1").feature("imp1")
.set("filename", "/path/to/pump_geometry.step");
model.component("comp1").geom("geom1").run();
// Add fluid physics (CFD)
model.component("comp1").physics().create("spf", "LaminarFlow", "geom1");
model.component("comp1").physics("spf").selection()
.named("geom1_fluid_domain");
// Add structural physics
model.component("comp1").physics().create("solid", "SolidMechanics", "geom1");
model.component().physics().selection()
.named();
model.component().multiphysics().create(, , );
model.component().multiphysics()
.selection().named();
model.component().mesh().create();
model.component().mesh().automatic();
model.component().mesh().run();
model.study().create();
model.study().create(, );
model.study().feature().set(, );
model.sol().create();
model.sol().study();
model.sol().feature().create(, );
model.sol().feature().create(, );
model.sol().feature().create(, );
model.sol().attach();
model.sol().runAll();
model.save();
model;
}
{
run();
}
}
# Compile Java file
comsol compile PumpFSI.java
# Run with COMSOL
comsol batch -inputfile PumpFSI.class -outputfile results.mph
# Or run directly
java -cp /path/to/comsol/plugins/*:. PumpFSI
COMSOL integrates seamlessly with MATLAB for enhanced scripting and data processing:
Model Control from MATLAB:
Installation:
% Initialize COMSOL with MATLAB
import com.comsol.model.*
import com.comsol.model.util.*
% Start COMSOL server (if not already running)
mphstart
% Create or load model
model = mphload('pump_model.mph');
% Modify parameters
model.param.set('inlet_velocity', '5[m/s]');
model.param.set('outlet_pressure', '101325[Pa]');
% Run study
model.study('std1').run();
% Extract results
pressure = mpheval(model, 'p', 'dataset', 'dset1');
velocity = mpheval(model, 'u', 'dataset', 'dset1');
% Process in MATLAB
mean_pressure = mean(pressure.d1);
max_velocity = max(sqrt(velocity.d1.^2 + velocity.d2.^2 + velocity.d3.^2));
% Plot using MATLAB
figure;
plot(pressure.p, pressure.d1);
xlabel('Position');
ylabel('Pressure [Pa]');
title('Pressure Distribution');
% Save results
save('pump_results.mat', 'pressure', 'velocity');
% Close COMSOL
ModelUtil.remove('model');
% Parametric study of inlet velocity effects
velocities = 1:1:10; % m/s
results = struct();
for i = 1:length(velocities)
fprintf('Running case %d: velocity = %.1f m/s\n', i, velocities(i));
% Set parameter
model.param.set('inlet_velocity', sprintf('%f[m/s]', velocities(i)));
% Solve
model.study('std1').run();
% Extract force on impeller
force = mphint2(model, 'spf.Fp_x', 'surface', 'selection', 5);
results(i).velocity = velocities(i);
results(i).force = force;
% Extract vibration amplitude
displacement = mphmax(model, 'sqrt(u^2+v^2+w^2)', 'volume', 'selection', 3);
results(i).max_displacement = displacement;
end
% Plot results
figure;
subplot(2,1,1);
plot([results.velocity], [results.force], '-o');
xlabel('Inlet Velocity [m/s]');
ylabel('Force on Impeller [N]');
grid on;
subplot(2,1,2);
plot([results.velocity], [results.max_displacement]*1e6, '-o');
xlabel('Inlet Velocity [m/s]');
ylabel('Max Displacement [μm]');
grid on;
% Save results
save('parametric_results.mat', 'results');
Application: Analyze vibration of pump casing due to pressure pulsations from fluid flow.
Approach: One-way FSI (fluid loads mapped to structure)
Steps:
Geometry Setup:
CFD Setup:
Structural Setup:
FSI Coupling:
Solution:
Post-Processing:
Application: Coupled analysis of impeller blade deformation under fluid forces.
Approach: Two-way FSI with moving mesh
Steps:
Geometry and Mesh:
Fluid Physics:
Structural Physics:
Two-Way FSI Coupling:
Prestressed FSI:
Solution Strategy:
Post-Processing:
Application: Thermal effects in pumps handling hot fluids.
Approach: Conjugate heat transfer with thermal expansion
Steps:
Multi-Domain Setup:
Coupled Physics:
Boundary Conditions:
Material Properties:
Solution Sequence:
Post-Processing:
Application: Natural frequencies of pump casing in contact with fluid.
Approach: Eigenfrequency analysis with fluid-structure coupling
Steps:
Geometry:
Physics Setup:
Boundary Conditions:
Study:
Results:
COMSOL can run in batch mode without GUI:
# Run existing model file
comsol batch -inputfile pump_model.mph -outputfile results.mph
# Run Java method file
comsol batch -inputfile PumpFSI.java -outputfile results.mph
# Run with specific study
comsol batch -inputfile pump_model.mph -outputfile results.mph -study std1
# Run with parameter override
comsol batch -inputfile pump_model.mph -outputfile results.mph \
-pname inlet_velocity -plist 5,10,15,20
# Run MATLAB script
comsol batch -inputfile pump_analysis.m -outputfile results.mph
# Specify number of processors
comsol batch -np 8 -inputfile pump_model.mph -outputfile results.mph
#!/bin/bash
# batch_comsol.sh
# Set license server
export LMCOMSOL_LICENSE_FILE=1718@license-server.com
# Set number of processors
NPROCS=8
# Input/output files
INPUT_MODEL="pump_fsi_base.mph"
OUTPUT_DIR="results"
# Create output directory
mkdir -p ${OUTPUT_DIR}
# Parameter sweep: inlet velocities
VELOCITIES="2 4 6 8 10"
for VEL in ${VELOCITIES}; do
echo "Running simulation with inlet velocity = ${VEL} m/s"
OUTPUT_FILE="${OUTPUT_DIR}/pump_fsi_v${VEL}.mph"
LOG_FILE="${OUTPUT_DIR}/pump_fsi_v${VEL}.log"
# Run COMSOL in batch mode
comsol batch -np ${NPROCS} \
-inputfile ${INPUT_MODEL} \
-outputfile ${OUTPUT_FILE} \
-pname inlet_velocity \
-plist ${VEL} \
> ${LOG_FILE} 2>&1
# Check exit status
if [ $? -eq 0 ]; then
echo " Simulation completed successfully"
else
echo " ERROR: Simulation failed - check ${LOG_FILE}"
exit 1
fi
done
echo "All simulations completed"
Use JPype to call COMSOL Java API from Python:
import jpype
import jpype.imports
from jpype.types import *
import numpy as np
# Start JVM with COMSOL
comsol_root = '/usr/local/comsol56/multiphysics'
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(
jvm_path,
f"-Djava.library.path={comsol_root}/lib/glnxa64",
f"-Dcs.lic.path={comsol_root}/license",
classpath=f"{comsol_root}/plugins/*"
)
# Import COMSOL packages
from com.comsol.model.util import ModelUtil
# Load model
model = ModelUtil.load('/path/to/pump_model.mph')
# Parametric study
velocities = np.linspace(2, 10, 5)
results = []
for vel in velocities:
print(f"Running velocity = {vel:.1f} m/s")
# Set parameter
model.param().set('inlet_velocity', f'{vel}[m/s]')
# Run study
model.study('std1').run()
# Extract results (example)
# Add actual result extraction here
# Save case
model.save(f'results/pump_v{vel:.1f}.mph')
results.append({
'velocity': vel,
# Add extracted results here
})
# Cleanup
ModelUtil.remove('model')
jpype.shutdownJVM()
()
Licensing Problems:
Meshing Failures:
Convergence Issues:
FSI-Specific Issues:
Performance Issues: