[Getdp] position dependent source term in heat equation

Fabian Dortu Fabian.Dortu at imec.be
Mon Dec 13 18:01:09 CET 2004


Hello

I try to add a position dependent source term in the heat equation but
it seems like getdp is using a constant value instead.

The source term is given by: 

qVol [ Vol_The ] = 2e9*Exp[-(($X-4)/0.6)^2 -(($Y-0.5)/0.6)^2];

and I have added this line in Formulation:

Galerkin { [ -qVol[] , {T} ];
         In Vol_The; Integration I1; Jacobian JacZyl;  }

What am I (or getdp?) doing wrong?
Note that, using cylindrical or rectangular coordinates give the
problem.

Thanx,
Fabian


My input files are a modification of the zyl-2d example given on the
site:

$ more zyl-2d.geo
lc = 0.1;
Point(1) = {5, 6, 0, lc};
Point(2) = {5, 0, 0, lc};
Point(3) = {1, 0, 0, lc};
Point(4) = {1, 6, 0, lc};
Line (1) = {1, 2};
Line (2) = {2, 3};
Line (3) = {3, 4};
Line (4) = {4, 1};
Line Loop (5) = {1, 2, 3, 4};
Plane Surface (6) = {5};
Physical Line (7) = {1};
Physical Line (8) = {3};
Physical Line (9) = {2};
Physical Line (10) = {4};
Physical Surface (11) = {6};

-------------------------------------------------------------------

$ more zyl-2d.pro
Group {
 inner  = Region[8] ;
 outer = Region[7];
 top = Region[10];
 bottom = Region[9];
 wall = Region[11];
 
 
 Vol_The = Region[{wall, inner, outer, top, bottom}] ;
 boundary = Region[{inner, outer, top, bottom}];
}
 
Constraint {
  { Name Sta_T ; Type Assign;
    Case {
     { Region inner; Value 30.; }
     { Region outer; Value 10.; }
     { Region bottom; Value 10; }
    }
  }
}
 
Function {
   k[ Vol_The ] =  1.45 ; // [W / m?K] quartz around 20?C
   qVol [ Vol_The ] = 2e9*Exp[-(($X-4)/0.6)^2 -(($Y-0.5)/0.6)^2];
   //qVol [ Vol_The ] = 27;
}
 
Include "Thermal.pro"
 
PostOperation {
 
  { Name map ; NameOfPostProcessing map ;
    Operation {
      Print[ T, OnElementsOf Vol_The , File "T.pos"];
      Print[ q, OnElementsOf Vol_The , File "q.pos"];
      Print[ qVol, OnElementsOf Vol_The , File "qVol.pos"];
      Print[ T, OnLine { {1.,0.5,0} {5.,0.5,0} } {50} , Format Table,
File "Th.dat"];
    }
  }
}


-----------------------------------------------------------------------
$ more Thermal.pro
Jacobian {
  { Name JacZyl ;
    Case {
    { Region wall ; Jacobian VolAxi ; }
    { Region boundary; Jacobian SurAxi ; }
    }
  }
 
  { Name JacRec ;
    Case {
    { Region wall ; Jacobian Vol ; }
    { Region boundary; Jacobian Sur ; }
    }
  }
 
}
 
Integration {
  { Name I1 ;
    Case {
    { Type Gauss ;
      Case {
        { GeoElement Point       ; NumberOfPoints  1 ; }
        { GeoElement Line        ; NumberOfPoints  3 ; }
        { GeoElement Triangle    ; NumberOfPoints  4 ; }
      }
    }
  }
 }
}
 
FunctionSpace {
  { Name Hgrad_T; Type Form0;
    BasisFunction {
      { Name sn; NameOfCoef Tn; Function BF_Node; Support Vol_The;
      Entity NodesOf[All]; }
    }
    Constraint {
      { NameOfCoef Tn; EntityType NodesOf ; NameOfConstraint Sta_T; }
    }
  }
}
 
Formulation {
  { Name The_T ; Type FemEquation;
  Quantity {
    { Name T;  Type Local; NameOfSpace Hgrad_T; }
  }
  Equation {
    Galerkin { [ k[] * Dof{d T} , {d T} ];
         In Vol_The; Integration I1; Jacobian JacZyl;  }
   Galerkin { [ -qVol[] , {T} ];
         In Vol_The; Integration I1; Jacobian JacZyl;  }
    }
  }
}
 
 
Resolution {
  { Name linear;
  System {
    { Name T; NameOfFormulation The_T; }
  }
  Operation {
    Generate [T] ;  Solve [T] ; SaveSolution [T] ;
    }
  }
}
 
PostProcessing {
 
  { Name map; NameOfFormulation The_T;
  Quantity {
    { Name T; Value{ Local{ [ {T} ] ; In Vol_The; Jacobian JacZyl; } } }
    { Name q; Value{ Local{ [ -k[]*{ Grad T} ] ; In Vol_The; Jacobian
JacZyl;} } }
    { Name qVol; Value{ Local{ [ qVol[] ] ; In Vol_The; Jacobian
JacZyl;} } }
   }
  }
}