Giter Club home page Giter Club logo

Comments (3)

spasmann avatar spasmann commented on June 27, 2024

Interestingly, the test is passing when I double the number of cells in each dimension of the tally mesh from 20 to 40. Here is the original input deck

import numpy as np
import mcdc


# =============================================================================
# Set model
# =============================================================================
# A shielding problem based on Problem 2 of [Coper NSE 2001]
# https://ans.tandfonline.com/action/showCitFormats?doi=10.13182/NSE00-34

# Set materials
SigmaT = 5.0
c = 0.8
m_barrier = mcdc.material(capture=np.array([SigmaT]), scatter=np.array([[SigmaT * c]]))
SigmaT = 1.0
m_room = mcdc.material(capture=np.array([SigmaT]), scatter=np.array([[SigmaT * c]]))

# Set surfaces
sx1 = mcdc.surface("plane-x", x=0.0, bc="reflective")
sx2 = mcdc.surface("plane-x", x=2.0)
sx3 = mcdc.surface("plane-x", x=2.4)
sx4 = mcdc.surface("plane-x", x=4.0, bc="vacuum")
sy1 = mcdc.surface("plane-y", y=0.0, bc="reflective")
sy2 = mcdc.surface("plane-y", y=2.0)
sy3 = mcdc.surface("plane-y", y=4.0, bc="vacuum")

# Set cells
mcdc.cell([+sx1, -sx2, +sy1, -sy2], m_room)
mcdc.cell([+sx1, -sx4, +sy2, -sy3], m_room)
mcdc.cell([+sx3, -sx4, +sy1, -sy2], m_room)
mcdc.cell([+sx2, -sx3, +sy1, -sy2], m_barrier)

# =============================================================================
# iQMC Parameters
# =============================================================================
N = 2e2
Nx = Ny = 20
maxit = 2
tol = 1e-3
x = np.linspace(0, 4, num=Nx + 1)
y = np.linspace(0, 4, num=Ny + 1)
generator = "halton"

# fixed source in lower left corner
fixed_source = np.zeros((Nx, Ny))
fixed_source[0 : int(0.25 * Nx), 0 : int(0.25 * Nx)] = 1

phi0 = np.ones((Nx, Ny))

mcdc.iQMC(
    x=x,
    y=y,
    fixed_source=fixed_source,
    phi0=phi0,
    maxitt=maxit,
    tol=tol,
    generator=generator,
    score=["tilt-x", "tilt-y", "tilt-xy"],
)

# =============================================================================
# Set tally, setting, and run mcdc
# =============================================================================
# Setting
mcdc.setting(N_particle=N)
# Run
mcdc.run()

from mcdc.

jpmorgan98 avatar jpmorgan98 commented on June 27, 2024

Could we change the test to do that? I know that's an unsatisfying result but this would allow us to move on

from mcdc.

spasmann avatar spasmann commented on June 27, 2024

Sorry forgot to follow up on this, but that's what I did. The test is passing now.

from mcdc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.