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

a phase exist in two fields,how to patch it

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 16, 2018, 06:29
Default a phase exist in two fields,how to patch it
  #1
New Member
 
Jiahui Liu
Join Date: Dec 2018
Posts: 5
Rep Power: 7
huie is on a distinguished road
SetfieldDict can patch initial phase in one region.now I want to patch two fields with one phase.So I code like this:

regions
(
BoxToCell
box (0 0.02 0) (0.003 0.023 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0
box (0.08 0 0) (0.1 0.05 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0

);
}
);

but actually it only patched the second field i have patched,what's wrong with my code?
huie is offline   Reply With Quote

Old   December 19, 2018, 07:37
Default
  #2
Member
 
Geir Karlsen
Join Date: Nov 2013
Location: Norway
Posts: 59
Rep Power: 13
gkarlsen is on a distinguished road
Quote:
Originally Posted by huie View Post
SetfieldDict can patch initial phase in one region.now I want to patch two fields with one phase.So I code like this:

regions
(
BoxToCell
box (0 0.02 0) (0.003 0.023 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0
box (0.08 0 0) (0.1 0.05 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0

);
}
);

but actually it only patched the second field i have patched,what's wrong with my code?
You need to do boxToCell twice. Something like this:

Code:
regions
(
    boxToCell
    {
        box (-1 -1 -1) (1 0.6 0.1);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
        );
    }
    boxToCell
    {
        box (-1 -1 -1) (1 0.6 0.1);
        fieldValues
        (
            volScalarFieldValue p_rgh 1000
        );

    }
    boxToCell
    {

        box (-1 0.6 -1) (1 5 0);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
        );
    }
);
gkarlsen is offline   Reply With Quote

Old   December 23, 2018, 09:06
Default
  #3
New Member
 
Jiahui Liu
Join Date: Dec 2018
Posts: 5
Rep Power: 7
huie is on a distinguished road
much help,thank you
huie 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
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 15:33
Problem with cyclic boundaries in Openfoam 1.5 fs82 OpenFOAM 36 January 7, 2015 00:31
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04
[mesh manipulation] Using createPatch in place of couplePatches sripplinger OpenFOAM Meshing & Mesh Conversion 8 November 13, 2009 07:14
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


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