Why is there a 2 phase calc in the 3 phase recipe?

Hello

I was following the workflow of the 3 phase calculation process. When reading the batch file (and then making a calculation) I realised that honeybee makes a 2 phase DDS calculation excluding all window groups, then does the 3 phase calc I’m interested in. I don’t understand the benefit of making a 2 phase calculation first as it adds time to an already long calculation time.

For example, I want to test window arrangements for a new room. So I make each possible window as a group. I have no windows as a ‘window surface’ (only window groups). Then I have to wait whilst honeybee makes the default calculation (a 2 phase calculation) of a room with no windows. A person could argue that for the default calc there will be a particular window that will never change hence it can be included in the default calc, but for most my projects I want a black canvas to start with.

What am I missing here? What is the benefit of making this 2 phase calculation when I want to make a 3 phase calculation?

Thanks for input

John


this is the part of the batch file I’m referring to

[1/3] scene daylight matrix
echo :: :: rfluxmtx - [sky] [points] [wgroup] [blacked wgroups] [scene] ^> [dc.mtx]


Hi @john.everist, See here: Three phase vs five phase component resulting batch file calculations

Also documented on this Wiki page:

Thanks. For me, it would be useful to be able have an option to bypass the 5 phase part if there is no value in it for the calculation i am running.

1 Like

Agreed but to do that we need to know that there is no source of light to outside except for the window groups which is very hard to guess. I agreed we should expose it as an input that user can overwrite. When finally that next release comes out this should be addressed! :crossed_fingers: :pray:

if its useful to anyone, I wrote an override for the 3 phase calc recipe. It comments out the 2 phase bit (default scene) at the beginning and goes straight to the 3 phase calc. To stop the node (and other nodes crashing), it duplicates the results of the first window group into the files that the default scene would have created.

So be careful, the results for default scene are copy from windowgroup1 - not an issue for me as I always ignore those results.

(it also removes the ‘echo off’ function so you see all the code running - useful to me)

You modify the ‘runRadiance’ node. After line 65(ish) - after code:

batchFile = _analysisRecipe.write(folder, name)


hope that’s useful.

John

        #start of john mod
        #=======================================================================================
        with open(batchFile, "r") as infile: data = infile.readlines()[1:]
        data_mod = []
        start_index = False
        end_index = False
        for line in enumerate(data):
            if not start_index and "start of the calculation for scene" in line[1]: start_index = line[0]
            if not end_index and "start of the 3-phase calculation" in line[1]: end_index = line[0]

        for line in enumerate(data):
            a=line[1]
            
            if line[0] == start_index: data_mod.append("echo start of john mod##############################################\n")
            if line[0] > start_index:
                if line[0] < end_index:
                    a = "::"+a
            data_mod.append(a)
            if line[0] == end_index-1: data_mod.append("echo end of john mod####################################\n")
        
        for line in data_mod:
            if not line[:2] == "::" and r'rmtxop -c 47.4 119.9 11.6 -fa tmp' in line:
                e = line.split(">")[-1][:-1]
                break
        
        a=[
        "\n",
        "copy       "+e+r"         result\total..scene..default.ill"+"\n",
        "copy       "+e+r"         result\direct..scene..default.ill"+"\n",
        "copy       "+e+r"         result\sun..scene..default.ill"+"\n",
        "copy       "+e+r"         result\scene..default.ill"+"\n",
        #"pause",
        ]
        
        print a
        
        data_mod = data_mod+a
        
        with open(batchFile, "w") as file:
            file.write("".join(data_mod))


        #=======================================================================================
        #end of john mod
        #=======================================================================================


3 Likes

An extra +1 for calling it “john mod” …sounds cool ! Any reason why you are using DOS-based copy over shutil.copy ?

Copy in dos was simply to make the file structure identical to the original when batch file completes. I just reasoned there would be less disruption to the python code so less chance of errors.

Oh, and as yes as you spotted, if you do not write “John Mod” the code will not work