Skip to content

A(vars)

Area of faces between nodes.

Parameters:

Name Type Description Default
vars list

List of arguments

required
Source code in openterrace/domains/cylinder_1d.py
def A(vars):
    """Area of faces between nodes.

    Args:
        vars (list): List of arguments
    """

    n = vars['n']
    D = vars['D']
    H = vars['H']
    return (np.repeat(np.pi*(D/2)**2, n), np.repeat(np.pi*(D/2)**2, n))

V(vars)

Volume of node element.

Parameters:

Name Type Description Default
vars list

List of arguments

required
Source code in openterrace/domains/cylinder_1d.py
def V(vars):
    """Volume of node element.

    Args:
        vars (list): List of arguments
    """

    n = vars['n']
    D = vars['D']
    H = vars['H']
    dx = H/(n-1)
    face_pos_vec = np.concatenate(([0],np.linspace(dx/2,H-dx/2,n-1),[H]))
    return np.diff(np.pi*(D/2)**2*face_pos_vec)

V0(vars)

Volume of shape.

Parameters:

Name Type Description Default
vars list

List of arguments

required
Source code in openterrace/domains/cylinder_1d.py
def V0(vars):
    """Volume of shape.

    Args:
        vars (list): List of arguments
    """

    D = vars['D']
    H = vars['H']
    return np.pi*(D/2)**2*H

dx(vars)

Node spacing function.

Parameters:

Name Type Description Default
vars list

List of arguments

required
Source code in openterrace/domains/cylinder_1d.py
def dx(vars):
    """Node spacing function.

    Args:
        vars (list): List of arguments
    """

    n = vars['n']
    H = vars['H']
    dx = H/(n-1)
    return np.repeat(dx, n)

node_pos(vars)

Node position function.

Parameters:

Name Type Description Default
vars list

List of arguments

required
Source code in openterrace/domains/cylinder_1d.py
def node_pos(vars):
    """Node position function.

    Args:
        vars (list): List of arguments
    """

    n = vars['n']
    H = vars['H']
    return np.array(np.linspace(0,H,n))

shape(vars)

Shape function.

Parameters:

Name Type Description Default
vars list

List of arguments

required
Source code in openterrace/domains/cylinder_1d.py
def shape(vars):
    """Shape function.

    Args:
        vars (list): List of arguments
    """

    n = vars['n']
    return np.array([n])

validate_input(vars, domain_shape)

Validates input arguments.

Parameters:

Name Type Description Default
vars list

List of arguments

required
domain_shape str

Name of domain type

required
Source code in openterrace/domains/cylinder_1d.py
def validate_input(vars, domain_shape):
    """Validates input arguments.

    Args:
        vars (list): List of arguments
        domain_shape (str): Name of domain type
    """

    required = ['n','D','H']
    for var in required:
        if not var in vars:
            raise Exception("Keyword \'"+var+"\' not specified for domain of type \'"+domain_shape+"\'")