[Getdp] Time-dependent constraints
Rasilo Paavo
paavo.rasilo at aalto.fi
Mon May 16 17:02:58 CEST 2011
Hi,
I have a question on time-dependent constraints...
I'm dealing with a 3-D magnetic vector potential formulation for eddy-current simulations.
As a source, I'm trying to set the vector potential on one boundary surface (SourcePhi) to be a gradient of a known scalar function phi[].
Function phi[] is defined as a list of values in the nodes of the surface.
The following works well in a static case:
******************************************************************
Function {
listphi = ListFromFile["phi.txt"];
phi[] = ValueFromIndex[]{listphi{}};
}
Constraint {
{ Name SourcePhi ; Case { { Region SourcePhi ; Value phi[] ; } } }
}
FunctionSpace {
{ Name Hcurl_a ; Type Form1 ;
BasisFunction {
{ Name se1 ; NameOfCoef ae1 ; Function BF_Edge ; Support Core ; Entity EdgesOf[ All , Not SourcePhi ] ; }
{ Name se2 ; NameOfCoef ae2 ; Function BF_GroupOfEdges ; Support Core ; Entity GroupsOfEdgesOnNodesOf[ SourcePhi ] ; }
}
Constraint {
{ NameOfCoef ae2 ; EntityType NodesOf ; NameOfConstraint SourcePhi ; }
}
}
}
******************************************************************
Next, I'd like to make a transient simulation with phi[] defined similarly for each time step separately.
However, the following does not seem to work:
******************************************************************
Function {
// Lists for each time step
listphi_0 = ListFromFile["phi0.txt"]; phi_0[] = ValueFromIndex[]{listphi_0{}};
listphi_1 = ListFromFile["phi1.txt"]; phi_1[] = ValueFromIndex[]{listphi_1{}};
listphi_2 = ListFromFile["phi2.txt"]; phi_2[] = ValueFromIndex[]{listphi_2{}};
// etc..
// Source function
phi[] = ($TimeStep==0) ? phi_0[] :
($TimeStep==1) ? phi_1[] :
($TimeStep==2) ? phi_2[] :
// etc..
}
Constraint {
{ Name SourcePhi ; Case { { Region SourcePhi ; Value 1. ; TimeFunction phi[] ; } } }
}
******************************************************************
>From that, I get an error message "Unknown Entity Index (0) in ValueFromIndex Table".
Is it so that the function used as the TimeFunction cannot be coordinate-dependent?
Even X[] and Y[] inside the function do not seem to work.
Is there any other way to impose such a boundary condition on each time step separately?
With best regards,
Paavo Rasilo
--
Aalto University School of Electrical Engineering
Espoo, Finland