Skip to content
Snippets Groups Projects
Commit 0c9c8e58 authored by Emilie Marchandise's avatar Emilie Marchandise
Browse files

No commit message

No commit message
parent 27d172fc
No related branches found
No related tags found
No related merge requests found
model = GModel () model = GModel ()
model:load ('box.geo') model:load ('box.geo')
model:load ('box.msh') model:load ('box.msh')
dg = dgSystemOfEquations (model) dg = dgSystemOfEquations (model)
dg:setOrder(1) dg:setOrder(1)
-- initial condition
function initial_condition( xyz , f )
for i=0,xyz:size1()-1 do
x = xyz:get(i,0)
y = xyz:get(i,1)
z = xyz:get(i,2)
--f:set (i, 0, math.exp(-100*((x-0.5)^2)))
--f:set (i, 0, x )
f:set (i, 0, math.sqrt((x-0.3)*(x-0.3)+(y-0.3)*(y-0.3)+z*z)-0.2)
--f:set(i, 0, math.exp((x-.3)*(x-.3)+(y-.3)*(y-.3)+z*z)-.2))
end
end
-- conservation law -- conservation law
-- advection speed -- advection speed
...@@ -11,41 +24,27 @@ v=fullMatrix(3,1); ...@@ -11,41 +24,27 @@ v=fullMatrix(3,1);
v:set(0,0,0.15) v:set(0,0,0.15)
v:set(1,0,0) v:set(1,0,0)
v:set(2,0,0) v:set(2,0,0)
-- diffusivity
nu=fullMatrix(1,1);
nu:set(0,0,0.001)
--law = ConservationLawAdvection(functionConstant(v):getName(),functionConstant(nu):getName())
--law = ConservationLawAdvection('',functionConstant(nu):getName())
law = dgConservationLawAdvection(functionConstant(v):getName(),'') law = dgConservationLawAdvection(functionConstant(v):getName(),'')
dg:setConservationLaw(law) dg:setConservationLaw(law)
-- boundary condition -- boundary condition
outside=fullMatrix(1,1) outside=fullMatrix(1,1)
outside:set(0,0,1) outside:set(0,0,0.15)
bndcondition=law:newOutsideValueBoundary(functionConstant(outside):getName()) --freestreem=law:newOutsideValueBoundary(functionConstant(outside):getName())
--[[law:addBoundaryCondition('Left',bndcondition) freestream=law:newOutsideValueBoundary(functionLua(1,'initial_condition',{'XYZ'}):getName())
law:addBoundaryCondition('Right',bndcondition)
--]]
dg:setup() law:addBoundaryCondition('wall',law:new0FluxBoundary())
law:addBoundaryCondition('inlet',freestream)
law:addBoundaryCondition('outlet',law:newSymmetryBoundary())
law:addBoundaryCondition('symmetry',law:newSymmetryBoundary())
-- initial condition dg:setup()
function initial_condition( xyz , f )
for i=0,xyz:size1()-1 do
x = xyz:get(i,0)
--y = xyz:get(i,1)
--z = xyz:get(i,2)
--f:set (i, 0, math.exp(-100*((x-0.5)^2)))
f:set (i, 0, x )
end
end
-- dg:L2Projection(functionLua(1,'initial_condition',{'XYZ'}):getName())
law:addBoundaryCondition('boundary',law:new0FluxBoundary()) dg:L2Projection(functionLua(1,'initial_condition',{'XYZ'}):getName())
dg:exportSolution('output/Adv3D-00000')
dg:exportSolution('output/Adv3D_00000') print'***exporting init solution ***'
-- main loop -- main loop
n = 5 n = 5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment