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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2013, 03: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: 299
Rep Power: 18
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, 08:38
Default
  #2
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 14
styleworker is on a distinguished road
There is a multiregion solver available:
http://www.cfd-online.com/Forums/ope...eheatfoam.html
styleworker is offline   Reply With Quote

Old   November 27, 2013, 12:19
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MRFSimpleFoam wind turbine case continuity error ysh1227 OpenFOAM Running, Solving & CFD 1 August 16, 2016 09:25
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04
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 20:09
Build your own CFD solver Govert de With Main CFD Forum 9 December 12, 2001 05:51


All times are GMT -4. The time now is 03:49.