Пример #1
0
def test_poisson():
    u = Variable('u', dim=3, space='L2')
    K = Constant('K', rank=0)

    strong_form = StrongForm(div(K * grad(u)))

    ### Just test for object creation for now.
    coefficient = sfl_coefficient(strong_form)
Пример #2
0
from ignition.dsl.sfl.language import *
from ignition.utils.proteus.coefficient import sfl_coefficient

u = Variable('u')
v, nu = Constants('v nu')

f = u**2
eqn = Dt(u) + div(v*f - nu*grad(u))
strong_form = StrongForm(eqn)

burger_coefficients = sfl_coefficient(strong_form)
Пример #3
0
from ignition.dsl.sfl.language import *
from ignition.utils.proteus.coefficient import sfl_coefficient

h, q = Variables('h q')
g, nu = Constants('g nu')
dbdx = Coefficients('dbdx')
u = q/h

expr1 = Dt(h) + div(q)
expr2 = Dt(q) + div(u*q + 0.5*g*h**2 - nu*grad(u)) + g*h*dbdx

strong_form = StrongForm([expr1, expr2], components=[h, q])

swe_coefficients = sfl_coefficient(strong_form)
Пример #4
0
from ignition.dsl.sfl.language import *
from ignition.utils.proteus.coefficient import sfl_coefficient

h, q = Variables('h q')
g, nu = Constants('g nu')
dbdx = Coefficients('dbdx')
u = q / h

expr1 = Dt(h) + div(q)
expr2 = Dt(q) + div(u * q + 0.5 * g * h**2 - nu * grad(u)) + g * h * dbdx

strong_form = StrongForm([expr1, expr2], components=[h, q])

swe_coefficients = sfl_coefficient(strong_form)
Пример #5
0
            return self.uLeft
        else:
            return self.uRight


def getDBC(x):
    if x[0] == 0.0:
        return lambda x,t: uL


# Define Equations
u = Variable('u')
v, nu = Constants('v nu')

f = u**2
eqn = Dt(u) + div(v*f - nu*grad(u))
strong_form = StrongForm(eqn)

burger_coefficients = sfl_coefficient(strong_form,
                                      base_class=ViscousBurgersEqn,
                                      gen_evaluate=False,
                                      v=v_val, nu=nu_val, nd=nd)

#analyticalSolution = {0:RiemIC(getDBC)}
initialConditions = {0: RiemIC(getDBC)}
dirichletConditions = {0: getDBC}
fluxBoundaryConditions = {0: 'outFlow'}
advectiveFluxBoundaryConditions =  {}
diffusiveFluxBoundaryConditions = {0:{}}

Пример #6
0
        else:
            return self.uRight


def getDBC(x):
    if x[0] == 0.0:
        return lambda x, t: uL


# Define Equations
u = Variable('u')
v, nu = Constants('v nu')

f = u**2
eqn = Dt(u) + div(v * f - nu * grad(u))
strong_form = StrongForm(eqn)

burger_coefficients = sfl_coefficient(strong_form,
                                      base_class=ViscousBurgersEqn,
                                      gen_evaluate=False,
                                      v=v_val,
                                      nu=nu_val,
                                      nd=nd)

#analyticalSolution = {0:RiemIC(getDBC)}
initialConditions = {0: RiemIC(getDBC)}
dirichletConditions = {0: getDBC}
fluxBoundaryConditions = {0: 'outFlow'}
advectiveFluxBoundaryConditions = {}
diffusiveFluxBoundaryConditions = {0: {}}