CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

build my own multi-region solver : pb with flux continuity

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 28, 2013, 04:52
Default build my own multi-region solver : pb with flux continuity
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 230
Rep Power: 9
Cyp is on a distinguished road
Hi !

I am currently trying to develop my own multi-region solver. For sake of simplicity, let's say I have two regions, a "solid" and a "fluid". I want to solve heat transfers in both regions, with continuity and flux continuity at the solid/fluid interface.

Code:
fvScalarMatrix TsEqn
(
    fvm::laplacian(DTs,Ts)
);
TsEqn.solve();

fvScalarMatrix TfEqn
(
    fvm::laplacian(DTf,Tf)
);
TfEqn.solve();
Basically, I defined a solid_to_fluid and a fluid_to_solid patch to patch interpolation

Code:
    patchToPatchInterpolation solid_to_fluid
    (
        solidMesh.boundaryMesh()[labelSolid],
        fluidMesh.boundaryMesh()[labelFluid]
    );


    patchToPatchInterpolation fluid_to_solid
    (
        fluidMesh.boundaryMesh()[labelFluid],
        solidMesh.boundaryMesh()[labelSolid]
    
    );
I apply successfully the value of Ts at the solid/fluid interface as a boundary condition for Tf :

Code:
    scalarField &TsP = Ts.boundaryField()[labelSolid];
    scalarField &TfP = Tf.boundaryField()[labelFluid];

    TfP = solid_to_fluid.faceInterpolate(TsP);
This part is ok.

My problem concern the flux continuity at the region interface. I want to apply the flux continuity imposing the solid temperature gradient at the interface with

Code:
    vectorField n = fluidMesh.boundary()[labelFluid].nf();

    volVectorField gradTf = DTf/DTs*fvc::grad(Tf);

    scalarField nGradTf = n & gradTf.boundaryField()[labelFluid] ;

    fixedGradientFvPatchScalarField& gradTsPatch=refCast<fixedGradientFvPatchScalarField>(Ts.boundaryField()[labelSolid]); 
    scalarField& gradTsField =  gradTsPatch.gradient();

    gradTsField = p2_to_p1.faceInterpolate(nGradTf);
However it fails to have good result, and I can't have flux continuity. Is someone have an idea to solve my problem ?

best regards,
Cyp
Cyp is offline   Reply With Quote

Old   November 27, 2013, 09:38
Default
  #2
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 6
styleworker is on a distinguished road
There is a multiregion solver available:
Convective multi-region HT (MRconjugateHeatFoam)
styleworker is offline   Reply With Quote

Old   November 27, 2013, 13:19
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 230
Rep Power: 9
Cyp is on a distinguished road
Yes I worked on its basis.

Actually, to solve the "problem" I mentionede above, one need to under-relax the flux boundary condition, and iterate until convergence.
Cyp is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using starToFoam clo OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 33 September 26, 2012 04:04
MRFSimpleFoam wind turbine case continuity error ysh1227 OpenFOAM Running, Solving & CFD 0 May 23, 2012 05:26
compressible two phase flow in CFX4.4 youngan CFX 0 July 1, 2003 23:32
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09
Build your own CFD solver Govert de With Main CFD Forum 9 December 12, 2001 06:51


All times are GMT -4. The time now is 18:29.