Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new domain ConstantTVGasDomain #258

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

donerancl
Copy link

I made a new domain for constant temperature, constant volume gas. The pressure is calculated from the number of moles as simulation progresses.

I have used it in a simulation with a vapor liquid interface with no issues.

Copy link

codecov bot commented May 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 162 lines in your changes missing coverage. Please review.

Project coverage is 47.78%. Comparing base (1f37bfd) to head (a628c05).

Current head a628c05 differs from pull request most recent head 512174c

Please upload reports for the commit 512174c to get more accurate results.

Files Patch % Lines
src/Domain.jl 0.00% 162 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #258      +/-   ##
==========================================
- Coverage   48.71%   47.78%   -0.94%     
==========================================
  Files          31       31              
  Lines        8313     8475     +162     
==========================================
  Hits         4050     4050              
- Misses       4263     4425     +162     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

donerancl and others added 4 commits May 7, 2024 13:57
@donerancl donerancl requested a review from hwpang May 13, 2024 16:41
@donerancl
Copy link
Author

I found a small bug in the rops function that we could include in this PR. In Simulation.jl line 254 raises an error if the array in the second term is empty (when using interfaces without reactions, e.g., VaporLiquidMassTransferInternalInterfaceConstantT)
Nrxns = sum([length(sim.domain.phase.reactions) for sim in ssys.sims]) + sum([length(inter.reactions) for inter in ssys.interfaces if hasproperty(inter, :reactions)])

@hwpang
Copy link
Contributor

hwpang commented May 14, 2024

Thanks for the PR! I see that the test is failing with

Test vapor-liquid phase multi-domain reactor simulation with VaporLiquidMassTransferInternalInterfaceConstantT and VolumeMaintainingOutlet interface: Test Failed at /home/runner/work/ReactionMechanismSimulator.jl/ReactionMechanismSimulator.jl/src/TestReactors.jl:143
  Expression: ≈((sol(sol.t[end]))[ind], 0.11758959354431776, rtol = 1.0e-5)
   Evaluated: 1.8655128553425897 ≈ 0.11758959354431776 (rtol=1.0e-5)

Could you take a look into it?

@donerancl
Copy link
Author

@hwpang Just saw this and took a look. The temperature (298 K) for the test was below the range used to extrapolate kH and kLA, so my branch calculated the values of kH(T) and kLA(T) at the lowest temperature in the given range (350 K), making the results different. We could allow extrapolation if the kLA and kH values are not negative. It is probably alright in this case I would think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants