CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How can I do a solidWallMixedVoltageCoupled patch in chtMultiRegionFoam? (http://www.cfd-online.com/Forums/openfoam-programming-development/73222-how-can-i-do-solidwallmixedvoltagecoupled-patch-chtmultiregionfoam.html)

 Niklas Järvstråt March 2, 2010 10:23

How can I do a solidWallMixedVoltageCoupled patch in chtMultiRegionFoam?

Hi!
I am trying to use a very simple calculation of electric potential field solver with chtMultiRegionFoam. I can run the solver and get nice potential fields with fixed boundary conditions. However, I cannot seem to get the interface patch, solidWallMixedTemperatureCoupledFvPatchScalarField , to work.
First, I tried just assigning the electric field instead of temperature in changeDictionaryDict of the System subdirectories:

wire_to_topAir
{
type solidWallMixedTemperatureCoupled;
neighbourFieldName Vel;
sigma sigma;
value uniform 400;
}

Vel is my introduced electric potential field, and sigma the electric resistivity. The calculation starts, but soon diverges as there is no coupling.

Then I tried making a copy of solidWallMixedTemperatureCoupledFvPatchScalarField specifically for the potential field, replacing all "T" by "Vel" and all "K" by "sigma", but essentially it was just a renaming excercise as I don't understand the structure well enough.
My question is what needs to be changed in solidWallMixedTemperatureCoupledFvPatchScalarField .H(and .C) and/or the input files to couple another field than temperature?

PS
See
http://www.tfd.chalmers.se/~hani/kur...roject0126.pdf
and
http://www.tfd.chalmers.se/~hani/kur...erAndCases.tgz

 Niklas Järvstråt March 16, 2010 06:13

Flux seems to work...

Hi Again, seems I am too vague or have an odd problem as no response so far. :( However, I have tried some more, running with the subroutines I made, and it seems the problem is in transferring the value of the voltage, while the flux *is* transferred in the other direction, at least somehow.
I run a simulation with homogeneous zero start voltage and only one region("wire") has one external boundary at non-zero voltage(400). The first increment all other regions voltage stays zero, while the one with a non-zero boundary reaches that boundary value homogenously. In the second increment, the neighbouring region reaches a homogeneous and ridiculously high voltage(8.3e+18), while the wire now seems to have the boundary to the surrounding region set to 200 !? (Incidentally, I used 200 there in the previous simulation, but the value was not used this time.)
Am I calling variables that have not been assigned values?

In createSolidFields I have added the lines:
PtrList<volScalarField> VSolid(solidRegions.size());
Info<< " Adding to VSolid\n" << endl;
VSolid.set
(
i,
new volScalarField
(
IOobject
(
"Vel",
runTime.timeName(),
solidRegions[i],
IOobject::AUTO_WRITE
),
solidRegions[i]
)
);

 Niklas Järvstråt April 1, 2010 05:22