def domain_boundaries(self): if self._domain_boundaries is None: self._domain_boundaries = [ LineElement(control_points, **metadata) for control_points, metadata in zip( self.control_points, self.boundary_metadata) ] return self._domain_boundaries
def simple_domain(): control_points = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] boundary1 = BSplineElement(control_points) boundary2 = LineElement([[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]]) domain_boundaries = (boundary1, boundary2) domain = SimpleDomain(domain_boundaries) return domain
def simple_domain(request): control_points = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] boundary1 = BSplineElement(control_points, bcond={"type_one": True}) boundary2 = LineElement([[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]], bcond={"type_two": True}) domain_boundaries = (boundary1, boundary2) domain = SimpleDomain(domain_boundaries, msh_format=request.param) return domain
def forms(): control_points_1 = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] control_points_2 = [[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]] boundary1 = BSplineElement(control_points_1, bcond={ "noslip": True, "heat_flux": 10 }) boundary2 = LineElement(control_points_2, bcond={ "impedance": 5, "isothermal": True }) domain_boundaries = (boundary1, boundary2) domain = SimpleDomain(domain_boundaries) forms = TVAcousticWeakForm(domain, Re=1, Pe=1) return forms
import numpy as np import cmath nozzle_height = -0.2 control_points_0 = [[9.1, nozzle_height], [9.1, 0.0]] control_points_1 = [[9.1, 0.0], [0.0, 0.0], [0.0, 4.7]] control_points_2 = [[0.0, 4.7], [2.0, 4.7]] control_points_3 = [[2.0, 4.7], [2.0, 0.7], [5.2, 0.7]] control_points_3a = [[5.2, 0.7], [9.2, 0.7]] control_points_4 = [[9.2, 0.7], [9.2, nozzle_height]] control_points_5 = [[9.2, nozzle_height], [9.1, nozzle_height]] el_size = 0.15 boundary0 = LineElement(control_points_0, el_size=el_size / 4.0, bcond={ "noslip": True, "isothermal": True }) boundary1 = LineElement(control_points_1, el_size=el_size, bcond={ "noslip": True, "isothermal": True }) boundary2 = LineElement(control_points_2, el_size=el_size, bcond={ "free": True, "adiabatic": True }) boundary3 = LineElement(control_points_3,
from firecrest.mesh.boundaryelement import LineElement from firecrest.mesh.geometry import SimpleDomain from firecrest.solvers.unsteady_tv_acoustic_solver import UnsteadyTVAcousticSolver import dolfin as dolf control_points_1 = [[0.0, 1.0], [0.0, 0.0], [1.0, 0.0]] control_points_2 = [[1.0, 0.0], [1.0, 1.0], [0.0, 1.0]] boundary1 = LineElement( control_points_1, el_size=0.05, bcond={ "slip": True, "isothermal": True } # noslip ) boundary2 = LineElement(control_points_2, el_size=0.05, bcond={ "free": True, "adiabatic": True }) domain_boundaries = (boundary1, boundary2) domain = SimpleDomain(domain_boundaries) solver = UnsteadyTVAcousticSolver(domain, Re=1.0e3, Pr=10.0, dt=1.0e-2) initial_state = ( dolf.Expression( "exp(-(sqrt(x[0]*x[0] + x[1]*x[1]) - 0.5)*(sqrt(x[0]*x[0] + x[1]*x[1]) - 0.5)/0.025)", # degree=2, element=solver.forms.pressure_function_space.ufl_element(), ),
s0 = initial_guess Re = 6000.0 control_points_0 = [[9.1, -0.2], [9.1, 0.0]] control_points_1 = [[9.1, 0.0], [0.0, 0.0], [0.0, 4.7]] control_points_2 = [[0.0, 4.7], [2.0, 4.7]] control_points_3 = [[2.0, 4.7], [2.0, 0.7], [9.2, 0.7]] control_points_4 = [[9.2, 0.7], [9.2, -0.2]] control_points_5 = [[9.2, -0.2], [9.1, -0.2]] el_size = 0.06 boundary0 = LineElement( control_points_0, el_size=el_size / 4.0, bcond={"noslip": True, "adiabatic": True} ) boundary1 = LineElement( control_points_1, el_size=el_size, bcond={"noslip": True, "adiabatic": True} ) boundary2 = LineElement( control_points_2, el_size=el_size, bcond={"free": True, "adiabatic": True} ) boundary3 = LineElement( control_points_3, el_size=el_size, bcond={"noslip": True, "adiabatic": True} ) boundary4 = LineElement( control_points_4, el_size=el_size / 2.0, bcond={"slip": True, "adiabatic": True}, # symmetric # bcond={"free": True, "isothermal": True}, # antisymmetric
from firecrest.mesh.boundaryelement import BSplineElement, LineElement from firecrest.mesh.geometry import SimpleDomain line_control_points = [[0.5, 0.1], [0.5, -0.2], [0.0, -0.2], [0.0, 0.0]] bspline_control_points = [ [0.0, 0.0], [0.1, 0.1], [0.2, -0.1], [0.3, 0.2], [0.4, 0.0], [0.5, 0.1], ] if __name__ == "__main__": bspline_boundary = BSplineElement(bspline_control_points) line_boundary = LineElement(line_control_points, el_size=0.1) domain = SimpleDomain([bspline_boundary, line_boundary])